mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-26 09:28:37 +03:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
842564d56f | ||
|
|
f331e0cdf5 | ||
|
|
f3da71c12f | ||
|
|
41718ea5ae | ||
|
|
0cdfd68239 | ||
|
|
bbb234e498 | ||
|
|
3716c8aa80 | ||
|
|
92e156834b | ||
|
|
b2e6e4f076 | ||
|
|
6348bdccde | ||
|
|
c3213eb040 | ||
|
|
78a006544a | ||
|
|
3ab2361f45 | ||
|
|
6068276644 | ||
|
|
e3bedbf5f2 | ||
|
|
c9fc22e51e | ||
|
|
146c1fc889 | ||
|
|
63a5b6fb6f | ||
|
|
254261b83a |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.1.12",
|
"version": "5.2.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
@@ -73,14 +73,19 @@
|
|||||||
"content.css",
|
"content.css",
|
||||||
"shared.css",
|
"shared.css",
|
||||||
"js/document.js",
|
"js/document.js",
|
||||||
"libs/Source+Sans+Pro.css"
|
"libs/Source+Sans+Pro.css",
|
||||||
|
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2",
|
||||||
|
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2",
|
||||||
|
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2",
|
||||||
|
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2"
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage",
|
"storage",
|
||||||
"https://sponsor.ajay.app/*"
|
"https://sponsor.ajay.app/*"
|
||||||
],
|
],
|
||||||
"optional_permissions": [
|
"optional_permissions": [
|
||||||
"*://*/*"
|
"*://*/*",
|
||||||
|
"webNavigation"
|
||||||
],
|
],
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_title": "SponsorBlock",
|
"default_title": "SponsorBlock",
|
||||||
@@ -88,8 +93,8 @@
|
|||||||
"default_icon": {
|
"default_icon": {
|
||||||
"16": "icons/IconSponsorBlocker16px.png",
|
"16": "icons/IconSponsorBlocker16px.png",
|
||||||
"32": "icons/IconSponsorBlocker32px.png",
|
"32": "icons/IconSponsorBlocker32px.png",
|
||||||
"64": "icons/LogoSponsorBlocker64px.png",
|
"64": "icons/IconSponsorBlocker64px.png",
|
||||||
"128": "icons/LogoSponsorBlocker128px.png"
|
"128": "icons/IconSponsorBlocker128px.png"
|
||||||
},
|
},
|
||||||
"theme_icons": [
|
"theme_icons": [
|
||||||
{
|
{
|
||||||
@@ -103,13 +108,13 @@
|
|||||||
"size": 32
|
"size": 32
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"light": "icons/LogoSponsorBlocker64px.png",
|
"light": "icons/IconSponsorBlocker64px.png",
|
||||||
"dark": "icons/LogoSponsorBlocker64px.png",
|
"dark": "icons/IconSponsorBlocker64px.png",
|
||||||
"size": 64
|
"size": 64
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"light": "icons/LogoSponsorBlocker128px.png",
|
"light": "icons/IconSponsorBlocker128px.png",
|
||||||
"dark": "icons/LogoSponsorBlocker128px.png",
|
"dark": "icons/IconSponsorBlocker128px.png",
|
||||||
"size": 128
|
"size": 128
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -123,11 +128,11 @@
|
|||||||
"icons": {
|
"icons": {
|
||||||
"16": "icons/IconSponsorBlocker16px.png",
|
"16": "icons/IconSponsorBlocker16px.png",
|
||||||
"32": "icons/IconSponsorBlocker32px.png",
|
"32": "icons/IconSponsorBlocker32px.png",
|
||||||
"64": "icons/LogoSponsorBlocker64px.png",
|
"64": "icons/IconSponsorBlocker64px.png",
|
||||||
"128": "icons/LogoSponsorBlocker128px.png",
|
"128": "icons/IconSponsorBlocker128px.png",
|
||||||
"256": "icons/LogoSponsorBlocker256px.png",
|
"256": "icons/IconSponsorBlocker256px.png",
|
||||||
"512": "icons/LogoSponsorBlocker512px.png",
|
"512": "icons/IconSponsorBlocker512px.png",
|
||||||
"1024": "icons/LogoSponsorBlocker1024px.png"
|
"1024": "icons/IconSponsorBlocker1024px.png"
|
||||||
},
|
},
|
||||||
"options_ui": {
|
"options_ui": {
|
||||||
"page": "options/options.html",
|
"page": "options/options.html",
|
||||||
|
|||||||
95
package-lock.json
generated
95
package-lock.json
generated
@@ -28,6 +28,7 @@
|
|||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ajayyy/maze-utils": "^1.0.3",
|
"@ajayyy/maze-utils": "^1.0.3",
|
||||||
|
"content-scripts-register-polyfill": "^4.0.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
},
|
},
|
||||||
@@ -4286,6 +4287,19 @@
|
|||||||
"url": "https://github.com/yeoman/configstore?sponsor=1"
|
"url": "https://github.com/yeoman/configstore?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/content-scripts-register-polyfill": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-scripts-register-polyfill/-/content-scripts-register-polyfill-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-8hDm+tu3BkxHZP7EUIIIo/495F6QNXF7cI9Lwr4PQaiohw2wWmi9k2SE4W4kNrAaLnFw6RZ2ev8EmrQb+sCoGQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"webext-content-scripts": "^2.5.2",
|
||||||
|
"webext-patterns": "^1.3.0",
|
||||||
|
"webext-polyfill-kinda": "^1.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/fregante"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/convert-source-map": {
|
"node_modules/convert-source-map": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
|
||||||
@@ -12811,6 +12825,48 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/webext-content-scripts": {
|
||||||
|
"version": "2.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-content-scripts/-/webext-content-scripts-2.5.2.tgz",
|
||||||
|
"integrity": "sha512-N1Xq/E8dx0lVAOyPquuo+2Vj9Fx1GoqCFo79lWeJHbemaBJ53N3BHBmbJJYsQ8FOP1xiwN4bPRQY2dpSjHAD3Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"webext-patterns": "^1.3.0",
|
||||||
|
"webext-polyfill-kinda": "^1.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/fregante"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/webext-patterns": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-patterns/-/webext-patterns-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-X9HMnic9ZtvSFKi2cdh0l+sxyj7f9oLedaa2JfxjnyEqGBz8OJjaHQ40jmraX1DJLTHOpqr+rCz1r3MW2+doUg==",
|
||||||
|
"dependencies": {
|
||||||
|
"escape-string-regexp": "^5.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/fregante"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/webext-patterns/node_modules/escape-string-regexp": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/webext-polyfill-kinda": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-polyfill-kinda/-/webext-polyfill-kinda-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-Py/d3w/bC0KntuO60ePSWHsdrebZ3uYBLeFUjyPkDV3yTEQib0MRFvPh57t8XjImu4ylBoEAsFjzh/r22UtxMw==",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/fregante"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
||||||
@@ -16550,6 +16606,16 @@
|
|||||||
"xdg-basedir": "^5.0.1"
|
"xdg-basedir": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"content-scripts-register-polyfill": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-scripts-register-polyfill/-/content-scripts-register-polyfill-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-8hDm+tu3BkxHZP7EUIIIo/495F6QNXF7cI9Lwr4PQaiohw2wWmi9k2SE4W4kNrAaLnFw6RZ2ev8EmrQb+sCoGQ==",
|
||||||
|
"requires": {
|
||||||
|
"webext-content-scripts": "^2.5.2",
|
||||||
|
"webext-patterns": "^1.3.0",
|
||||||
|
"webext-polyfill-kinda": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"convert-source-map": {
|
"convert-source-map": {
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
|
||||||
@@ -22820,6 +22886,35 @@
|
|||||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"webext-content-scripts": {
|
||||||
|
"version": "2.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-content-scripts/-/webext-content-scripts-2.5.2.tgz",
|
||||||
|
"integrity": "sha512-N1Xq/E8dx0lVAOyPquuo+2Vj9Fx1GoqCFo79lWeJHbemaBJ53N3BHBmbJJYsQ8FOP1xiwN4bPRQY2dpSjHAD3Q==",
|
||||||
|
"requires": {
|
||||||
|
"webext-patterns": "^1.3.0",
|
||||||
|
"webext-polyfill-kinda": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"webext-patterns": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-patterns/-/webext-patterns-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-X9HMnic9ZtvSFKi2cdh0l+sxyj7f9oLedaa2JfxjnyEqGBz8OJjaHQ40jmraX1DJLTHOpqr+rCz1r3MW2+doUg==",
|
||||||
|
"requires": {
|
||||||
|
"escape-string-regexp": "^5.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"escape-string-regexp": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"webext-polyfill-kinda": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webext-polyfill-kinda/-/webext-polyfill-kinda-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-Py/d3w/bC0KntuO60ePSWHsdrebZ3uYBLeFUjyPkDV3yTEQib0MRFvPh57t8XjImu4ylBoEAsFjzh/r22UtxMw=="
|
||||||
|
},
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "background.js",
|
"main": "background.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@ajayyy/maze-utils": "^1.0.3",
|
||||||
|
"content-scripts-register-polyfill": "^4.0.2",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0"
|
||||||
"@ajayyy/maze-utils": "^1.0.3"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chrome": "^0.0.199",
|
"@types/chrome": "^0.0.199",
|
||||||
|
|||||||
@@ -442,7 +442,7 @@
|
|||||||
"message": "Support 3rd Party YouTube-Sites"
|
"message": "Support 3rd Party YouTube-Sites"
|
||||||
},
|
},
|
||||||
"supportOtherSitesDescription": {
|
"supportOtherSitesDescription": {
|
||||||
"message": "Support third party YouTube clients. To enable support, you must accept the extra permissions. This does NOT work in incognito on Chrome and other Chromium variants.",
|
"message": "Support third party YouTube clients. To enable support, you must accept the extra permissions.",
|
||||||
"description": "This replaces the 'supports Invidious' option because it now works on other YouTube sites such as Cloudtube"
|
"description": "This replaces the 'supports Invidious' option because it now works on other YouTube sites such as Cloudtube"
|
||||||
},
|
},
|
||||||
"supportedSites": {
|
"supportedSites": {
|
||||||
|
|||||||
BIN
public/icons/IconSponsorBlocker1024px.png
Normal file
BIN
public/icons/IconSponsorBlocker1024px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
BIN
public/icons/IconSponsorBlocker128px.png
Normal file
BIN
public/icons/IconSponsorBlocker128px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 24 KiB |
BIN
public/icons/IconSponsorBlocker512px.png
Normal file
BIN
public/icons/IconSponsorBlocker512px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
public/icons/IconSponsorBlocker64px.png
Normal file
BIN
public/icons/IconSponsorBlocker64px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2
Normal file
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2
Normal file
Binary file not shown.
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2
Normal file
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2
Normal file
Binary file not shown.
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2
Normal file
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2
Normal file
Binary file not shown.
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2
Normal file
BIN
public/libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
}
|
}
|
||||||
/* cyrillic */
|
/* cyrillic */
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
}
|
}
|
||||||
/* greek-ext */
|
/* greek-ext */
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+1F00-1FFF;
|
unicode-range: U+1F00-1FFF;
|
||||||
}
|
}
|
||||||
/* greek */
|
/* greek */
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+0370-03FF;
|
unicode-range: U+0370-03FF;
|
||||||
}
|
}
|
||||||
/* vietnamese */
|
/* vietnamese */
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
||||||
}
|
}
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2) format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
/* latin */
|
/* latin */
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2) format('woff2');
|
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2) format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
/* cyrillic-ext */
|
/* cyrillic-ext */
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
||||||
}
|
}
|
||||||
/* cyrillic */
|
/* cyrillic */
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
||||||
}
|
}
|
||||||
/* greek-ext */
|
/* greek-ext */
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+1F00-1FFF;
|
unicode-range: U+1F00-1FFF;
|
||||||
}
|
}
|
||||||
/* greek */
|
/* greek */
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+0370-03FF;
|
unicode-range: U+0370-03FF;
|
||||||
}
|
}
|
||||||
/* vietnamese */
|
/* vietnamese */
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
|
||||||
}
|
}
|
||||||
/* latin-ext */
|
/* latin-ext */
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2) format('woff2');
|
||||||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||||
}
|
}
|
||||||
/* latin */
|
/* latin */
|
||||||
@@ -107,6 +107,6 @@
|
|||||||
font-family: 'Source Sans Pro';
|
font-family: 'Source Sans Pro';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2) format('woff2');
|
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2) format('woff2');
|
||||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -442,7 +442,7 @@
|
|||||||
|
|
||||||
<div id="advanced" class="option-group hidden">
|
<div id="advanced" class="option-group hidden">
|
||||||
|
|
||||||
<div id="support-invidious" data-type="toggle" data-sync="supportInvidious" data-no-safari="true">
|
<div id="support-invidious" data-type="toggle" data-sync="supportInvidious">
|
||||||
<div class="switch-container">
|
<div class="switch-container">
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input id="supportInvidious" type="checkbox">
|
<input id="supportInvidious" type="checkbox">
|
||||||
@@ -457,7 +457,7 @@
|
|||||||
<div class="small-description">__MSG_supportOtherSitesDescription__ </div>
|
<div class="small-description">__MSG_supportOtherSitesDescription__ </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-type="private-text-change" data-sync="invidiousInstances" data-no-safari="true" data-dependent-on="supportInvidious">
|
<div data-type="private-text-change" data-sync="invidiousInstances" data-dependent-on="supportInvidious">
|
||||||
<div class="option-button trigger-button">
|
<div class="option-button trigger-button">
|
||||||
__MSG_addInvidiousInstance__
|
__MSG_addInvidiousInstance__
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as CompileConfig from "../config.json";
|
|||||||
|
|
||||||
import Config from "./config";
|
import Config from "./config";
|
||||||
import { Registration } from "./types";
|
import { Registration } from "./types";
|
||||||
|
import registerContentScript from 'content-scripts-register-polyfill/ponyfill.js';
|
||||||
|
|
||||||
// Make the config public for debugging purposes
|
// Make the config public for debugging purposes
|
||||||
|
|
||||||
@@ -20,11 +21,9 @@ const popupPort: Record<string, chrome.runtime.Port> = {};
|
|||||||
const contentScriptRegistrations = {};
|
const contentScriptRegistrations = {};
|
||||||
|
|
||||||
// Register content script if needed
|
// Register content script if needed
|
||||||
if (utils.isFirefox()) {
|
utils.wait(() => Config.config !== null).then(function() {
|
||||||
utils.wait(() => Config.config !== null).then(function() {
|
if (Config.config.supportInvidious) utils.setupExtraSiteContentScripts();
|
||||||
if (Config.config.supportInvidious) utils.setupExtraSiteContentScripts();
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function onTabUpdatedListener(tabId: number) {
|
function onTabUpdatedListener(tabId: number) {
|
||||||
chrome.tabs.sendMessage(tabId, {
|
chrome.tabs.sendMessage(tabId, {
|
||||||
@@ -167,7 +166,7 @@ function registerFirefoxContentScript(options: Registration) {
|
|||||||
const oldRegistration = contentScriptRegistrations[options.id];
|
const oldRegistration = contentScriptRegistrations[options.id];
|
||||||
if (oldRegistration) oldRegistration.unregister();
|
if (oldRegistration) oldRegistration.unregister();
|
||||||
|
|
||||||
browser.contentScripts.register({
|
registerContentScript({
|
||||||
allFrames: options.allFrames,
|
allFrames: options.allFrames,
|
||||||
js: options.js,
|
js: options.js,
|
||||||
css: options.css,
|
css: options.css,
|
||||||
@@ -181,8 +180,10 @@ function registerFirefoxContentScript(options: Registration) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function unregisterFirefoxContentScript(id: string) {
|
function unregisterFirefoxContentScript(id: string) {
|
||||||
contentScriptRegistrations[id].unregister();
|
if (contentScriptRegistrations[id]) {
|
||||||
delete contentScriptRegistrations[id];
|
contentScriptRegistrations[id].unregister();
|
||||||
|
delete contentScriptRegistrations[id];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitVote(type: number, UUID: string, category: string) {
|
async function submitVote(type: number, UUID: string, category: string) {
|
||||||
|
|||||||
@@ -550,8 +550,8 @@ function migrateOldSyncFormats(config: SBConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// populate invidiousInstances with new instances if 3p support is **DISABLED**
|
// populate invidiousInstances with new instances if 3p support is **DISABLED**
|
||||||
if (!config["supportInvidious"] && config["invidiousInstances"].length !== invidiousList.length) {
|
if (!config["supportInvidious"] && config["invidiousInstances"].length < invidiousList.length) {
|
||||||
config["invidiousInstances"] = invidiousList;
|
config["invidiousInstances"] = [...new Set([...invidiousList, ...config["invidiousInstances"]])];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config["lastIsVipUpdate"]) {
|
if (config["lastIsVipUpdate"]) {
|
||||||
|
|||||||
172
src/content.ts
172
src/content.ts
@@ -1092,98 +1092,88 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
|||||||
source: SponsorSourceType.Server
|
source: SponsorSourceType.Server
|
||||||
}))
|
}))
|
||||||
?.sort((a, b) => a.segment[0] - b.segment[0]);
|
?.sort((a, b) => a.segment[0] - b.segment[0]);
|
||||||
if (!recievedSegments || !recievedSegments.length) {
|
if (recievedSegments && recievedSegments.length) {
|
||||||
// return if no video found
|
if (showChapterMessage) {
|
||||||
chrome.runtime.sendMessage({
|
const chapterSegments = recievedSegments.filter((s) => s.actionType === ActionType.Chapter);
|
||||||
message: "infoUpdated",
|
if (chapterSegments.length > 3) {
|
||||||
found: false,
|
const prependElement = document.querySelector(".ytp-chrome-bottom") as HTMLElement;
|
||||||
status: lastResponseStatus,
|
if (prependElement) {
|
||||||
sponsorTimes: sponsorTimes,
|
Config.config.showChapterInfoMessage = false;
|
||||||
time: video.currentTime,
|
new Tooltip({
|
||||||
onMobileYouTube
|
text: `🟨${chrome.i18n.getMessage("chapterNewFeature")}${chapterSegments.slice(0, 3).map((s) => s.description).join(", ")}`,
|
||||||
});
|
linkOnClick: () => void chrome.runtime.sendMessage({ "message": "openUpsell" }),
|
||||||
|
referenceNode: prependElement.parentElement,
|
||||||
|
prependElement,
|
||||||
|
timeout: 1500,
|
||||||
|
leftOffset: "20px",
|
||||||
|
positionRealtive: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
recievedSegments = recievedSegments.filter((s) => s.actionType !== ActionType.Chapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
sponsorDataFound = true;
|
||||||
|
|
||||||
|
// Check if any old submissions should be kept
|
||||||
|
if (sponsorTimes !== null && keepOldSubmissions) {
|
||||||
|
for (let i = 0; i < sponsorTimes.length; i++) {
|
||||||
|
if (sponsorTimes[i].source === SponsorSourceType.Local) {
|
||||||
|
// This is a user submission, keep it
|
||||||
|
recievedSegments.push(sponsorTimes[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const oldSegments = sponsorTimes || [];
|
||||||
|
sponsorTimes = recievedSegments;
|
||||||
|
existingChaptersImported = false;
|
||||||
|
|
||||||
|
// Hide all submissions smaller than the minimum duration
|
||||||
|
if (Config.config.minDuration !== 0) {
|
||||||
|
for (const segment of sponsorTimes) {
|
||||||
|
const duration = segment.segment[1] - segment.segment[0];
|
||||||
|
if (duration > 0 && duration < Config.config.minDuration) {
|
||||||
|
segment.hidden = SponsorHideType.MinimumDuration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keepOldSubmissions) {
|
||||||
|
for (const segment of oldSegments) {
|
||||||
|
const otherSegment = sponsorTimes.find((other) => segment.UUID === other.UUID);
|
||||||
|
if (otherSegment) {
|
||||||
|
// If they downvoted it, or changed the category, keep it
|
||||||
|
otherSegment.hidden = segment.hidden;
|
||||||
|
otherSegment.category = segment.category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// See if some segments should be hidden
|
||||||
|
const downvotedData = Config.local.downvotedSegments[hashPrefix];
|
||||||
|
if (downvotedData) {
|
||||||
|
for (const segment of sponsorTimes) {
|
||||||
|
const hashedUUID = await utils.getHash(segment.UUID, 1);
|
||||||
|
const segmentDownvoteData = downvotedData.segments.find((downvote) => downvote.uuid === hashedUUID);
|
||||||
|
if (segmentDownvoteData) {
|
||||||
|
segment.hidden = segmentDownvoteData.hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startSkipScheduleCheckingForStartSponsors();
|
||||||
|
|
||||||
|
//update the preview bar
|
||||||
|
//leave the type blank for now until categories are added
|
||||||
|
if (lastPreviewBarUpdate == sponsorVideoID || (lastPreviewBarUpdate == null && !isNaN(video.duration))) {
|
||||||
|
//set it now
|
||||||
|
//otherwise the listener can handle it
|
||||||
|
updatePreviewBar();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
retryFetch(404);
|
retryFetch(404);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showChapterMessage) {
|
|
||||||
const chapterSegments = recievedSegments.filter((s) => s.actionType === ActionType.Chapter);
|
|
||||||
if (chapterSegments.length > 3) {
|
|
||||||
const prependElement = document.querySelector(".ytp-chrome-bottom") as HTMLElement;
|
|
||||||
if (prependElement) {
|
|
||||||
Config.config.showChapterInfoMessage = false;
|
|
||||||
new Tooltip({
|
|
||||||
text: `🟨${chrome.i18n.getMessage("chapterNewFeature")}${chapterSegments.slice(0, 3).map((s) => s.description).join(", ")}`,
|
|
||||||
linkOnClick: () => void chrome.runtime.sendMessage({ "message": "openUpsell" }),
|
|
||||||
referenceNode: prependElement.parentElement,
|
|
||||||
prependElement,
|
|
||||||
timeout: 1500,
|
|
||||||
leftOffset: "20px",
|
|
||||||
positionRealtive: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
recievedSegments = recievedSegments.filter((s) => s.actionType !== ActionType.Chapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
sponsorDataFound = true;
|
|
||||||
|
|
||||||
// Check if any old submissions should be kept
|
|
||||||
if (sponsorTimes !== null && keepOldSubmissions) {
|
|
||||||
for (let i = 0; i < sponsorTimes.length; i++) {
|
|
||||||
if (sponsorTimes[i].source === SponsorSourceType.Local) {
|
|
||||||
// This is a user submission, keep it
|
|
||||||
recievedSegments.push(sponsorTimes[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const oldSegments = sponsorTimes || [];
|
|
||||||
sponsorTimes = recievedSegments;
|
|
||||||
existingChaptersImported = false;
|
|
||||||
|
|
||||||
// Hide all submissions smaller than the minimum duration
|
|
||||||
if (Config.config.minDuration !== 0) {
|
|
||||||
for (const segment of sponsorTimes) {
|
|
||||||
const duration = segment.segment[1] - segment.segment[0];
|
|
||||||
if (duration > 0 && duration < Config.config.minDuration) {
|
|
||||||
segment.hidden = SponsorHideType.MinimumDuration;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keepOldSubmissions) {
|
|
||||||
for (const segment of oldSegments) {
|
|
||||||
const otherSegment = sponsorTimes.find((other) => segment.UUID === other.UUID);
|
|
||||||
if (otherSegment) {
|
|
||||||
// If they downvoted it, or changed the category, keep it
|
|
||||||
otherSegment.hidden = segment.hidden;
|
|
||||||
otherSegment.category = segment.category;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// See if some segments should be hidden
|
|
||||||
const downvotedData = Config.local.downvotedSegments[hashPrefix];
|
|
||||||
if (downvotedData) {
|
|
||||||
for (const segment of sponsorTimes) {
|
|
||||||
const hashedUUID = await utils.getHash(segment.UUID, 1);
|
|
||||||
const segmentDownvoteData = downvotedData.segments.find((downvote) => downvote.uuid === hashedUUID);
|
|
||||||
if (segmentDownvoteData) {
|
|
||||||
segment.hidden = segmentDownvoteData.hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
startSkipScheduleCheckingForStartSponsors();
|
|
||||||
|
|
||||||
//update the preview bar
|
|
||||||
//leave the type blank for now until categories are added
|
|
||||||
if (lastPreviewBarUpdate == sponsorVideoID || (lastPreviewBarUpdate == null && !isNaN(video.duration))) {
|
|
||||||
//set it now
|
|
||||||
//otherwise the listener can handle it
|
|
||||||
updatePreviewBar();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
retryFetch(lastResponseStatus);
|
retryFetch(lastResponseStatus);
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ class PreviewBar {
|
|||||||
if (chapterChevron) {
|
if (chapterChevron) {
|
||||||
if (this.segments.some((segment) => segment.source === SponsorSourceType.YouTube)) {
|
if (this.segments.some((segment) => segment.source === SponsorSourceType.YouTube)) {
|
||||||
chapterChevron.style.removeProperty("display");
|
chapterChevron.style.removeProperty("display");
|
||||||
} else {
|
} else if (this.segments) {
|
||||||
chapterChevron.style.display = "none";
|
chapterChevron.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ function invidiousInstanceAddInit(element: HTMLElement, option: string) {
|
|||||||
let instanceList = Config.config[option];
|
let instanceList = Config.config[option];
|
||||||
if (!instanceList) instanceList = [];
|
if (!instanceList) instanceList = [];
|
||||||
|
|
||||||
instanceList.push(textBox.value);
|
instanceList.push(textBox.value.trim().toLowerCase());
|
||||||
|
|
||||||
Config.config[option] = instanceList;
|
Config.config[option] = instanceList;
|
||||||
|
|
||||||
|
|||||||
94
src/utils.ts
94
src/utils.ts
@@ -4,6 +4,7 @@ import { CategorySelection, SponsorTime, FetchResponse, BackgroundScriptContaine
|
|||||||
import * as CompileConfig from "../config.json";
|
import * as CompileConfig from "../config.json";
|
||||||
import { findValidElement, findValidElementFromSelector } from "./utils/pageUtils";
|
import { findValidElement, findValidElementFromSelector } from "./utils/pageUtils";
|
||||||
import { waitFor } from "@ajayyy/maze-utils";
|
import { waitFor } from "@ajayyy/maze-utils";
|
||||||
|
import { isSafari } from "./utils/configUtils";
|
||||||
|
|
||||||
export default class Utils {
|
export default class Utils {
|
||||||
|
|
||||||
@@ -18,7 +19,8 @@ export default class Utils {
|
|||||||
css = [
|
css = [
|
||||||
"content.css",
|
"content.css",
|
||||||
"./libs/Source+Sans+Pro.css",
|
"./libs/Source+Sans+Pro.css",
|
||||||
"popup.css"
|
"popup.css",
|
||||||
|
"shared.css"
|
||||||
];
|
];
|
||||||
|
|
||||||
/* Used for waitForElement */
|
/* Used for waitForElement */
|
||||||
@@ -117,9 +119,9 @@ export default class Utils {
|
|||||||
* @param {CallableFunction} callback
|
* @param {CallableFunction} callback
|
||||||
*/
|
*/
|
||||||
setupExtraSitePermissions(callback: (granted: boolean) => void): void {
|
setupExtraSitePermissions(callback: (granted: boolean) => void): void {
|
||||||
// Request permission
|
let permissions = ["webNavigation"];
|
||||||
let permissions = ["declarativeContent"];
|
if (!isSafari()) permissions.push("declarativeContent");
|
||||||
if (this.isFirefox()) permissions = [];
|
if (this.isFirefox() && !isSafari()) permissions = [];
|
||||||
|
|
||||||
chrome.permissions.request({
|
chrome.permissions.request({
|
||||||
origins: this.getPermissionRegex(),
|
origins: this.getPermissionRegex(),
|
||||||
@@ -143,52 +145,28 @@ export default class Utils {
|
|||||||
* For now, it is just SB.config.invidiousInstances.
|
* For now, it is just SB.config.invidiousInstances.
|
||||||
*/
|
*/
|
||||||
setupExtraSiteContentScripts(): void {
|
setupExtraSiteContentScripts(): void {
|
||||||
if (this.isFirefox()) {
|
const firefoxJS = [];
|
||||||
const firefoxJS = [];
|
for (const file of this.js) {
|
||||||
for (const file of this.js) {
|
firefoxJS.push({file});
|
||||||
firefoxJS.push({file});
|
}
|
||||||
}
|
const firefoxCSS = [];
|
||||||
const firefoxCSS = [];
|
for (const file of this.css) {
|
||||||
for (const file of this.css) {
|
firefoxCSS.push({file});
|
||||||
firefoxCSS.push({file});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const registration: Registration = {
|
const registration: Registration = {
|
||||||
message: "registerContentScript",
|
message: "registerContentScript",
|
||||||
id: "invidious",
|
id: "invidious",
|
||||||
allFrames: true,
|
allFrames: true,
|
||||||
js: firefoxJS,
|
js: firefoxJS,
|
||||||
css: firefoxCSS,
|
css: firefoxCSS,
|
||||||
matches: this.getPermissionRegex()
|
matches: this.getPermissionRegex()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.backgroundScriptContainer) {
|
if (this.backgroundScriptContainer) {
|
||||||
this.backgroundScriptContainer.registerFirefoxContentScript(registration);
|
this.backgroundScriptContainer.registerFirefoxContentScript(registration);
|
||||||
} else {
|
|
||||||
chrome.runtime.sendMessage(registration);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
chrome.declarativeContent.onPageChanged.removeRules(["invidious"], () => {
|
chrome.runtime.sendMessage(registration);
|
||||||
const conditions = [];
|
|
||||||
for (const regex of this.getPermissionRegex()) {
|
|
||||||
conditions.push(new chrome.declarativeContent.PageStateMatcher({
|
|
||||||
pageUrl: { urlMatches: regex }
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add page rule
|
|
||||||
const rule = {
|
|
||||||
id: "invidious",
|
|
||||||
conditions,
|
|
||||||
actions: [new chrome.declarativeContent.RequestContentScript({
|
|
||||||
allFrames: true,
|
|
||||||
js: this.js,
|
|
||||||
css: this.css
|
|
||||||
})]
|
|
||||||
};
|
|
||||||
|
|
||||||
chrome.declarativeContent.onPageChanged.addRules([rule]);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,18 +174,18 @@ export default class Utils {
|
|||||||
* Removes the permission and content script registration.
|
* Removes the permission and content script registration.
|
||||||
*/
|
*/
|
||||||
removeExtraSiteRegistration(): void {
|
removeExtraSiteRegistration(): void {
|
||||||
if (this.isFirefox()) {
|
const id = "invidious";
|
||||||
const id = "invidious";
|
|
||||||
|
|
||||||
if (this.backgroundScriptContainer) {
|
if (this.backgroundScriptContainer) {
|
||||||
this.backgroundScriptContainer.unregisterFirefoxContentScript(id);
|
this.backgroundScriptContainer.unregisterFirefoxContentScript(id);
|
||||||
} else {
|
} else {
|
||||||
chrome.runtime.sendMessage({
|
chrome.runtime.sendMessage({
|
||||||
message: "unregisterContentScript",
|
message: "unregisterContentScript",
|
||||||
id: id
|
id: id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (chrome.declarativeContent) {
|
|
||||||
|
if (!this.isFirefox() && chrome.declarativeContent) {
|
||||||
// Only if we have permission
|
// Only if we have permission
|
||||||
chrome.declarativeContent.onPageChanged.removeRules(["invidious"]);
|
chrome.declarativeContent.onPageChanged.removeRules(["invidious"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export function showDonationLink(): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isSafari(): boolean {
|
export function isSafari(): boolean {
|
||||||
return navigator.vendor === "Apple Computer, Inc.";
|
return typeof(navigator) !== "undefined" && navigator.vendor === "Apple Computer, Inc.";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function keybindEquals(first: Keybind, second: Keybind): boolean {
|
export function keybindEquals(first: Keybind, second: Keybind): boolean {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { validate } = require('schema-utils');
|
const { validate } = require('schema-utils');
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
const manifest = require("../manifest/manifest.json");
|
const manifest = require("../manifest/manifest.json");
|
||||||
|
|||||||
Reference in New Issue
Block a user