diff --git a/.all-contributorsrc b/.all-contributorsrc index 79fec7ab..56e88d57 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { - "projectName": "youtube-enhancer", - "projectOwner": "VampireChicken12", + "projectName": "extension", + "projectOwner": "YouTube-Enhancer", "files": [ "README.md" ], @@ -138,6 +138,23 @@ "contributions": [ "translation" ] + }, + { + "login": "szaumoor", + "name": "Marcos C.R.", + "avatar_url": "https://avatars.githubusercontent.com/u/78204388?v=4", + "profile": "https://github.com/szaumoor", + "contributions": [ + "ideas" + ] + }, + "login": "charlymoon741", + "name": "Carlos Ramos Luna", + "avatar_url": "https://avatars.githubusercontent.com/u/62484941?v=4", + "profile": "https://github.com/charlymoon741", + "contributions": [ + "ideas" + ] } ] } diff --git a/README.md b/README.md index 3eadf867..92640b84 100755 --- a/README.md +++ b/README.md @@ -65,6 +65,12 @@ YouTube Enhancer is a browser extension that aims to improve your YouTube experi - **Hide shorts**: Enhance your browsing experience by hiding distracting YouTube Shorts content. +- **Hide live stream chat**: Hide the chat section of live streams. + +- **Hide translate comment button**: Hides the `Translate to Language` button under comments. + +- **Hide end screen cards:**: Hide the end screen cards on videos. + ### Video history settings - **Track watched videos:** Keeps track of where you left off on videos you were watching and enables resuming playback @@ -299,6 +305,10 @@ Contributions to the YouTube Enhancer Extension are welcome! If you'd like to co Granberg
Granberg

🌍 Secret-Peter
Secret-Peter

🌍 + + Carlos Ramos Luna
Carlos Ramos Luna

🤔 + Marcos C.R.
Marcos C.R.

🤔 + @@ -325,7 +335,7 @@ We welcome contributions to improve translations and make the extension accessib The YouTube Enhancer Extension is open-source and available under the [MIT License](LICENSE). Feel free to explore, modify, and share it as needed. -![Alt](https://repobeats.axiom.co/api/embed/5f047f2fde5309f072dda1602645f76bb8e74cdc.svg "Repobeats analytics image") +![Alt](https://repobeats.axiom.co/api/embed/262a11c40b9db9e119db0a64a23049ead4eaed96.svg "Repobeats analytics image") ## 🌟 Star History diff --git a/assets/translation context screenshots/Miscellaneous Settings/Hide_End_Screen_Cards.png b/assets/translation context screenshots/Miscellaneous Settings/Hide_End_Screen_Cards.png new file mode 100644 index 00000000..edc313cd Binary files /dev/null and b/assets/translation context screenshots/Miscellaneous Settings/Hide_End_Screen_Cards.png differ diff --git a/assets/translation context screenshots/Miscellaneous Settings/Hide_Live_Stream_Chat.png b/assets/translation context screenshots/Miscellaneous Settings/Hide_Live_Stream_Chat.png new file mode 100644 index 00000000..7042e7f1 Binary files /dev/null and b/assets/translation context screenshots/Miscellaneous Settings/Hide_Live_Stream_Chat.png differ diff --git a/assets/translation context screenshots/Miscellaneous Settings/Hide_Translate_Comment_Button.png b/assets/translation context screenshots/Miscellaneous Settings/Hide_Translate_Comment_Button.png new file mode 100644 index 00000000..64d38417 Binary files /dev/null and b/assets/translation context screenshots/Miscellaneous Settings/Hide_Translate_Comment_Button.png differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Limit.png b/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Limit.png new file mode 100644 index 00000000..7ad63529 Binary files /dev/null and b/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Limit.png differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_By_Amount.png b/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_By_Amount.png deleted file mode 100644 index 7a7a0bca..00000000 Binary files a/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_By_Amount.png and /dev/null differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_To_Amount.png b/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_To_Amount.png new file mode 100644 index 00000000..a702a6f3 Binary files /dev/null and b/assets/translation context screenshots/YouTube Page/Buttons/Decrease_Speed_To_Amount.png differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Increase_Limit.png b/assets/translation context screenshots/YouTube Page/Buttons/Increase_Limit.png new file mode 100644 index 00000000..80e63263 Binary files /dev/null and b/assets/translation context screenshots/YouTube Page/Buttons/Increase_Limit.png differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_By_Amount.png b/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_By_Amount.png deleted file mode 100644 index c4c34dcf..00000000 Binary files a/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_By_Amount.png and /dev/null differ diff --git a/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_To_Amount.png b/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_To_Amount.png new file mode 100644 index 00000000..eca0faea Binary files /dev/null and b/assets/translation context screenshots/YouTube Page/Buttons/Increase_Speed_To_Amount.png differ diff --git a/package-lock.json b/package-lock.json index 4018fdc4..b29b000c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "youtube-enhancer", - "version": "1.24.0", + "version": "1.24.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "youtube-enhancer", - "version": "1.24.0", + "version": "1.24.2", "license": "MIT", "dependencies": { "@formkit/auto-animate": "^0.8.1", @@ -14,12 +14,12 @@ "@tanstack/react-query": "^5.18.0", "dotenv": "^16.3.1", "i18next": "^23.7.3", - "monaco-editor": "^0.47.0", + "monaco-editor": "^0.48.0", "react": "^18.2.0", "react-colorful": "^5.6.1", "react-dom": "^18.2.0", "react-icons": "^5.0.1", - "tailwindcss-multi": "^0.3.30", + "tailwindcss-multi": "^0.4.0", "use-debouncy": "^5.0.1", "vite-plugin-css-injected-by-js": "^3.3.0", "webextension-polyfill": "^0.11.0" @@ -31,7 +31,7 @@ "@thedutchcoder/postcss-rem-to-px": "^0.0.2", "@total-typescript/ts-reset": "^0.5.1", "@types/archiver": "^6.0.1", - "@types/chrome": "^0.0.266", + "@types/chrome": "^0.0.268", "@types/node": "^20.9.0", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", @@ -48,7 +48,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-no-secrets": "^0.9.1", + "eslint-plugin-no-secrets": "^1.0.2", "eslint-plugin-perfectionist": "^2.3.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-promise": "^6.1.1", @@ -1383,20 +1383,20 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.32.0.tgz", - "integrity": "sha512-Z3flEgCat55DRXU5UMwYU1U+DgFZKA3iufyOKs+II7iRAo0uXkeU7PH5e6sOH1CGEag0IpKmZxlUFpCg6roSKw==", + "version": "5.34.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.34.2.tgz", + "integrity": "sha512-FM1UXldYcoMiWmVbpewV14EVpnr/ETBbdF84tmCktx29e2bXBFhGtAfyDHUD4X1FehaV5tC9GkXZUMZRQV3lcA==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.32.0.tgz", - "integrity": "sha512-+E3UudQtarnx9A6xhpgMZapyF+aJfNBGFMgI459FnduEZqT/9KhOWnMOneZahLRt52yzskSA0AuOyLkXHK0yBA==", + "version": "5.34.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.34.2.tgz", + "integrity": "sha512-5L9W9XQ/lRcyhlVN0xrOkPZE9PJxZWw7BdJR244j3G7sxMfSreZWvxx13DJt08M5DWn9B5VstpKgqpIIQOIJKA==", "dependencies": { - "@tanstack/query-core": "5.32.0" + "@tanstack/query-core": "5.34.2" }, "funding": { "type": "github", @@ -1458,9 +1458,9 @@ } }, "node_modules/@types/chrome": { - "version": "0.0.266", - "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.266.tgz", - "integrity": "sha512-QSQWJTL7NjZElvq/6/E5C1+pHgEP8UAJzwoz7M4vSJ7AECt6NNehJ+tU6snnvuTqZOBjFCivvitYo5+8tNPmhg==", + "version": "0.0.268", + "resolved": "https://registry.npmjs.org/@types/chrome/-/chrome-0.0.268.tgz", + "integrity": "sha512-7N1QH9buudSJ7sI8Pe4mBHJr5oZ48s0hcanI9w3wgijAlv1OZNUZve9JR4x42dn5lJ5Sm87V1JNfnoh10EnQlA==", "dev": true, "dependencies": { "@types/filesystem": "*", @@ -1553,9 +1553,9 @@ } }, "node_modules/@types/react-dom": { - "version": "18.2.25", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.25.tgz", - "integrity": "sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA==", + "version": "18.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", + "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", "dev": true, "dependencies": { "@types/react": "*" @@ -1589,16 +1589,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz", - "integrity": "sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz", + "integrity": "sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/type-utils": "7.7.1", - "@typescript-eslint/utils": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/type-utils": "7.8.0", + "@typescript-eslint/utils": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.3.1", @@ -1623,16 +1623,63 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", + "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/parser": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.1.tgz", - "integrity": "sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.8.0.tgz", + "integrity": "sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/typescript-estree": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4" }, "engines": { @@ -1651,14 +1698,72 @@ } } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz", - "integrity": "sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==", + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", + "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1" + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", + "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1669,13 +1774,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz", - "integrity": "sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz", + "integrity": "sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.7.1", - "@typescript-eslint/utils": "7.7.1", + "@typescript-eslint/typescript-estree": "7.8.0", + "@typescript-eslint/utils": "7.8.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1695,10 +1800,10 @@ } } }, - "node_modules/@typescript-eslint/types": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.1.tgz", - "integrity": "sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==", + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1708,14 +1813,14 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz", - "integrity": "sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==", + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", + "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/visitor-keys": "7.7.1", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1736,18 +1841,35 @@ } } }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.1.tgz", - "integrity": "sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.8.0.tgz", + "integrity": "sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.15", "@types/semver": "^7.5.8", - "@typescript-eslint/scope-manager": "7.7.1", - "@typescript-eslint/types": "7.7.1", - "@typescript-eslint/typescript-estree": "7.7.1", + "@typescript-eslint/scope-manager": "7.8.0", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/typescript-estree": "7.8.0", "semver": "^7.6.0" }, "engines": { @@ -1761,13 +1883,71 @@ "eslint": "^8.56.0" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz", - "integrity": "sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz", + "integrity": "sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.8.0.tgz", + "integrity": "sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz", + "integrity": "sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/types": "7.8.0", + "@typescript-eslint/visitor-keys": "7.8.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz", + "integrity": "sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.8.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -4192,9 +4372,9 @@ } }, "node_modules/eslint-plugin-no-secrets": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-secrets/-/eslint-plugin-no-secrets-0.9.1.tgz", - "integrity": "sha512-41GIjvJd/jcqKyr7H4F4FpelFh5Kzdpjk34IfzvzftZPCU0VRA9fKmQdLvPsRt9hifhZfBlqX4h4igdCD/SSwQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-secrets/-/eslint-plugin-no-secrets-1.0.2.tgz", + "integrity": "sha512-lXjGcPS6ZMxAouYWsuX5NGsLlOWQ5c+YFHHZFECzRCZIssYQgWVPINgZqAU7caquB32MoEAL+dXRQNDBX0fgwQ==", "dev": true, "engines": { "node": ">=10.0.0", @@ -4311,9 +4491,9 @@ } }, "node_modules/eslint-plugin-react-hooks": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", - "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", "dev": true, "engines": { "node": ">=10" @@ -5265,9 +5445,9 @@ } }, "node_modules/i18next": { - "version": "23.11.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", - "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "version": "23.11.4", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.4.tgz", + "integrity": "sha512-CCUjtd5TfaCl+mLUzAA0uPSN+AVn4fP/kWCYt/hocPUwusTpMVczdrRyOBUwk6N05iH40qiKx6q1DoNJtBIwdg==", "funding": [ { "type": "individual", @@ -6528,9 +6708,9 @@ } }, "node_modules/monaco-editor": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.47.0.tgz", - "integrity": "sha512-VabVvHvQ9QmMwXu4du008ZDuyLnHs9j7ThVFsiJoXSOQk18+LF89N4ADzPbFenm0W4V2bGHnFBztIRQTgBfxzw==" + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.48.0.tgz", + "integrity": "sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA==" }, "node_modules/ms": { "version": "2.1.2", @@ -10401,9 +10581,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -10421,15 +10601,15 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "dependencies": { "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.23.2" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^18.3.1" } }, "node_modules/react-icons": { @@ -10928,9 +11108,9 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -12028,9 +12208,9 @@ } }, "node_modules/tailwindcss-multi": { - "version": "0.3.39", - "resolved": "https://registry.npmjs.org/tailwindcss-multi/-/tailwindcss-multi-0.3.39.tgz", - "integrity": "sha512-SR4RBoFLsZYwWKGQ56cE6Os629eMPAk4EtkDyJ6GO8EUwLmQ2BGQBYQ2jZVQgLneOldW8RyzYLXkkTcPPgIJ1w==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/tailwindcss-multi/-/tailwindcss-multi-0.4.1.tgz", + "integrity": "sha512-SCHG5J24MUJFRRTJosc557tJuXg5B8eB+HdXzDdIQPWxILRzpsjF2aJL9pYamQCrOZRBXkgmArVet0oHllL81A==", "dependencies": { "@types/node": "^20.4.1" } @@ -12782,9 +12962,9 @@ } }, "node_modules/vite-plugin-css-injected-by-js": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.5.0.tgz", - "integrity": "sha512-d0QaHH9kS93J25SwRqJNEfE29PSuQS5jn51y9N9i2Yoq0FRO7rjuTeLvjM5zwklZlRrIn6SUdtOEDKyHokgJZg==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/vite-plugin-css-injected-by-js/-/vite-plugin-css-injected-by-js-3.5.1.tgz", + "integrity": "sha512-9ioqwDuEBxW55gNoWFEDhfLTrVKXEEZgl5adhWmmqa88EQGKfTmexy4v1Rh0pAS6RhKQs2bUYQArprB32JpUZQ==", "peerDependencies": { "vite": ">2.0.0-0" } diff --git a/package.json b/package.json index f0d32bbd..7bb8fa0f 100644 --- a/package.json +++ b/package.json @@ -29,12 +29,12 @@ "@tanstack/react-query": "^5.18.0", "dotenv": "^16.3.1", "i18next": "^23.7.3", - "monaco-editor": "^0.47.0", + "monaco-editor": "^0.48.0", "react": "^18.2.0", "react-colorful": "^5.6.1", "react-dom": "^18.2.0", "react-icons": "^5.0.1", - "tailwindcss-multi": "^0.3.30", + "tailwindcss-multi": "^0.4.0", "use-debouncy": "^5.0.1", "vite-plugin-css-injected-by-js": "^3.3.0", "webextension-polyfill": "^0.11.0" @@ -46,7 +46,7 @@ "@thedutchcoder/postcss-rem-to-px": "^0.0.2", "@total-typescript/ts-reset": "^0.5.1", "@types/archiver": "^6.0.1", - "@types/chrome": "^0.0.266", + "@types/chrome": "^0.0.268", "@types/node": "^20.9.0", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", @@ -63,7 +63,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.29.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-no-secrets": "^0.9.1", + "eslint-plugin-no-secrets": "^1.0.2", "eslint-plugin-perfectionist": "^2.3.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-promise": "^6.1.1", diff --git a/privacy.md b/privacy.md index 77431f13..b8cfe300 100644 --- a/privacy.md +++ b/privacy.md @@ -1,4 +1,5 @@ # YouTube Enhancer Extension 🚀 + Thank you for choosing YouTube Enhancer! This Privacy Policy outlines how we collect, use, and safeguard your information when you use our browser extension. ## Information We Collect @@ -35,4 +36,4 @@ If you have any questions or concerns about this Privacy Policy or the practices By using YouTube Enhancer, you signify your acceptance of this Privacy Policy. If you do not agree to this Privacy Policy, please do not use the extension. -This Privacy Policy was last updated on March 20th 2024. \ No newline at end of file +This Privacy Policy was last updated on March 20th 2024. diff --git a/public/locales/ca-ES.json b/public/locales/ca-ES.json index 1e85de17..521fe736 100644 --- a/public/locales/ca-ES.json +++ b/public/locales/ca-ES.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/cs-CZ.json b/public/locales/cs-CZ.json index bcd5b668..ecd841e9 100644 --- a/public/locales/cs-CZ.json +++ b/public/locales/cs-CZ.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/de-DE.json b/public/locales/de-DE.json index 7f6832f9..3d650f50 100644 --- a/public/locales/de-DE.json +++ b/public/locales/de-DE.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatischer Theatermodus", "title": "Automatisch den Theatermodus aktivieren, wenn ein Video geladen wird" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Scrollbar ausblenden", "title": "Versteckt die Scrollleiste" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Dauerschleife-Button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/en-GB.json b/public/locales/en-GB.json index 99ccbeae..8760b6b0 100644 --- a/public/locales/en-GB.json +++ b/public/locales/en-GB.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theatre mode", "title": "Automatically enables theatre mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/en-US.json b/public/locales/en-US.json index d9def660..434c6423 100644 --- a/public/locales/en-US.json +++ b/public/locales/en-US.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/en-US.json.d.ts b/public/locales/en-US.json.d.ts index cce3ae13..c0ad1027 100644 --- a/public/locales/en-US.json.d.ts +++ b/public/locales/en-US.json.d.ts @@ -17,6 +17,8 @@ interface EnUS { decreasePlaybackSpeedButton: { label: "Decrease Speed to {{SPEED}}" }; increasePlaybackSpeedButton: { label: "Increase Speed to {{SPEED}}" }; }; + decreaseLimit: "Can't decrease further ({{SPEED}})"; + increaseLimit: "Can't increase further ({{SPEED}})"; }; screenshotButton: { button: { label: "Screenshot" }; @@ -143,8 +145,17 @@ interface EnUS { label: "Automatic theater mode"; title: "Automatically enables theater mode when you load a video"; }; + hideEndScreenCards: { + label: "Hide end screen cards"; + title: "Hides the cards at the end of the video"; + }; + hideLiveStreamChat: { label: "Hide live stream chat"; title: "Hides the live stream chat" }; hideScrollbar: { label: "Hide scrollbar"; title: "Hides the pages scrollbar" }; hideShorts: { label: "Hide shorts"; title: "Hides all shorts" }; + hideTranslateComment: { + label: "Hide translate comment button"; + title: "Hides 'Translate to Language' button under comments"; + }; loopButton: { label: "Loop button"; title: "Adds a button to the feature menu to loop the video you're watching"; diff --git a/public/locales/es-ES.json b/public/locales/es-ES.json index bd234c31..a238fcc0 100644 --- a/public/locales/es-ES.json +++ b/public/locales/es-ES.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Modo cine automático", "title": "Activar automáticamente el modo cine al cargar un vídeo" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Ocultar barra de desplazamiento", "title": "Oculta la barra de desplazamiento de la página" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Botón de bucle", "title": "Añade un botón al menú para poner en bucle el vídeo que estás viendo" diff --git a/public/locales/fa-IR.json b/public/locales/fa-IR.json index c204892e..42b0eeb4 100644 --- a/public/locales/fa-IR.json +++ b/public/locales/fa-IR.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/fr-FR.json b/public/locales/fr-FR.json index 561a1897..8fc9fbc2 100644 --- a/public/locales/fr-FR.json +++ b/public/locales/fr-FR.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Mode cinéma automatique", "title": "Activer automatiquement le mode cinéma lorsque vous chargez une vidéo" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Cacher la barre de défilement", "title": "Cache la barre de défilement des pages" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Bouton de boucle", "title": "Ajoute un bouton au menu de fonctionnalité pour regarder la vidéo en boucle" diff --git a/public/locales/he-IL.json b/public/locales/he-IL.json index 172e01fa..50112462 100644 --- a/public/locales/he-IL.json +++ b/public/locales/he-IL.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/hi-IN.json b/public/locales/hi-IN.json index faf86555..a670ebed 100644 --- a/public/locales/hi-IN.json +++ b/public/locales/hi-IN.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/it-IT.json b/public/locales/it-IT.json index 67391e7d..01f2add8 100644 --- a/public/locales/it-IT.json +++ b/public/locales/it-IT.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Aumenta velocità di {{SPEED}}" } - } + }, + "decreaseLimit": "Impossibile diminuire ulteriormente ({{SPEED}})", + "increaseLimit": "Impossibile aumentare ulteriormente ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Modalità teatro automatica", "title": "Attiva automaticamente la modalità teatro quando carichi un video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Nascondi chat live stream", + "title": "Nasconde la chat live stream" + }, "hideScrollbar": { "label": "Nascondi barra scorrimento", "title": "Nasconde la barra di scorrimento delle pagine" @@ -217,6 +227,10 @@ "label": "Nascondi blocchi", "title": "Nasconde tutti i blocchi" }, + "hideTranslateComment": { + "label": "Nascondi pulsante \"Traduci commento\"", + "title": "Nasconde il pulsante 'Traduci in…' sotto i commenti" + }, "loopButton": { "label": "Pulsante Ripeti", "title": "Aggiunge un pulsante al menu' funzioni per ripetere il video che stai guardando" diff --git a/public/locales/ja-JP.json b/public/locales/ja-JP.json index 46eef3bb..72ee7f37 100644 --- a/public/locales/ja-JP.json +++ b/public/locales/ja-JP.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "再生速度を{{SPEED}}で上げする" } - } + }, + "decreaseLimit": "再生速度を下げるはできまっせん ({{SPEED}})", + "increaseLimit": "再生速度を上げるはできまっせん ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "自動シアターモード", "title": "動画の読み込み時に自動的にシアターモードを有効にする" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "配信チャットを隠す", + "title": "配信チャットを隠する" + }, "hideScrollbar": { "label": "スクロールバー隠す機能", "title": "ページのスクロールバーを隠す" @@ -217,6 +227,10 @@ "label": "ショートを隠す", "title": "全ショートを隠す" }, + "hideTranslateComment": { + "label": "コメント翻訳ボタンを隠す", + "title": "コメントの下で「言語に翻訳する」ボタンを隠する" + }, "loopButton": { "label": "動画ループボタン", "title": "動画をループするボタンをフィーチャー・メニューに追加する" diff --git a/public/locales/pl-PL.json b/public/locales/pl-PL.json index bf0808e8..2c4557e2 100644 --- a/public/locales/pl-PL.json +++ b/public/locales/pl-PL.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatic theater mode", "title": "Automatically enables theater mode when you load a video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Hide scrollbar", "title": "Hides the pages scrollbar" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Loop button", "title": "Adds a button to the feature menu to loop the video you're watching" diff --git a/public/locales/pt-BR.json b/public/locales/pt-BR.json index 9a49b81a..42f4e1e4 100644 --- a/public/locales/pt-BR.json +++ b/public/locales/pt-BR.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Modo teatro automático", "title": "Ativar automaticamente o modo teatro quando você carregar um vídeo" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Ocultar a barra de rolagem", "title": "Oculta a barra de rolagem da página" @@ -217,6 +227,10 @@ "label": "Hide shorts", "title": "Hides all shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Botão de Repetir", "title": "Adiciona um botão ao menu do recurso para repetir o vídeo que você está assistindo" diff --git a/public/locales/ru-RU.json b/public/locales/ru-RU.json index d9d53098..211e935c 100644 --- a/public/locales/ru-RU.json +++ b/public/locales/ru-RU.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Увеличить скорость на {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Включить автоматический режим кинотеатра", "title": "Автоматически включать режим кинотеатра при загрузке видео" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Включить скрытие полосы прокрутки страницы", "title": "Скрывает полосу прокрутки страницы" @@ -217,6 +227,10 @@ "label": "Скрыть Shorts", "title": "Скрывает все Shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Включить кнопку «Зациклить»", "title": "Добавляет кнопку в меню функций для автоматического повтора просмотренного видео (зацикливание)" diff --git a/public/locales/sv-SE.json b/public/locales/sv-SE.json index 74fa7151..ced8740d 100644 --- a/public/locales/sv-SE.json +++ b/public/locales/sv-SE.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Öka hastigheten med {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Automatiskt teaterläge", "title": "Aktiverar automatiskt teaterläge när du startar en video" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Hide live stream chat", + "title": "Hides the live stream chat" + }, "hideScrollbar": { "label": "Dölj rullningslisten", "title": "Döljer sidornas rullningsfält" @@ -217,6 +227,10 @@ "label": "Dölj shorts", "title": "Döljer alla shorts" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Slingknapp", "title": "Lägger till en knapp i funktionsmenyn för att slinga videon du tittar på" diff --git a/public/locales/tr-TR.json b/public/locales/tr-TR.json index 115b2d22..11f1e499 100644 --- a/public/locales/tr-TR.json +++ b/public/locales/tr-TR.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "Increase Speed to {{SPEED}}" } - } + }, + "decreaseLimit": "Can't decrease further ({{SPEED}})", + "increaseLimit": "Can't increase further ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "Otomatik tiyatro modu", "title": "Video yüklediğinizde tiyatro modunu otomatik olarak etkinleştirir" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "Canlı yayın sohbetini gizle", + "title": "Canlı yayın sohbetini gizler" + }, "hideScrollbar": { "label": "Kaydırma çubuğu gizlemeyi etkinleştir", "title": "Sayfa kaydırma çubuğunu gizler" @@ -217,6 +227,10 @@ "label": "Kısa videoları gizle", "title": "Tüm kısa videoları gizler" }, + "hideTranslateComment": { + "label": "Hide translate comment button", + "title": "Hides 'Translate to Language' button under comments" + }, "loopButton": { "label": "Tekrarlama düğmesi", "title": "İzlediğiniz videoyu döngüye almak için özellik menüsüne bir düğme ekler" diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index a77320bd..1fbbf6a2 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "增加播放速度至 {{SPEED}}" } - } + }, + "decreaseLimit": "不能继续降低({{SPEED}})", + "increaseLimit": "不能继续增加({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "自动启用剧场模式", "title": "当视频打开时,自动启用剧场模式" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "隐藏直播聊天", + "title": "隐藏直播聊天" + }, "hideScrollbar": { "label": "启用隐藏滚动条", "title": "隐藏页面滚动条" @@ -217,6 +227,10 @@ "label": "隐藏短视频", "title": "隐藏所有短视频" }, + "hideTranslateComment": { + "label": "隐藏翻译评论按钮", + "title": "隐藏评论下方的“翻译至当前语言”按钮" + }, "loopButton": { "label": "循环按钮", "title": "在功能菜单中添加一个按钮来循环你正在观看的视频" diff --git a/public/locales/zh-TW.json b/public/locales/zh-TW.json index 484ad8e0..d3abd03c 100644 --- a/public/locales/zh-TW.json +++ b/public/locales/zh-TW.json @@ -44,7 +44,9 @@ "increasePlaybackSpeedButton": { "label": "加快播放速度 {{SPEED}}" } - } + }, + "decreaseLimit": "無法再減速 ({{SPEED}})", + "increaseLimit": "無法再加速 ({{SPEED}})" }, "screenshotButton": { "button": { @@ -209,6 +211,14 @@ "label": "自動啟用劇院模式", "title": "載入影片時自動啟用劇院模式" }, + "hideEndScreenCards": { + "label": "Hide end screen cards", + "title": "Hides the cards at the end of the video" + }, + "hideLiveStreamChat": { + "label": "隱藏直播聊天室", + "title": "隱藏直播的聊天室" + }, "hideScrollbar": { "label": "隱藏捲軸", "title": "隱藏頁面捲軸" @@ -217,6 +227,10 @@ "label": "隱藏 Shorts", "title": "隱藏全部 Shorts" }, + "hideTranslateComment": { + "label": "隱藏翻譯留言按鈕", + "title": "隱藏留言下的翻譯按鈕" + }, "loopButton": { "label": "循環按鈕", "title": "加入按鈕循環播放當前影片" diff --git a/src/components/Inputs/CSSEditor/ExpandButton/index.tsx b/src/components/Inputs/CSSEditor/ExpandButton/index.tsx index 52972304..529b2b1d 100644 --- a/src/components/Inputs/CSSEditor/ExpandButton/index.tsx +++ b/src/components/Inputs/CSSEditor/ExpandButton/index.tsx @@ -13,7 +13,7 @@ const ExpandButton = forwardRef(({ isExpand return ( + + + @@ -1087,7 +1111,7 @@ export default function Settings() {
{isPopup && ( )} {notifications.filter((n) => n.action === "reset_settings").length > 0 ? { const notificationToRemove = notifications.find((n) => n.action === "reset_settings"); @@ -1146,7 +1170,7 @@ export default function Settings() { value={t("settings.sections.bottomButtons.confirm.value")} /> : ({ + className: "yte-hide-end-screen-cards", + element + })) + ); +} + +export async function disableHideEndScreenCards() { + await waitForAllElements(["div#player", "div#player-wide-container", "div#video-container", "div#player-container"]); + modifyElementsClassList( + "remove", + Array.from(document.querySelectorAll(".ytp-ce-element")).map((element) => ({ + className: "yte-hide-end-screen-cards", + element + })) + ); +} diff --git a/src/features/hideLiveStreamChat/index.css b/src/features/hideLiveStreamChat/index.css new file mode 100644 index 00000000..cc36962f --- /dev/null +++ b/src/features/hideLiveStreamChat/index.css @@ -0,0 +1,3 @@ +.yte-hide-live-stream-chat { + display: none !important; +} diff --git a/src/features/hideLiveStreamChat/index.ts b/src/features/hideLiveStreamChat/index.ts new file mode 100644 index 00000000..33dd89cd --- /dev/null +++ b/src/features/hideLiveStreamChat/index.ts @@ -0,0 +1,54 @@ +import type { YouTubePlayerDiv } from "@/src/types"; + +import { modifyElementsClassList, waitForAllElements, waitForSpecificMessage } from "@/src/utils/utilities"; + +import "./index.css"; + +export async function enableHideLiveStreamChat() { + const { + data: { + options: { enable_hide_live_stream_chat: enableHideLiveStreamChat } + } + } = await waitForSpecificMessage("options", "request_data", "content"); + if (!enableHideLiveStreamChat) return; + await waitForAllElements(["div#player", "div#player-wide-container", "div#video-container", "div#player-container"]); + const player = document.querySelector("div#movie_player"); + if (!player) return; + const playerData = await player.getVideoData(); + if (!playerData.isLive) return; + modifyElementsClassList("add", [ + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("div#chat-container") + }, + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("div#chat-container #chat") + }, + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("#full-bleed-container #panels-full-bleed-container") + } + ]); +} + +export async function disableHideLiveStreamChat() { + const player = document.querySelector("div#movie_player"); + if (!player) return; + const playerData = await player.getVideoData(); + if (!playerData.isLive) return; + modifyElementsClassList("remove", [ + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("div#chat-container") + }, + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("div#chat-container #chat") + }, + { + className: "yte-hide-live-stream-chat", + element: document.querySelector("#full-bleed-container #panels-full-bleed-container") + } + ]); +} diff --git a/src/features/hideTranslateComment/index.css b/src/features/hideTranslateComment/index.css new file mode 100644 index 00000000..d217469e --- /dev/null +++ b/src/features/hideTranslateComment/index.css @@ -0,0 +1,3 @@ +.yte-hide-translate-comment { + display: none !important; +} diff --git a/src/features/hideTranslateComment/index.ts b/src/features/hideTranslateComment/index.ts new file mode 100644 index 00000000..01b78174 --- /dev/null +++ b/src/features/hideTranslateComment/index.ts @@ -0,0 +1,27 @@ +import type { Nullable } from "@/src/types"; + +import { observeTranslateComment, translateButtonSelector } from "@/src/features/hideTranslateComment/utils"; +import { modifyElementClassList, waitForAllElements, waitForSpecificMessage } from "@/src/utils/utilities"; + +import "./index.css"; +let translateCommentObserver: Nullable = null; +export async function enableHideTranslateComment() { + const { + data: { + options: { enable_hide_translate_comment } + } + } = await waitForSpecificMessage("options", "request_data", "content"); + if (!enable_hide_translate_comment) return; + await waitForAllElements(["ytd-item-section-renderer.ytd-comments div#header div#leading-section"]); + const translateCommentButtons = document.querySelectorAll(translateButtonSelector); + translateCommentButtons.forEach((button) => modifyElementClassList("add", { className: "yte-hide-translate-comment", element: button })); + translateCommentObserver = observeTranslateComment(); +} + +export async function disableHideTranslateComment() { + await waitForAllElements(["ytd-item-section-renderer.ytd-comments div#header div#leading-section"]); + translateCommentObserver?.disconnect(); + translateCommentObserver = null; + const translateCommentButtons = document.querySelectorAll(translateButtonSelector); + translateCommentButtons.forEach((button) => modifyElementClassList("remove", { className: "yte-hide-translate-comment", element: button })); +} diff --git a/src/features/hideTranslateComment/utils.ts b/src/features/hideTranslateComment/utils.ts new file mode 100644 index 00000000..4ae1afb3 --- /dev/null +++ b/src/features/hideTranslateComment/utils.ts @@ -0,0 +1,26 @@ +import { modifyElementClassList } from "@/src/utils/utilities"; +export const translateButtonSelector = "ytd-tri-state-button-view-model.translate-button"; + +export function observeTranslateComment() { + const observer = new MutationObserver((mutationList) => { + mutationList.forEach((mutation) => { + const translateButtons = Array.from(mutation.addedNodes).some( + (addedNode) => + addedNode instanceof Element && + addedNode.matches("ytd-comment-thread-renderer") && + addedNode.querySelector(translateButtonSelector) !== null + ); + if (mutation.type !== "childList" || !mutation.addedNodes.length || !translateButtons) return; + mutation.addedNodes.forEach((addedNode) => { + modifyElementClassList("add", { + className: "yte-hide-translate-comment", + element: (addedNode as Element).querySelector(translateButtonSelector) + }); + }); + }); + }); + const commentsSection = document.querySelector("ytd-item-section-renderer.ytd-comments div#contents"); + if (!commentsSection) return null; + observer.observe(commentsSection, { childList: true, subtree: true }); + return observer; +} diff --git a/src/features/pauseBackgroundPlayers/index.ts b/src/features/pauseBackgroundPlayers/index.ts index f39c2551..874093b6 100644 --- a/src/features/pauseBackgroundPlayers/index.ts +++ b/src/features/pauseBackgroundPlayers/index.ts @@ -14,8 +14,8 @@ export async function enablePauseBackgroundPlayers() { } } = optionsData; if (!pauseBackgroundPlayersEnabled) return; - // ignore home page - if (window.location.href.match(/^https?:\/\/(?:www\.)?youtube\.com\/?$/gm)) return; + // ignore home page and channel pages + if (window.location.href.match(/^https?:\/\/(?:www\.)?youtube\.com(\/?|\/channel\/.+|\/\@.+)$/gm)) return; browserColorLog("Enabling pauseBackgroundPlayers", "FgMagenta"); let videoPlayerContainer: HTMLVideoElement | null = null; diff --git a/src/features/playbackSpeedButtons/index.ts b/src/features/playbackSpeedButtons/index.ts index 79092d8d..8bb48477 100644 --- a/src/features/playbackSpeedButtons/index.ts +++ b/src/features/playbackSpeedButtons/index.ts @@ -1,7 +1,7 @@ import type { YouTubePlayerDiv } from "@/src/types"; import { addFeatureButton, removeFeatureButton } from "@/src/features/buttonPlacement"; -import { getFeatureButton, updateFeatureButtonTitle } from "@/src/features/buttonPlacement/utils"; +import { getFeatureButton } from "@/src/features/buttonPlacement/utils"; import { setPlayerSpeed } from "@/src/features/playerSpeed"; import { getFeatureIcon } from "@/src/icons"; import eventManager from "@/src/utils/EventManager"; @@ -13,7 +13,7 @@ let currentPlaybackSpeed = 1; async function updateTooltip( buttonName: ButtonName, - speed: string + speed: number ) { const optionsData = await waitForSpecificMessage("options", "request_data", "content"); const { @@ -22,7 +22,8 @@ async function updateTooltip void { @@ -67,14 +70,7 @@ function playbackSpeedButtonClickListener(amount: number): () => void { const optionsData = await waitForSpecificMessage("options", "request_data", "content"); const { data: { - options: { - osd_display_color, - osd_display_hide_time, - osd_display_opacity, - osd_display_padding, - osd_display_position, - playback_buttons_speed: playbackSpeedPerClick - } + options: { osd_display_color, osd_display_hide_time, osd_display_opacity, osd_display_padding, osd_display_position } } } = optionsData; new OnScreenDisplayManager( @@ -96,8 +92,8 @@ function playbackSpeedButtonClickListener(amount: number): () => void { ); const speed = currentPlaybackSpeed + amount; await setPlayerSpeed(speed); - await updateTooltip("increasePlaybackSpeedButton", String(speed + playbackSpeedPerClick)); - await updateTooltip("decreasePlaybackSpeedButton", String(speed - playbackSpeedPerClick)); + await updateTooltip("increasePlaybackSpeedButton", speed); + await updateTooltip("decreasePlaybackSpeedButton", speed); } catch (error) { console.error(error); } diff --git a/src/features/removeRedirect/index.ts b/src/features/removeRedirect/index.ts index 77e235a4..0f17f6b2 100644 --- a/src/features/removeRedirect/index.ts +++ b/src/features/removeRedirect/index.ts @@ -1,7 +1,7 @@ import { type Nullable } from "@/src/types"; import { browserColorLog, waitForSpecificMessage } from "@/src/utils/utilities"; -export default async function removeRedirect() { +export default async function enableRemoveRedirect() { const optionsData = await waitForSpecificMessage("options", "request_data", "content"); const { data: { diff --git a/src/features/shareShortener/index.ts b/src/features/shareShortener/index.ts index f5bb3ea0..e744c038 100644 --- a/src/features/shareShortener/index.ts +++ b/src/features/shareShortener/index.ts @@ -18,7 +18,6 @@ function cleanAndUpdateUrl() { } if (input) { if (!input.value.match(regexp)) return; - console.log("cleanAndUpdateUrl"); input.value = cleanUrl(input.value); } }, 50); diff --git a/src/i18n/index.ts b/src/i18n/index.ts index 2faa7811..24805ccb 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -2,46 +2,46 @@ import { type Resource, createInstance } from "i18next"; import { waitForSpecificMessage } from "../utils/utilities"; export const availableLocales = [ - "ca-ES", - "cs-CZ", - "de-DE", - "en-GB", - "en-US", - "es-ES", - "fa-IR", - "fr-FR", - "he-IL", - "hi-IN", - "it-IT", - "ja-JP", - "pl-PL", - "pt-BR", - "ru-RU", - "sv-SE", - "tr-TR", - "zh-CN", - "zh-TW" + "ca-ES", + "cs-CZ", + "de-DE", + "en-GB", + "en-US", + "es-ES", + "fa-IR", + "fr-FR", + "he-IL", + "hi-IN", + "it-IT", + "ja-JP", + "pl-PL", + "pt-BR", + "ru-RU", + "sv-SE", + "tr-TR", + "zh-CN", + "zh-TW" ] as const; export const localePercentages: Record = { - "en-US": 100, - "ca-ES": 0, - "cs-CZ": 0, - "de-DE": 36, - "en-GB": 2, - "es-ES": 63, - "fa-IR": 0, - "fr-FR": 67, - "he-IL": 0, - "hi-IN": 0, - "it-IT": 100, - "ja-JP": 100, - "pl-PL": 0, - "pt-BR": 74, - "ru-RU": 100, - "sv-SE": 98, - "tr-TR": 75, - "zh-CN": 100, - "zh-TW": 95 + "ca-ES": 0, + "cs-CZ": 0, + "de-DE": 34, + "en-GB": 2, + "en-US": 100, + "es-ES": 61, + "fa-IR": 0, + "fr-FR": 64, + "he-IL": 0, + "hi-IN": 0, + "it-IT": 98, + "ja-JP": 98, + "pl-PL": 0, + "pt-BR": 71, + "ru-RU": 96, + "sv-SE": 94, + "tr-TR": 72, + "zh-CN": 98, + "zh-TW": 94 }; export const localeDirection: Record = { "ca-ES": "ltr", diff --git a/src/pages/background/index.html b/src/pages/background/index.html index b1937ff4..9786ac2b 100644 --- a/src/pages/background/index.html +++ b/src/pages/background/index.html @@ -1,11 +1,9 @@ - + - - - + + YouTube Enhancer Background - diff --git a/src/pages/content/index.ts b/src/pages/content/index.ts index 54b256bb..9db41f4c 100644 --- a/src/pages/content/index.ts +++ b/src/pages/content/index.ts @@ -275,6 +275,16 @@ const storageChangeHandler = async (changes: StorageChanges, areaName: string) = playerSpeed: options.player_speed }); }, + enable_hide_end_screen_cards: (__oldValue, newValue) => { + sendExtensionOnlyMessage("hideEndScreenCardsChange", { + hideEndScreenCardsEnabled: newValue + }); + }, + enable_hide_live_stream_chat: (__oldValue, newValue) => { + sendExtensionOnlyMessage("hideLiveStreamChatChange", { + hideLiveStreamChatEnabled: newValue + }); + }, enable_hide_scrollbar: (__oldValue, newValue) => { sendExtensionOnlyMessage("hideScrollBarChange", { hideScrollBarEnabled: newValue @@ -285,6 +295,11 @@ const storageChangeHandler = async (changes: StorageChanges, areaName: string) = hideShortsEnabled: newValue }); }, + enable_hide_translate_comment: (__oldValue, newValue) => { + sendExtensionOnlyMessage("hideTranslateCommentChange", { + hideTranslateCommentEnabled: newValue + }); + }, enable_loop_button: (__oldValue, newValue) => { sendExtensionOnlyMessage("loopButtonChange", { loopButtonEnabled: newValue diff --git a/src/pages/embedded/index.ts b/src/pages/embedded/index.ts index d318819a..09be394e 100644 --- a/src/pages/embedded/index.ts +++ b/src/pages/embedded/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */ import { deepDarkPresets } from "@/src/deepDarkPresets"; import { type FeatureFuncRecord, featureButtonFunctions } from "@/src/features"; -import { automaticTheaterMode } from "@/src/features/automaticTheaterMode"; +import { enableAutomaticTheaterMode } from "@/src/features/automaticTheaterMode"; import { featuresInControls } from "@/src/features/buttonPlacement"; import { checkIfFeatureButtonExists, getFeatureButton, updateFeatureButtonTitle } from "@/src/features/buttonPlacement/utils"; import { disableCustomCSS, enableCustomCSS } from "@/src/features/customCSS"; @@ -10,9 +10,12 @@ import { disableDeepDarkCSS, enableDeepDarkCSS } from "@/src/features/deepDarkCS import { deepDarkCSSExists, getDeepDarkCustomThemeStyle, updateDeepDarkCSS } from "@/src/features/deepDarkCSS/utils"; import { enableFeatureMenu, setupFeatureMenuEventListeners } from "@/src/features/featureMenu"; import { featuresInMenu, getFeatureMenuItem, updateFeatureMenuItemLabel, updateFeatureMenuTitle } from "@/src/features/featureMenu/utils"; +import { disableHideEndScreenCards, enableHideEndScreenCards } from "@/src/features/hideEndScreenCards"; +import { disableHideLiveStreamChat, enableHideLiveStreamChat } from "@/src/features/hideLiveStreamChat"; import { enableHideScrollBar } from "@/src/features/hideScrollBar"; import { hideScrollBar, showScrollBar } from "@/src/features/hideScrollBar/utils"; import { disableHideShorts, enableHideShorts } from "@/src/features/hideShorts"; +import { disableHideTranslateComment, enableHideTranslateComment } from "@/src/features/hideTranslateComment"; import { addLoopButton, removeLoopButton } from "@/src/features/loopButton"; import { addMaximizePlayerButton, removeMaximizePlayerButton } from "@/src/features/maximizePlayerButton"; import { maximizePlayer } from "@/src/features/maximizePlayerButton/utils"; @@ -28,9 +31,9 @@ import { } from "@/src/features/playbackSpeedButtons"; import setPlayerQuality from "@/src/features/playerQuality"; import { restorePlayerSpeed, setPlayerSpeed, setupPlaybackSpeedChangeListener } from "@/src/features/playerSpeed"; -import { removeRemainingTimeDisplay, setupRemainingTime } from "@/src/features/remainingTime"; +import { setupRemainingTime as enableRemainingTime, removeRemainingTimeDisplay } from "@/src/features/remainingTime"; import enableRememberVolume from "@/src/features/rememberVolume"; -import removeRedirect from "@/src/features/removeRedirect"; +import enableRemoveRedirect from "@/src/features/removeRedirect"; import { addScreenshotButton, removeScreenshotButton } from "@/src/features/screenshotButton"; import adjustSpeedOnScrollWheel from "@/src/features/scrollWheelSpeedControl"; import adjustVolumeOnScrollWheel from "@/src/features/scrollWheelVolumeControl"; @@ -119,13 +122,14 @@ const alwaysShowProgressBar = async function () { }; const enableFeatures = () => { + browserColorLog(`Enabling features...`, "FgMagenta"); void (async () => { // Wait for the specified container selectors to be available on the page await waitForAllElements(["div#player", "div#player-wide-container", "div#video-container", "div#player-container"]); eventManager.removeAllEventListeners(["featureMenu"]); void Promise.all([ enableHideShorts(), - removeRedirect(), + enableRemoveRedirect(), enableShareShortener(), enableSkipContinueWatching(), enablePauseBackgroundPlayers(), @@ -143,14 +147,17 @@ const enableFeatures = () => { setupPlaybackSpeedChangeListener(), enableShortsAutoScroll(), enableOpenYouTubeSettingsOnHover(), + enableHideLiveStreamChat(), enableRememberVolume(), - automaticTheaterMode(), - setupRemainingTime(), + enableAutomaticTheaterMode(), + enableRemainingTime(), volumeBoost(), setPlayerQuality(), setPlayerSpeed(), adjustVolumeOnScrollWheel(), - adjustSpeedOnScrollWheel() + adjustSpeedOnScrollWheel(), + enableHideTranslateComment(), + enableHideEndScreenCards() ]); // Enable feature menu before calling button functions await enableFeatureMenu(); @@ -173,11 +180,9 @@ window.addEventListener("DOMContentLoaded", function () { } = response; const i18nextInstance = await i18nService(language); window.i18nextInstance = i18nextInstance; - // Listen to YouTube's soft navigate event document.addEventListener("yt-navigate-finish", enableFeatures); document.addEventListener("yt-player-updated", enableFeatures); - /** * Listens for the "yte-message-from-youtube" event and handles incoming messages from the YouTube page. * @@ -231,10 +236,8 @@ window.addEventListener("DOMContentLoaded", function () { } case "per_video": { const volumeBoostButton = getFeatureMenuItem("volumeBoostButton") ?? getFeatureButton("volumeBoostButton"); - console.log(volumeBoostButton); if (!volumeBoostButton) return; const volumeBoostForVideoEnabled = volumeBoostButton.ariaChecked === "true"; - console.log(volumeBoostForVideoEnabled, volumeBoostButton.ariaChecked); if (volumeBoostForVideoEnabled) applyVolumeBoost(volumeBoostAmount); } } @@ -262,6 +265,14 @@ window.addEventListener("DOMContentLoaded", function () { } break; } + case "hideEndScreenCardsChange": { + const { + data: { hideEndScreenCardsEnabled } + } = message; + if (hideEndScreenCardsEnabled) await enableHideEndScreenCards(); + else await disableHideEndScreenCards(); + break; + } case "maximizeButtonChange": { const { data: { maximizePlayerButtonEnabled } @@ -300,7 +311,7 @@ window.addEventListener("DOMContentLoaded", function () { data: { remainingTimeEnabled } } = message; if (remainingTimeEnabled) { - await setupRemainingTime(); + await enableRemainingTime(); } else { removeRemainingTimeDisplay(); } @@ -363,6 +374,14 @@ window.addEventListener("DOMContentLoaded", function () { } break; } + case "hideTranslateCommentChange": { + const { + data: { hideTranslateCommentEnabled } + } = message; + if (hideTranslateCommentEnabled) await enableHideTranslateComment(); + else await disableHideTranslateComment(); + break; + } case "hideScrollBarChange": { const scrollBarHidden = document.getElementById("yte-hide-scroll-bar") !== null; const { @@ -390,6 +409,17 @@ window.addEventListener("DOMContentLoaded", function () { } break; } + case "hideLiveStreamChatChange": { + const { + data: { hideLiveStreamChatEnabled } + } = message; + if (hideLiveStreamChatEnabled) { + await enableHideLiveStreamChat(); + } else { + await disableHideLiveStreamChat(); + } + break; + } case "languageChange": { const { data: { language } @@ -495,7 +525,7 @@ window.addEventListener("DOMContentLoaded", function () { data: { removeRedirectEnabled } } = message; if (removeRedirectEnabled) { - await removeRedirect(); + await enableRemoveRedirect(); } break; } diff --git a/src/types/index.ts b/src/types/index.ts index d16bdff7..49dadc76 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -273,8 +273,11 @@ export type ExtensionSendOnlyMessageMappings = { { deepDarkCustomThemeColors: DeepDarkCustomThemeColors; deepDarkPreset: DeepDarkPreset; deepDarkThemeEnabled: boolean } >; featureMenuOpenTypeChange: DataResponseMessage<"featureMenuOpenTypeChange", { featureMenuOpenType: FeatureMenuOpenType }>; + hideEndScreenCardsChange: DataResponseMessage<"hideEndScreenCardsChange", { hideEndScreenCardsEnabled: boolean }>; + hideLiveStreamChatChange: DataResponseMessage<"hideLiveStreamChatChange", { hideLiveStreamChatEnabled: boolean }>; hideScrollBarChange: DataResponseMessage<"hideScrollBarChange", { hideScrollBarEnabled: boolean }>; hideShortsChange: DataResponseMessage<"hideShortsChange", { hideShortsEnabled: boolean }>; + hideTranslateCommentChange: DataResponseMessage<"hideTranslateCommentChange", { hideTranslateCommentEnabled: boolean }>; languageChange: DataResponseMessage<"languageChange", { language: AvailableLocales }>; loopButtonChange: DataResponseMessage<"loopButtonChange", { loopButtonEnabled: boolean }>; maximizeButtonChange: DataResponseMessage<"maximizeButtonChange", { maximizePlayerButtonEnabled: boolean }>; @@ -352,8 +355,11 @@ export type configuration = { enable_custom_css: boolean; enable_deep_dark_theme: boolean; enable_forced_playback_speed: boolean; + enable_hide_end_screen_cards: boolean; + enable_hide_live_stream_chat: boolean; enable_hide_scrollbar: boolean; enable_hide_shorts: boolean; + enable_hide_translate_comment: boolean; enable_loop_button: boolean; enable_maximize_player_button: boolean; enable_open_transcript_button: boolean; diff --git a/src/utils/constants.ts b/src/utils/constants.ts index d48d8fa7..35b9fff5 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -46,8 +46,11 @@ export const defaultConfiguration = { enable_custom_css: false, enable_deep_dark_theme: false, enable_forced_playback_speed: false, + enable_hide_end_screen_cards: false, + enable_hide_live_stream_chat: false, enable_hide_scrollbar: false, enable_hide_shorts: false, + enable_hide_translate_comment: false, enable_loop_button: false, enable_maximize_player_button: false, enable_open_transcript_button: false, @@ -126,8 +129,11 @@ export const configurationImportSchema: TypeToPartialZodSchema< enable_custom_css: z.boolean().optional(), enable_deep_dark_theme: z.boolean().optional(), enable_forced_playback_speed: z.boolean().optional(), + enable_hide_end_screen_cards: z.boolean().optional(), + enable_hide_live_stream_chat: z.boolean().optional(), enable_hide_scrollbar: z.boolean().optional(), enable_hide_shorts: z.boolean().optional(), + enable_hide_translate_comment: z.boolean().optional(), enable_loop_button: z.boolean().optional(), enable_maximize_player_button: z.boolean().optional(), enable_open_transcript_button: z.boolean().optional(), diff --git a/src/utils/utilities.ts b/src/utils/utilities.ts index 04e7b783..fdb7f1e2 100644 --- a/src/utils/utilities.ts +++ b/src/utils/utilities.ts @@ -18,6 +18,7 @@ import type { Selector, SendDataMessage, SingleButtonFeatureNames, + SingleButtonNames, YoutubePlayerQualityLevel } from "../types"; import type { SVGElementAttributes } from "./SVGElementAttributes"; @@ -52,15 +53,13 @@ export function chooseClosestQuality( if (availableQualities.length === 0) { return null; } - + // If the selected quality is available, return it + if (availableQualities.includes(selectedQuality)) { + return selectedQuality; + } // Find the index of the selected quality in the array const selectedIndex = youtubePlayerQualityLevels.indexOf(selectedQuality); - // If the selected quality is not in the array, return null - if (selectedIndex === -1) { - return null; - } - // Find the available quality levels that are closest to the selected quality level const closestQualities = availableQualities.reduce( (acc, quality) => { @@ -73,9 +72,6 @@ export function chooseClosestQuality( [] as { difference: number; quality: YoutubePlayerQualityLevel }[] ); - // Sort the closest qualities by difference in ascending order - closestQualities.sort((a, b) => a.difference - b.difference); - // Return the quality level with the minimum difference return closestQualities[0].quality; } @@ -467,7 +463,7 @@ export function createTooltip({ direction?: "down" | "left" | "right" | "up"; element: HTMLElement; featureName: FeatureName; - id: `yte-feature-${FeatureName}-tooltip`; + id: `yte-feature-${AllButtonNames | Exclude}-tooltip`; text?: string; }): { listener: () => void; @@ -654,6 +650,15 @@ export function getPathValue>(obj: T, path: P): PathValue; } +export type ModifyElementAction = "add" | "remove"; +export type ElementClassPair = { className: string; element: Nullable }; +export function modifyElementClassList(action: ModifyElementAction, elementPair: ElementClassPair) { + const { className, element } = elementPair; + element?.classList[action](className); +} +export function modifyElementsClassList(action: ModifyElementAction, elements: ElementClassPair[]) { + elements.forEach((element) => modifyElementClassList(action, element)); +} export function findKeyByValue(value: Exclude) { for (const [key, values] of featureToMultiButtonsMap.entries()) { if (values.includes(value)) {