From 08fab1af4e02d7320697483843b8dade38126b4e Mon Sep 17 00:00:00 2001 From: VampireChicken12 Date: Fri, 15 Dec 2023 17:12:55 -0500 Subject: [PATCH 1/2] style(prettier): enable experimental ternaries --- .github/ISSUE_TEMPLATE/bug_report.md | 15 +- .github/ISSUE_TEMPLATE/feature_request.md | 7 +- CHANGELOG.md | 232 +++++++----------- README.md | 1 + package.json | 152 ++++++------ prettier.config.cjs | 1 + src/components/Inputs/Select/Select.tsx | 13 +- src/components/Settings/Settings.tsx | 7 +- .../components/SettingNotifications.tsx | 11 +- src/features/featureMenu/index.ts | 10 +- src/features/playerQuality/index.ts | 9 +- src/features/playerSpeed/index.ts | 18 +- src/features/remainingTime/index.ts | 18 +- src/features/rememberVolume/index.ts | 9 +- src/features/rememberVolume/utils.ts | 9 +- .../scrollWheelVolumeControl/index.ts | 20 +- .../scrollWheelVolumeControl/utils.ts | 11 +- src/features/videoHistory/index.ts | 10 +- src/i18n/index.ts | 68 ++--- src/pages/content/index.tsx | 9 +- src/types/index.ts | 22 +- 21 files changed, 307 insertions(+), 345 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2fcf1c6d..dd00c084 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,10 +1,9 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- **Describe the bug** @@ -12,6 +11,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..2bc5d5f7 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,10 +1,9 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- **Is your feature request related to a problem? Please describe.** diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c5d035..8ce6c266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,234 +1,186 @@ ## [1.17.1](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.17.0...v1.17.1) (2023-12-15) - ### Bug Fixes -* **scroll wheel volume control:** the youtube settings menu can now be scrolled in ([6607ef3](https://github.com/VampireChicken12/youtube-enhancer/commit/6607ef398aa975987927a7795f185ed88f6e3e9d)), closes [#178](https://github.com/VampireChicken12/youtube-enhancer/issues/178) - - - - +- **scroll wheel volume control:** the youtube settings menu can now be scrolled in ([6607ef3](https://github.com/VampireChicken12/youtube-enhancer/commit/6607ef398aa975987927a7795f185ed88f6e3e9d)), closes [#178](https://github.com/VampireChicken12/youtube-enhancer/issues/178) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.17.1-Chrome.zip | 21ab80071e7c87c999b1ba51d7c10b37ec7099f1c60b92bba4031c253ddf5f9a | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.17.1-Chrome.zip | 21ab80071e7c87c999b1ba51d7c10b37ec7099f1c60b92bba4031c253ddf5f9a | | youtube-enhancer-v1.17.1-Chromium.zip | 21ab80071e7c87c999b1ba51d7c10b37ec7099f1c60b92bba4031c253ddf5f9a | -| youtube-enhancer-v1.17.1-Edge.zip | 21ab80071e7c87c999b1ba51d7c10b37ec7099f1c60b92bba4031c253ddf5f9a | -| youtube-enhancer-v1.17.1-Firefox.zip | 542a774e109469a80edb7976e98d7f0f3d923e8a96132ce978cbc5db16cd6b84 | +| youtube-enhancer-v1.17.1-Edge.zip | 21ab80071e7c87c999b1ba51d7c10b37ec7099f1c60b92bba4031c253ddf5f9a | +| youtube-enhancer-v1.17.1-Firefox.zip | 542a774e109469a80edb7976e98d7f0f3d923e8a96132ce978cbc5db16cd6b84 | # [1.17.0](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.16.3...v1.17.0) (2023-12-15) - ### Bug Fixes -* **feature menu:** ads button now dimmed when feature menu is open ([2dea512](https://github.com/VampireChicken12/youtube-enhancer/commit/2dea512eaca67c9070f5bdae737878cb7d98e720)), closes [#162](https://github.com/VampireChicken12/youtube-enhancer/issues/162) - +- **feature menu:** ads button now dimmed when feature menu is open ([2dea512](https://github.com/VampireChicken12/youtube-enhancer/commit/2dea512eaca67c9070f5bdae737878cb7d98e720)), closes [#162](https://github.com/VampireChicken12/youtube-enhancer/issues/162) ### Features -* add open transcript button to feature menu ([36d91d7](https://github.com/VampireChicken12/youtube-enhancer/commit/36d91d7f4be417db138cddb62ccdfbaf49b7c9a9)), closes [#164](https://github.com/VampireChicken12/youtube-enhancer/issues/164) - - - - +- add open transcript button to feature menu ([36d91d7](https://github.com/VampireChicken12/youtube-enhancer/commit/36d91d7f4be417db138cddb62ccdfbaf49b7c9a9)), closes [#164](https://github.com/VampireChicken12/youtube-enhancer/issues/164) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.17.0-Chrome.zip | 53f2675ff8b2c8d5324b76314d4c209757874460448b4c847d4329a99adc9c13 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.17.0-Chrome.zip | 53f2675ff8b2c8d5324b76314d4c209757874460448b4c847d4329a99adc9c13 | | youtube-enhancer-v1.17.0-Chromium.zip | 53f2675ff8b2c8d5324b76314d4c209757874460448b4c847d4329a99adc9c13 | -| youtube-enhancer-v1.17.0-Edge.zip | 53f2675ff8b2c8d5324b76314d4c209757874460448b4c847d4329a99adc9c13 | -| youtube-enhancer-v1.17.0-Firefox.zip | cd48448b32f9be65e194f7843872ced9b92eeae4992ca446ef38d9d03c941960 | +| youtube-enhancer-v1.17.0-Edge.zip | 53f2675ff8b2c8d5324b76314d4c209757874460448b4c847d4329a99adc9c13 | +| youtube-enhancer-v1.17.0-Firefox.zip | cd48448b32f9be65e194f7843872ced9b92eeae4992ca446ef38d9d03c941960 | ## [1.16.3](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.16.2...v1.16.3) (2023-12-06) - ### Bug Fixes -* **scroll in video bug:** Allow scroll to be used ([0d8a9c0](https://github.com/VampireChicken12/youtube-enhancer/commit/0d8a9c0766649410106726a028756f5652aa1c21)) -* **scroll in video bug:** make it work ([6b2af8d](https://github.com/VampireChicken12/youtube-enhancer/commit/6b2af8d74432e7fb93587f662e59baaee41dab35)) -* **scroll in video bug:** make it work ([d417fe7](https://github.com/VampireChicken12/youtube-enhancer/commit/d417fe7771173b7380ab59c49050a7dc5be583f2)) - - - - +- **scroll in video bug:** Allow scroll to be used ([0d8a9c0](https://github.com/VampireChicken12/youtube-enhancer/commit/0d8a9c0766649410106726a028756f5652aa1c21)) +- **scroll in video bug:** make it work ([6b2af8d](https://github.com/VampireChicken12/youtube-enhancer/commit/6b2af8d74432e7fb93587f662e59baaee41dab35)) +- **scroll in video bug:** make it work ([d417fe7](https://github.com/VampireChicken12/youtube-enhancer/commit/d417fe7771173b7380ab59c49050a7dc5be583f2)) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.16.3-Chrome.zip | d3d5bcb979ab923bbc45d775f5203a93b7d551ca29e8fc14cd04cdfe1336d7ee | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.16.3-Chrome.zip | d3d5bcb979ab923bbc45d775f5203a93b7d551ca29e8fc14cd04cdfe1336d7ee | | youtube-enhancer-v1.16.3-Chromium.zip | d3d5bcb979ab923bbc45d775f5203a93b7d551ca29e8fc14cd04cdfe1336d7ee | -| youtube-enhancer-v1.16.3-Edge.zip | d3d5bcb979ab923bbc45d775f5203a93b7d551ca29e8fc14cd04cdfe1336d7ee | -| youtube-enhancer-v1.16.3-Firefox.zip | 9f17be568828703cebca1c2f76a8eb7382e9a2589b0bdbd9ffb34bece13af92a | +| youtube-enhancer-v1.16.3-Edge.zip | d3d5bcb979ab923bbc45d775f5203a93b7d551ca29e8fc14cd04cdfe1336d7ee | +| youtube-enhancer-v1.16.3-Firefox.zip | 9f17be568828703cebca1c2f76a8eb7382e9a2589b0bdbd9ffb34bece13af92a | ## [1.16.2](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.16.1...v1.16.2) (2023-12-06) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.16.2-Chrome.zip | 7ca0f3e0bc0eaf126a3a48ce19ac1b81650497b8ab1bae6ea7ec66f8a4d077ec | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.16.2-Chrome.zip | 7ca0f3e0bc0eaf126a3a48ce19ac1b81650497b8ab1bae6ea7ec66f8a4d077ec | | youtube-enhancer-v1.16.2-Chromium.zip | 7ca0f3e0bc0eaf126a3a48ce19ac1b81650497b8ab1bae6ea7ec66f8a4d077ec | -| youtube-enhancer-v1.16.2-Edge.zip | 7ca0f3e0bc0eaf126a3a48ce19ac1b81650497b8ab1bae6ea7ec66f8a4d077ec | -| youtube-enhancer-v1.16.2-Firefox.zip | 07daed3b52043d7c829c3afaf2c82b78316ca00831e9dd21ae9277fcb9cb028c | +| youtube-enhancer-v1.16.2-Edge.zip | 7ca0f3e0bc0eaf126a3a48ce19ac1b81650497b8ab1bae6ea7ec66f8a4d077ec | +| youtube-enhancer-v1.16.2-Firefox.zip | 07daed3b52043d7c829c3afaf2c82b78316ca00831e9dd21ae9277fcb9cb028c | ## [1.16.1](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.16.0...v1.16.1) (2023-12-06) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.16.1-Chrome.zip | 1a20a46dfc01500f2d29b8161196305bff30261888728bd90a68454b33e3cd6f | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.16.1-Chrome.zip | 1a20a46dfc01500f2d29b8161196305bff30261888728bd90a68454b33e3cd6f | | youtube-enhancer-v1.16.1-Chromium.zip | 1a20a46dfc01500f2d29b8161196305bff30261888728bd90a68454b33e3cd6f | -| youtube-enhancer-v1.16.1-Edge.zip | 1a20a46dfc01500f2d29b8161196305bff30261888728bd90a68454b33e3cd6f | -| youtube-enhancer-v1.16.1-Firefox.zip | 99e7c71d78ff61155a787e7e55c4f38e5f5f7c5d66faf923538d7c65cd333e33 | +| youtube-enhancer-v1.16.1-Edge.zip | 1a20a46dfc01500f2d29b8161196305bff30261888728bd90a68454b33e3cd6f | +| youtube-enhancer-v1.16.1-Firefox.zip | 99e7c71d78ff61155a787e7e55c4f38e5f5f7c5d66faf923538d7c65cd333e33 | # [1.16.0](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.15.1...v1.16.0) (2023-12-05) - ### Bug Fixes -* **event manager:** fix multiple events per target not being supported ([999f865](https://github.com/VampireChicken12/youtube-enhancer/commit/999f86536eddc90e2852656bd541529e9c6d6186)) -* **import settings:** fix defaults not being saved ([e4ae516](https://github.com/VampireChicken12/youtube-enhancer/commit/e4ae516e816d93b4e009bf0631c08a5846d57356)) - +- **event manager:** fix multiple events per target not being supported ([999f865](https://github.com/VampireChicken12/youtube-enhancer/commit/999f86536eddc90e2852656bd541529e9c6d6186)) +- **import settings:** fix defaults not being saved ([e4ae516](https://github.com/VampireChicken12/youtube-enhancer/commit/e4ae516e816d93b4e009bf0631c08a5846d57356)) ### Features -* **feature menu:** Add behaviour setting with click and hover option ([c595f99](https://github.com/VampireChicken12/youtube-enhancer/commit/c595f99a7f8faab7424f7bae2ceb65de35d23855)) - - - - +- **feature menu:** Add behaviour setting with click and hover option ([c595f99](https://github.com/VampireChicken12/youtube-enhancer/commit/c595f99a7f8faab7424f7bae2ceb65de35d23855)) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.16.0-Chrome.zip | daab1b724bc43b29bb17f298e38f01c8ca7f4c2cd76db31587b1fdffaf609532 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.16.0-Chrome.zip | daab1b724bc43b29bb17f298e38f01c8ca7f4c2cd76db31587b1fdffaf609532 | | youtube-enhancer-v1.16.0-Chromium.zip | daab1b724bc43b29bb17f298e38f01c8ca7f4c2cd76db31587b1fdffaf609532 | -| youtube-enhancer-v1.16.0-Edge.zip | daab1b724bc43b29bb17f298e38f01c8ca7f4c2cd76db31587b1fdffaf609532 | -| youtube-enhancer-v1.16.0-Firefox.zip | 3664a8fc1bf3516912b7ea6343c508d886ebe06d8339ff2bf50a394866945018 | +| youtube-enhancer-v1.16.0-Edge.zip | daab1b724bc43b29bb17f298e38f01c8ca7f4c2cd76db31587b1fdffaf609532 | +| youtube-enhancer-v1.16.0-Firefox.zip | 3664a8fc1bf3516912b7ea6343c508d886ebe06d8339ff2bf50a394866945018 | ## [1.15.1](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.15.0...v1.15.1) (2023-12-01) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.15.1-Chrome.zip | 4dea658ce7f79b3bbfdf7742f7fb62756ede94e0c0f18b33da09d0fe0efd4a14 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.15.1-Chrome.zip | 4dea658ce7f79b3bbfdf7742f7fb62756ede94e0c0f18b33da09d0fe0efd4a14 | | youtube-enhancer-v1.15.1-Chromium.zip | 4dea658ce7f79b3bbfdf7742f7fb62756ede94e0c0f18b33da09d0fe0efd4a14 | -| youtube-enhancer-v1.15.1-Edge.zip | 4dea658ce7f79b3bbfdf7742f7fb62756ede94e0c0f18b33da09d0fe0efd4a14 | -| youtube-enhancer-v1.15.1-Firefox.zip | 37a39fe038b7f368a0ae19fbee25aa5ae98ec38c75477fd9182244acab0e5e13 | +| youtube-enhancer-v1.15.1-Edge.zip | 4dea658ce7f79b3bbfdf7742f7fb62756ede94e0c0f18b33da09d0fe0efd4a14 | +| youtube-enhancer-v1.15.1-Firefox.zip | 37a39fe038b7f368a0ae19fbee25aa5ae98ec38c75477fd9182244acab0e5e13 | # [1.15.0](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.14.4...v1.15.0) (2023-12-01) - ### Bug Fixes -* **notifications:** used old language when switching language ([4954223](https://github.com/VampireChicken12/youtube-enhancer/commit/49542238798b53127649731f882e1df9cd05c2d5)) -* **popup:** width was made too wide by long text ([2a88352](https://github.com/VampireChicken12/youtube-enhancer/commit/2a883524f485e7a788317d45e12dbf19b87569c7)) - - - - +- **notifications:** used old language when switching language ([4954223](https://github.com/VampireChicken12/youtube-enhancer/commit/49542238798b53127649731f882e1df9cd05c2d5)) +- **popup:** width was made too wide by long text ([2a88352](https://github.com/VampireChicken12/youtube-enhancer/commit/2a883524f485e7a788317d45e12dbf19b87569c7)) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.15.0-Chrome.zip | 98794847ecec435fb991bf889454eeaec872c896932ff12e5aceb4a131dafb81 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.15.0-Chrome.zip | 98794847ecec435fb991bf889454eeaec872c896932ff12e5aceb4a131dafb81 | | youtube-enhancer-v1.15.0-Chromium.zip | 98794847ecec435fb991bf889454eeaec872c896932ff12e5aceb4a131dafb81 | -| youtube-enhancer-v1.15.0-Edge.zip | 98794847ecec435fb991bf889454eeaec872c896932ff12e5aceb4a131dafb81 | -| youtube-enhancer-v1.15.0-Firefox.zip | 7aa484939d665d8aba089242fef2a4358600a679e68d1f79fad1fd93ba7c79c3 | +| youtube-enhancer-v1.15.0-Edge.zip | 98794847ecec435fb991bf889454eeaec872c896932ff12e5aceb4a131dafb81 | +| youtube-enhancer-v1.15.0-Firefox.zip | 7aa484939d665d8aba089242fef2a4358600a679e68d1f79fad1fd93ba7c79c3 | ## [1.14.4](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.14.3...v1.14.4) (2023-11-30) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.14.4-Chrome.zip | 025e4cde5380e49bcf0a187eb90c46698ab4c294f59ee6146d63379dd8a30bd6 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.14.4-Chrome.zip | 025e4cde5380e49bcf0a187eb90c46698ab4c294f59ee6146d63379dd8a30bd6 | | youtube-enhancer-v1.14.4-Chromium.zip | 025e4cde5380e49bcf0a187eb90c46698ab4c294f59ee6146d63379dd8a30bd6 | -| youtube-enhancer-v1.14.4-Edge.zip | 025e4cde5380e49bcf0a187eb90c46698ab4c294f59ee6146d63379dd8a30bd6 | -| youtube-enhancer-v1.14.4-Firefox.zip | 0f26d826fb411a7b94eb3cb0102789587c5713c158214a46a81f2859a6cf839c | +| youtube-enhancer-v1.14.4-Edge.zip | 025e4cde5380e49bcf0a187eb90c46698ab4c294f59ee6146d63379dd8a30bd6 | +| youtube-enhancer-v1.14.4-Firefox.zip | 0f26d826fb411a7b94eb3cb0102789587c5713c158214a46a81f2859a6cf839c | ## [1.14.3](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.14.2...v1.14.3) (2023-11-30) - ### Bug Fixes -* importing old settings error ([55b20e7](https://github.com/VampireChicken12/youtube-enhancer/commit/55b20e7606745a08a1274752f14501e922a2cb5c)) - - - - +- importing old settings error ([55b20e7](https://github.com/VampireChicken12/youtube-enhancer/commit/55b20e7606745a08a1274752f14501e922a2cb5c)) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.14.3-Chrome.zip | 64ba968f7a063a2c296f5ddddeb33c1fe0af189b5024de04dd08676c05c9a4f2 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.14.3-Chrome.zip | 64ba968f7a063a2c296f5ddddeb33c1fe0af189b5024de04dd08676c05c9a4f2 | | youtube-enhancer-v1.14.3-Chromium.zip | 64ba968f7a063a2c296f5ddddeb33c1fe0af189b5024de04dd08676c05c9a4f2 | -| youtube-enhancer-v1.14.3-Edge.zip | 64ba968f7a063a2c296f5ddddeb33c1fe0af189b5024de04dd08676c05c9a4f2 | -| youtube-enhancer-v1.14.3-Firefox.zip | 6bde2d33463a227775c9ac8ef2c1a6218f98661bb523fda32eaa96d820abc845 | +| youtube-enhancer-v1.14.3-Edge.zip | 64ba968f7a063a2c296f5ddddeb33c1fe0af189b5024de04dd08676c05c9a4f2 | +| youtube-enhancer-v1.14.3-Firefox.zip | 6bde2d33463a227775c9ac8ef2c1a6218f98661bb523fda32eaa96d820abc845 | ## [1.14.2](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.14.1...v1.14.2) (2023-11-29) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.14.2-Chrome.zip | e357d83d5560d838434c0ae1884b3cd66c6a66e41cace6a254ea8b8bfd5d0575 | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.14.2-Chrome.zip | e357d83d5560d838434c0ae1884b3cd66c6a66e41cace6a254ea8b8bfd5d0575 | | youtube-enhancer-v1.14.2-Chromium.zip | e357d83d5560d838434c0ae1884b3cd66c6a66e41cace6a254ea8b8bfd5d0575 | -| youtube-enhancer-v1.14.2-Edge.zip | e357d83d5560d838434c0ae1884b3cd66c6a66e41cace6a254ea8b8bfd5d0575 | -| youtube-enhancer-v1.14.2-Firefox.zip | 36bcafe9cdb8f8f884ba891dd1d0863e50e11a564c3c3b48be2cfc60cf172226 | +| youtube-enhancer-v1.14.2-Edge.zip | e357d83d5560d838434c0ae1884b3cd66c6a66e41cace6a254ea8b8bfd5d0575 | +| youtube-enhancer-v1.14.2-Firefox.zip | 36bcafe9cdb8f8f884ba891dd1d0863e50e11a564c3c3b48be2cfc60cf172226 | ## [1.14.1](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.14.0...v1.14.1) (2023-11-29) - - - - ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.14.1-Chrome.zip | c28715edb67de453bfe9b7b11300421a336bea8d35f148c6f23415088ba70f1a | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.14.1-Chrome.zip | c28715edb67de453bfe9b7b11300421a336bea8d35f148c6f23415088ba70f1a | | youtube-enhancer-v1.14.1-Chromium.zip | c28715edb67de453bfe9b7b11300421a336bea8d35f148c6f23415088ba70f1a | -| youtube-enhancer-v1.14.1-Edge.zip | c28715edb67de453bfe9b7b11300421a336bea8d35f148c6f23415088ba70f1a | -| youtube-enhancer-v1.14.1-Firefox.zip | 3f17c3a79fe8edd48ffbcc76c9b1615d795c43a67bd885ef8f7617617756002f | +| youtube-enhancer-v1.14.1-Edge.zip | c28715edb67de453bfe9b7b11300421a336bea8d35f148c6f23415088ba70f1a | +| youtube-enhancer-v1.14.1-Firefox.zip | 3f17c3a79fe8edd48ffbcc76c9b1615d795c43a67bd885ef8f7617617756002f | # [1.14.0](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.13.1...v1.14.0) (2023-11-29) - ### Features -* hold right click scroll wheel volume control ([3587c4a](https://github.com/VampireChicken12/youtube-enhancer/commit/3587c4a103903533e9b790d74e80d56b5179fe9b)) -* hover feature menu ([1006e40](https://github.com/VampireChicken12/youtube-enhancer/commit/1006e40ada448e06bfa6beb9cdbf88195bac4566)) - - - - +- hold right click scroll wheel volume control ([3587c4a](https://github.com/VampireChicken12/youtube-enhancer/commit/3587c4a103903533e9b790d74e80d56b5179fe9b)) +- hover feature menu ([1006e40](https://github.com/VampireChicken12/youtube-enhancer/commit/1006e40ada448e06bfa6beb9cdbf88195bac4566)) ## Release Artifacts -| File Name | SHA-256 Hash | -| :--- | :---: | -| youtube-enhancer-v1.14.0-Chrome.zip | 46dcb9ff70f513b0270e3dcdfa3ad3612fde7b1f57834a23d2e50ce47d47ec4c | + +| File Name | SHA-256 Hash | +| :------------------------------------ | :--------------------------------------------------------------: | +| youtube-enhancer-v1.14.0-Chrome.zip | 46dcb9ff70f513b0270e3dcdfa3ad3612fde7b1f57834a23d2e50ce47d47ec4c | | youtube-enhancer-v1.14.0-Chromium.zip | 46dcb9ff70f513b0270e3dcdfa3ad3612fde7b1f57834a23d2e50ce47d47ec4c | -| youtube-enhancer-v1.14.0-Edge.zip | 46dcb9ff70f513b0270e3dcdfa3ad3612fde7b1f57834a23d2e50ce47d47ec4c | -| youtube-enhancer-v1.14.0-Firefox.zip | 7b22ad88a317c695d30a6819408c60b5e55292a515c0ef98041ed9e48328ae34 | +| youtube-enhancer-v1.14.0-Edge.zip | 46dcb9ff70f513b0270e3dcdfa3ad3612fde7b1f57834a23d2e50ce47d47ec4c | +| youtube-enhancer-v1.14.0-Firefox.zip | 7b22ad88a317c695d30a6819408c60b5e55292a515c0ef98041ed9e48328ae34 | ## [1.13.1](https://github.com/VampireChicken12/youtube-enhancer/compare/v1.13.0...v1.13.1) (2023-11-27) diff --git a/README.md b/README.md index ce0326d7..70444f98 100755 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ The YouTube Enhancer Extension is a powerful browser extension designed to enhan ![Stars](https://img.shields.io/github/stars/VampireChicken12/youtube-enhancer.svg) [![Crowdin Translation Project Badge](https://badges.crowdin.net/youtube-enhancer/localized.svg)](https://crowdin.com/project/youtube-enhancer) [![Join our Discord server](https://img.shields.io/discord/1180688348675838132?label=Discord&logo=Discord)](https://discord.gg/VpdGFmuB4B) + ## Table of Contents - [Introduction](#-introduction) diff --git a/package.json b/package.json index 404e684c..78a12579 100644 --- a/package.json +++ b/package.json @@ -1,77 +1,77 @@ { - "name": "youtube-enhancer", - "author": { - "name": "VampireChicken12" - }, - "displayName": "YouTube Enhancer", - "version": "1.17.1", - "description": "YouTube Enhancer is a simple extension that adds some useful features to YouTube.", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/VampireChicken12/youtube-enhancer.git" - }, - "scripts": { - "build": "vite build", - "dev": "nodemon", - "format": "prettier --write .", - "lint": "eslint .", - "lint:fix": "eslint . --fix" - }, - "type": "module", - "dependencies": { - "@formkit/auto-animate": "^0.8.1", - "dotenv": "^16.3.1", - "i18next": "^23.7.3", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "vite-plugin-css-injected-by-js": "^3.3.0", - "webextension-polyfill": "^0.10.0" - }, - "devDependencies": { - "@semantic-release/changelog": "^6.0.3", - "@semantic-release/exec": "^6.0.3", - "@semantic-release/git": "^10.0.1", - "@thedutchcoder/postcss-rem-to-px": "^0.0.2", - "@total-typescript/ts-reset": "^0.5.1", - "@types/archiver": "^6.0.1", - "@types/chrome": "^0.0.254", - "@types/node": "^20.9.0", - "@types/react": "^18.2.37", - "@types/react-dom": "^18.2.15", - "@types/webextension-polyfill": "^0.10.6", - "@types/youtube-player": "^5.5.10", - "@typescript-eslint/eslint-plugin": "^6.10.0", - "@typescript-eslint/parser": "^6.10.0", - "@vitejs/plugin-react-swc": "^3.4.1", - "archiver": "^6.0.1", - "autoprefixer": "^10.4.16", - "clsx": "^2.0.0", - "concurrently": "^8.2.2", - "eslint": "^8.53.0", - "eslint-config-prettier": "^9.0.0", - "eslint-plugin-import": "^2.29.0", - "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-no-secrets": "^0.8.9", - "eslint-plugin-perfectionist": "^2.3.0", - "eslint-plugin-prettier": "^5.0.1", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-tailwindcss": "^3.13.0", - "fs-extra": "^11.1.1", - "get-installed-browsers": "^0.1.7", - "nodemon": "^3.0.1", - "postcss": "^8.4.31", - "prettier": "^3.0.3", - "semantic-release": "^22.0.7", - "tailwind-merge": "^2.0.0", - "tailwindcss": "^3.3.5", - "ts-json-as-const": "^1.0.7", - "ts-node": "^10.9.1", - "typescript": "^5.2.2", - "vite": "^4.5.1", - "zod": "^3.22.4", - "zod-error": "^1.5.0" - } -} \ No newline at end of file + "name": "youtube-enhancer", + "author": { + "name": "VampireChicken12" + }, + "displayName": "YouTube Enhancer", + "version": "1.17.1", + "description": "YouTube Enhancer is a simple extension that adds some useful features to YouTube.", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/VampireChicken12/youtube-enhancer.git" + }, + "scripts": { + "build": "vite build", + "dev": "nodemon", + "format": "prettier --write .", + "lint": "eslint .", + "lint:fix": "eslint . --fix" + }, + "type": "module", + "dependencies": { + "@formkit/auto-animate": "^0.8.1", + "dotenv": "^16.3.1", + "i18next": "^23.7.3", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "vite-plugin-css-injected-by-js": "^3.3.0", + "webextension-polyfill": "^0.10.0" + }, + "devDependencies": { + "@semantic-release/changelog": "^6.0.3", + "@semantic-release/exec": "^6.0.3", + "@semantic-release/git": "^10.0.1", + "@thedutchcoder/postcss-rem-to-px": "^0.0.2", + "@total-typescript/ts-reset": "^0.5.1", + "@types/archiver": "^6.0.1", + "@types/chrome": "^0.0.254", + "@types/node": "^20.9.0", + "@types/react": "^18.2.37", + "@types/react-dom": "^18.2.15", + "@types/webextension-polyfill": "^0.10.6", + "@types/youtube-player": "^5.5.10", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", + "@vitejs/plugin-react-swc": "^3.4.1", + "archiver": "^6.0.1", + "autoprefixer": "^10.4.16", + "clsx": "^2.0.0", + "concurrently": "^8.2.2", + "eslint": "^8.53.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.29.0", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-no-secrets": "^0.8.9", + "eslint-plugin-perfectionist": "^2.3.0", + "eslint-plugin-prettier": "^5.0.1", + "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-tailwindcss": "^3.13.0", + "fs-extra": "^11.1.1", + "get-installed-browsers": "^0.1.7", + "nodemon": "^3.0.1", + "postcss": "^8.4.31", + "prettier": "^3.0.3", + "semantic-release": "^22.0.7", + "tailwind-merge": "^2.0.0", + "tailwindcss": "^3.3.5", + "ts-json-as-const": "^1.0.7", + "ts-node": "^10.9.1", + "typescript": "^5.2.2", + "vite": "^4.5.1", + "zod": "^3.22.4", + "zod-error": "^1.5.0" + } +} diff --git a/prettier.config.cjs b/prettier.config.cjs index 3b870a9c..5369a63e 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -2,6 +2,7 @@ module.exports = { arrowParens: "always", endOfLine: "crlf", + experimentalTernaries: true, printWidth: 150, semi: true, singleQuote: false, diff --git a/src/components/Inputs/Select/Select.tsx b/src/components/Inputs/Select/Select.tsx index db32f13c..788867c9 100644 --- a/src/components/Inputs/Select/Select.tsx +++ b/src/components/Inputs/Select/Select.tsx @@ -67,24 +67,21 @@ const Select: React.FC = ({ className, disabled = false, id, label, onClick={toggleSelect} type="button" > - {selectedOption ? ( - options.find((option) => option.value === selectedOption)?.element ? ( + {selectedOption ? + options.find((option) => option.value === selectedOption)?.element ?
{options.find((option) => option.value === selectedOption)?.label} {options.find((option) => option.value === selectedOption)?.element}
- ) : ( -
+ :
{options.find((option) => option.value === selectedOption)?.label}
- ) - ) : ( - Select an option - )} + + : Select an option} {isSelectVisible && ( diff --git a/src/components/Settings/Settings.tsx b/src/components/Settings/Settings.tsx index dead2ce8..96d88995 100644 --- a/src/components/Settings/Settings.tsx +++ b/src/components/Settings/Settings.tsx @@ -732,7 +732,7 @@ export default function Settings() { type="button" value={t("settings.sections.importExportSettings.exportButton.value")} /> - {notifications.filter((n) => n.action === "reset_settings").length > 0 ? ( + {notifications.filter((n) => n.action === "reset_settings").length > 0 ? - ) : ( - - )} + }
diff --git a/src/components/Settings/components/SettingNotifications.tsx b/src/components/Settings/components/SettingNotifications.tsx index 064224b5..3f481e9d 100644 --- a/src/components/Settings/components/SettingNotifications.tsx +++ b/src/components/Settings/components/SettingNotifications.tsx @@ -24,8 +24,8 @@ export default function SettingsNotifications() { })} key={index} > - {notification.action ? ( - notification.action === "reset_settings" ? ( + {notification.action ? + notification.action === "reset_settings" ? <> {message.split("\n").map((line, index) => (

{line}

@@ -34,15 +34,14 @@ export default function SettingsNotifications() { × - ) : null - ) : ( - <> + : null + : <> {message} - )} + }
("button.ytp-settings-button"); if (!settingsButton) return; - const playerContainer = isWatchPage() ? document.querySelector("div#movie_player") : isShortsPage() ? null : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? null + : null; if (!playerContainer) return; // Insert the feature menu button and feature menu itself settingsButton.insertAdjacentElement("beforebegin", featureMenuButton); @@ -106,7 +109,10 @@ function adjustAdsContainerStyles(featureMenuOpen: boolean) { export function setupFeatureMenuEventListeners(featureMenuOpenType: FeatureMenuOpenType) { const settingsButton = document.querySelector("button.ytp-settings-button"); if (!settingsButton) return; - const playerContainer = isWatchPage() ? document.querySelector("div#movie_player") : isShortsPage() ? null : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? null + : null; if (!playerContainer) return; const bottomControls = document.querySelector("div.ytp-chrome-bottom"); if (!bottomControls) return; diff --git a/src/features/playerQuality/index.ts b/src/features/playerQuality/index.ts index 614ce521..87c39c09 100644 --- a/src/features/playerQuality/index.ts +++ b/src/features/playerQuality/index.ts @@ -25,11 +25,10 @@ export default async function setPlayerQuality(): Promise { if (!player_quality) return; // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; diff --git a/src/features/playerSpeed/index.ts b/src/features/playerSpeed/index.ts index 90036fd2..57fe8900 100644 --- a/src/features/playerSpeed/index.ts +++ b/src/features/playerSpeed/index.ts @@ -38,11 +38,10 @@ export async function setPlayerSpeed(input?: number): Promise { // If forced playback speed option is disabled, return if (!enablePlayerSpeed) return; // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; const video = document.querySelector("video.html5-main-video"); @@ -67,11 +66,10 @@ export function restorePlayerSpeed() { // If the player speed is not available, return if (!playerSpeed) return; // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; const video = document.querySelector("video.html5-main-video"); // If player element is not available, return if (!playerContainer) return; diff --git a/src/features/remainingTime/index.ts b/src/features/remainingTime/index.ts index c76e2762..2b11978d 100644 --- a/src/features/remainingTime/index.ts +++ b/src/features/remainingTime/index.ts @@ -8,11 +8,10 @@ import { calculateRemainingTime } from "./utils"; function playerTimeUpdateListener() { void (async () => { // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; @@ -43,11 +42,10 @@ export async function setupRemainingTime() { const timeDisplay = document.querySelector(".ytp-time-display > span:nth-of-type(2)"); if (!timeDisplay) return; // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; // Get the video element diff --git a/src/features/rememberVolume/index.ts b/src/features/rememberVolume/index.ts index 01838560..84f89358 100644 --- a/src/features/rememberVolume/index.ts +++ b/src/features/rememberVolume/index.ts @@ -24,11 +24,10 @@ export default async function enableRememberVolume(): Promise { const IsWatchPage = isWatchPage(); const IsShortsPage = isShortsPage(); // Get the player container element - const playerContainer = IsWatchPage - ? document.querySelector("div#movie_player") - : IsShortsPage - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + IsWatchPage ? document.querySelector("div#movie_player") + : IsShortsPage ? document.querySelector("div#shorts-player") + : null; // If player container is not available, return if (!playerContainer) return; diff --git a/src/features/rememberVolume/utils.ts b/src/features/rememberVolume/utils.ts index 9c0b8c53..504054e1 100644 --- a/src/features/rememberVolume/utils.ts +++ b/src/features/rememberVolume/utils.ts @@ -16,11 +16,10 @@ export async function setupVolumeChangeListener() { const IsWatchPage = isWatchPage(); const IsShortsPage = isShortsPage(); // Get the player container element - const playerContainer = IsWatchPage - ? document.querySelector("div#movie_player") - : IsShortsPage - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + IsWatchPage ? document.querySelector("div#movie_player") + : IsShortsPage ? document.querySelector("div#shorts-player") + : null; if (!playerContainer) return; const videoElement = playerContainer.querySelector("div > video"); if (!videoElement) return; diff --git a/src/features/scrollWheelVolumeControl/index.ts b/src/features/scrollWheelVolumeControl/index.ts index f76bf951..ea0542c5 100644 --- a/src/features/scrollWheelVolumeControl/index.ts +++ b/src/features/scrollWheelVolumeControl/index.ts @@ -59,7 +59,11 @@ export default async function adjustVolumeOnScrollWheel(): Promise { return void (await setOptionsData()); // If the right click is required and not pressed, return if (enable_scroll_wheel_volume_control_hold_right_click && wheelEvent.buttons !== 2) return void (await setOptionsData()); - + // If the right click is required and is pressed hide the context menu + if (enable_scroll_wheel_volume_control_hold_right_click && wheelEvent.buttons === 2) { + const contextMenu = document.querySelector("div.ytp-popup.ytp-contextmenu"); + if (contextMenu) contextMenu.style.display = "none"; + } // Only prevent default scroll wheel behavior // if we are going to handle the event preventScroll(wheelEvent); @@ -68,11 +72,10 @@ export default async function adjustVolumeOnScrollWheel(): Promise { await setOptionsData(); // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; @@ -92,6 +95,11 @@ export default async function adjustVolumeOnScrollWheel(): Promise { playerContainer: playerContainer, volume: newVolume }); + // If right click is required revert the context menu display + if (enable_scroll_wheel_volume_control_hold_right_click && wheelEvent.buttons === 2) { + const contextMenu = document.querySelector("div.ytp-popup.ytp-contextmenu"); + if (contextMenu) contextMenu.style.display = ""; + } })(); }; diff --git a/src/features/scrollWheelVolumeControl/utils.ts b/src/features/scrollWheelVolumeControl/utils.ts index 43fdaf67..6e673328 100644 --- a/src/features/scrollWheelVolumeControl/utils.ts +++ b/src/features/scrollWheelVolumeControl/utils.ts @@ -135,14 +135,15 @@ export function drawVolumeDisplay({ ) ?? document.querySelector(".ytp-chrome-bottom"); const { top: topRectTop = 0 } = document.querySelector(".player-controls > ytd-shorts-player-controls")?.getBoundingClientRect() || {}; const { bottom: bottomRectBottom = 0, top: bottomRectTop = 0 } = bottomElement?.getBoundingClientRect() || {}; - const heightExcludingMarginPadding = bottomElement - ? bottomElement.offsetHeight - - (parseInt(getComputedStyle(bottomElement).marginTop, 10) + + const heightExcludingMarginPadding = + bottomElement ? + bottomElement.offsetHeight - + (parseInt(getComputedStyle(bottomElement).marginTop, 10) + parseInt(getComputedStyle(bottomElement).marginBottom, 10) + parseInt(getComputedStyle(bottomElement).paddingTop, 10) + parseInt(getComputedStyle(bottomElement).paddingBottom, 10)) + - 10 - : 0; + 10 + : 0; const paddingTop = isShortsPage() ? topRectTop / 2 : 0; const paddingBottom = isShortsPage() ? heightExcludingMarginPadding : Math.round(bottomRectBottom - bottomRectTop); diff --git a/src/features/videoHistory/index.ts b/src/features/videoHistory/index.ts index c44f69a4..bdf9edf5 100644 --- a/src/features/videoHistory/index.ts +++ b/src/features/videoHistory/index.ts @@ -22,7 +22,10 @@ export async function setupVideoHistory() { const { enable_video_history: enableVideoHistory } = options; if (!enableVideoHistory) return; // Get the player container element - const playerContainer = isWatchPage() ? document.querySelector("div#movie_player") : isShortsPage() ? null : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? null + : null; // If player container is not available, return if (!playerContainer) return; const playerVideoData = await playerContainer.getVideoData(); @@ -59,7 +62,10 @@ export async function promptUserToResumeVideo(cb: () => void) { if (!enableVideoHistory) return; // Get the player container element - const playerContainer = isWatchPage() ? document.querySelector("div#movie_player") : isShortsPage() ? null : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? null + : null; // If player container is not available, return if (!playerContainer) return; diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 3de90d9b..b7d02b50 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -2,42 +2,42 @@ import { type Resource, createInstance } from "i18next"; import { waitForSpecificMessage } from "../utils/utilities"; export const availableLocales = [ - "ca-ES", - "cs-CZ", - "de-DE", - "en-US", - "es-ES", - "fa-IR", - "fr-FR", - "he-IL", - "hi-IN", - "it-IT", - "ja-JP", - "pl-PL", - "pt-BR", - "ru-RU", - "tr-TR", - "zh-CN", - "zh-TW" + "ca-ES", + "cs-CZ", + "de-DE", + "en-US", + "es-ES", + "fa-IR", + "fr-FR", + "he-IL", + "hi-IN", + "it-IT", + "ja-JP", + "pl-PL", + "pt-BR", + "ru-RU", + "tr-TR", + "zh-CN", + "zh-TW" ] as const; export const localePercentages: Record = { - "en-US": 100, - "ca-ES": 0, - "cs-CZ": 0, - "de-DE": 89, - "es-ES": 89, - "fa-IR": 0, - "fr-FR": 0, - "he-IL": 0, - "hi-IN": 0, - "it-IT": 0, - "ja-JP": 100, - "pl-PL": 1, - "pt-BR": 0, - "ru-RU": 92, - "tr-TR": 45, - "zh-CN": 2, - "zh-TW": 0 + "en-US": 100, + "ca-ES": 0, + "cs-CZ": 0, + "de-DE": 89, + "es-ES": 89, + "fa-IR": 0, + "fr-FR": 0, + "he-IL": 0, + "hi-IN": 0, + "it-IT": 0, + "ja-JP": 100, + "pl-PL": 1, + "pt-BR": 0, + "ru-RU": 92, + "tr-TR": 45, + "zh-CN": 2, + "zh-TW": 0 }; export const localeDirection: Record = { "ca-ES": "ltr", diff --git a/src/pages/content/index.tsx b/src/pages/content/index.tsx index 6e15a5f1..cd97b64f 100644 --- a/src/pages/content/index.tsx +++ b/src/pages/content/index.tsx @@ -276,11 +276,10 @@ window.addEventListener("DOMContentLoaded", function () { } case "automaticTheaterModeChange": { // Get the player element - const playerContainer = isWatchPage() - ? document.querySelector("div#movie_player") - : isShortsPage() - ? document.querySelector("div#shorts-player") - : null; + const playerContainer = + isWatchPage() ? document.querySelector("div#movie_player") + : isShortsPage() ? document.querySelector("div#shorts-player") + : null; // If player element is not available, return if (!playerContainer) return; // Get the size button diff --git a/src/types/index.ts b/src/types/index.ts index a0281f34..8e82f836 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -161,21 +161,21 @@ export type Selector = string; export type StorageChanges = { [key: string]: chrome.storage.StorageChange }; // Taken from https://github.com/colinhacks/zod/issues/53#issuecomment-1681090113 type TypeToZod = { - [K in keyof T]: T[K] extends boolean | null | number | string | undefined - ? undefined extends T[K] - ? z.ZodOptional>> - : z.ZodType - : z.ZodObject>; + [K in keyof T]: T[K] extends boolean | null | number | string | undefined ? + undefined extends T[K] ? + z.ZodOptional>> + : z.ZodType + : z.ZodObject>; }; export type TypeToZodSchema = z.ZodObject<{ - [K in keyof T]: T[K] extends any[] ? z.ZodArray> : T[K] extends object ? z.ZodObject> : z.ZodType; + [K in keyof T]: T[K] extends any[] ? z.ZodArray> + : T[K] extends object ? z.ZodObject> + : z.ZodType; }>; export type TypeToPartialZodSchema = z.ZodObject<{ - [K in keyof T]: T[K] extends any[] - ? z.ZodOptionalType> - : T[K] extends object - ? z.ZodOptionalType>> - : z.ZodOptionalType>; + [K in keyof T]: T[K] extends any[] ? z.ZodOptionalType> + : T[K] extends object ? z.ZodOptionalType>> + : z.ZodOptionalType>; }>; export type Prettify = { [K in keyof T]: T[K]; From ac0d83ae2ca44a75fe70a1ee5abfcda14c5fc837 Mon Sep 17 00:00:00 2001 From: VampireChicken12 Date: Sun, 17 Dec 2023 22:10:17 -0500 Subject: [PATCH 2/2] chore: add all-contributors --- .all-contributorsrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000..4d346caa --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,4 @@ +{ + "projectName": "youtube-enhancer", + "projectOwner": "VampireChicken12" +}