Compare commits

...

55 Commits

Author SHA1 Message Date
Ajay Ramachandran
32d3487b07 Increase version number 2021-05-19 16:25:32 -04:00
Ajay Ramachandran
3ef2673bfc Remove hash prefix option (always uses hash prefix) 2021-05-19 16:11:07 -04:00
Ajay Ramachandran
ac6cd2cec1 Add new channel ID detection logic 2021-05-19 16:08:09 -04:00
Ajay Ramachandran
995ed929ca Merge pull request #744 from wilkmaciej/master
Skip count sending and counting on manual skip
2021-05-19 11:18:25 -04:00
Ajay Ramachandran
592af4e20f Merge pull request #569 from opl-/cleanup/segment-creation
Clean up segment creation code
2021-05-16 20:48:22 -04:00
Ajay Ramachandran
ecfcb0b846 Make buttons not appear on invidious 2021-05-16 20:45:16 -04:00
Ajay Ramachandran
18d10ada5e Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into pr/opl-/569 2021-05-16 20:29:31 -04:00
Ajay Ramachandran
3a7b6b27c2 Change when close info menu is called 2021-05-16 20:27:46 -04:00
Ajay Ramachandran
fea8f93b5a Semicolon 2021-05-16 18:45:06 -04:00
Ajay Ramachandran
daa7a653c9 Merge pull request #747 from wilkmaciej/fix_saved_time_rounding
fix wrong saved time rounding
2021-05-16 18:43:54 -04:00
Ajay Ramachandran
ddf3f7c6ff Increase version number 2021-05-16 17:32:58 -04:00
Ajay Ramachandran
fbcff7f4c4 Change video info fetch error message 2021-05-16 17:31:58 -04:00
Ajay Ramachandran
59f63f1b4b Add semi colon 2021-05-14 21:15:36 -04:00
Ajay Ramachandran
e432abe79d Formatting changes + prevent negative value 2021-05-14 21:15:03 -04:00
Maciej Wilk
08a063b612 if(config.trackViewCount) changed 2021-05-15 01:05:45 +02:00
Maciej Wilk
2d14176542 added .DS_Store to not commit by mistake 2021-05-15 01:02:58 +02:00
Maciej Wilk
5fad4509f0 applied proposed fixes 2021-05-15 00:24:27 +02:00
Maciej Wilk
bd44c4721b Update public/help/index_en.html
Co-authored-by: Ajay Ramachandran <dev@ajay.app>
2021-05-15 00:10:30 +02:00
Maciej Wilk
606b2fbee3 fix wrong saved time rounding 2021-05-14 20:18:02 +02:00
Maciej Wilk
f18aa19172 updated help
changed few confusing names
deleted auto upvote information
fixed minor typos
2021-05-14 19:23:58 +02:00
Maciej Wilk
8337b54a44 telemetry sending and counting on manual skip 2021-05-14 14:32:32 +02:00
Ajay Ramachandran
257098fd96 Fix description of error for force channel check 2021-05-13 12:20:39 -04:00
Ajay Ramachandran
0403393124 Increase version number 2021-05-12 17:01:54 -04:00
Ajay Ramachandran
11144fa77b Only ask for permission once 2021-05-12 17:00:31 -04:00
Ajay Ramachandran
dc5ecaded4 Merge pull request #737 from ajayyy/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.5 to 2.8.9
2021-05-10 20:12:48 -04:00
Ajay Ramachandran
60ae3111c2 Merge pull request #739 from ajayyy/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.19 to 4.17.21
2021-05-10 20:12:28 -04:00
Ajay Ramachandran
9f0f306439 Fix string 2021-05-10 18:06:59 -04:00
Ajay Ramachandran
08c5c73f4a Merge pull request #738 from ajayyy/fix-video
Prompt to accept youtube.com permission if video info fails to load
2021-05-10 16:25:17 -04:00
Ajay Ramachandran
35fc238891 New Crowdin updates (#697) 2021-05-10 16:24:36 -04:00
dependabot[bot]
8b7436320f Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 20:24:09 +00:00
Ajay Ramachandran
081e03e4ba Increase version number 2021-05-10 16:24:03 -04:00
Ajay Ramachandran
bf84139ea7 Prompt to accept youtube.com permission if video info fails to load
Should fix #698, #687, #611 and #635

(cherry picked from commit 3ff5fdb3a1)
2021-05-10 16:22:46 -04:00
dependabot[bot]
7498c6cf1b Bump hosted-git-info from 2.8.5 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 20:21:58 +00:00
Ajay Ramachandran
abe3f0532a Merge pull request #728 from ajayyy/dependabot/npm_and_yarn/ssri-6.0.2
Bump ssri from 6.0.1 to 6.0.2
2021-05-10 16:20:53 -04:00
dependabot[bot]
90c78af59f Bump ssri from 6.0.1 to 6.0.2
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 15:52:26 +00:00
Ajay Ramachandran
00045aa9d7 Move pull request template 2021-04-23 21:43:36 -04:00
Ajay Ramachandran
52f686977b Create pull_request_template.md 2021-04-23 21:39:52 -04:00
Ajay Ramachandran
fd05281c09 Fix typo 2021-04-20 18:56:16 -04:00
Ajay Ramachandran
cc3e613396 Rename CONTRIBUTING to CONTRIBUTING.md 2021-04-20 18:55:59 -04:00
Ajay Ramachandran
a0bdcbaf11 Add LGPL licensing requirement for new contributors 2021-04-20 18:55:27 -04:00
Ajay Ramachandran
6ca031d9e7 Merge pull request #705 from ajayyy/dependabot/npm_and_yarn/y18n-4.0.1
Bump y18n from 4.0.0 to 4.0.1
2021-04-05 19:45:16 -04:00
dependabot[bot]
0b560f3fbc Bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-31 10:39:17 +00:00
Ajay Ramachandran
8dfa386cdb Merge pull request #701 from manualmanul/fix-youtube-tv
Partially fix YouTube TV support
2021-03-26 18:36:29 -04:00
Manual
719010db97 Don’t throw an exception if there’s no videoRoot
Suggested change by @ajayyy

Co-authored-by: Ajay Ramachandran <dev@ajay.app>
2021-03-27 00:08:02 +02:00
Manual
928c075416 fix exception when on youtube.com/tv 2021-03-26 12:00:47 +02:00
Ajay Ramachandran
4469eada54 Merge pull request #699 from TotalCaesar659/patch-1
Update URLs to HTTPS
2021-03-24 20:43:32 -04:00
TotalCaesar659
b630545702 Update URLs to HTTPS 2021-03-25 03:40:31 +03:00
Ajay Ramachandran
1eb1574943 Fix shields 2021-03-23 20:38:48 -04:00
Ajay Ramachandran
80d014bc29 Fix shields 2021-03-23 20:38:04 -04:00
Ajay Ramachandran
cd52137454 Update README.md 2021-03-23 20:36:03 -04:00
Ajay Ramachandran
44c48ecfcc Increase version 2021-03-23 19:49:10 -04:00
Ajay Ramachandran
9b502b282f New Crowdin updates (#694)
* New translations messages.json (Polish)

* New translations messages.json (Ukrainian)
2021-03-23 19:48:47 -04:00
Ajay Ramachandran
590c8b2078 Merge pull request #695 from TotalCaesar659/patch-1
Update URLs to HTTPS
2021-03-23 19:40:28 -04:00
TotalCaesar659
41a0c12139 Update URLs to HTTPS 2021-03-23 22:10:14 +03:00
opl-
3879cc6de3 Clean up segment creation code
Noteworthy changes:
- Adds ability to cancel creating a segment
- Makes segment creation fully the responsibility of the content script, with the popup script buttons simply doing RPC
- Adds types to the Utils.wait function
- Fixes segment timestamps backwards if user marks segment end earlier than the start
- Makes the info menu (in-page popup) workaround clearer and easier to remove in the future.
2021-02-20 15:52:13 +01:00
37 changed files with 1203 additions and 511 deletions

1
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1 @@
- [ ] I agree to license my contribution under LGPL-3.0 **or** my contribution is from another project with a license compatible with LGPL-3.0

3
.gitignore vendored
View File

@@ -5,4 +5,5 @@ node_modules
web-ext-artifacts
.vscode/
dist/
tmp/
tmp/
.DS_Store

1
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1 @@
If you make any contributions to SponsorBlock after this file was created, you are agreeing that any code you have contributed will be licensed under LGPL-3.0.

View File

@@ -30,7 +30,7 @@
<a href="https://addons.mozilla.org/addon/sponsorblock/?src=external-github"><img src="https://img.shields.io/amo/users/sponsorblock?label=Firefox%20Users" alt="Badge"></img></a>
<a href="https://chrome.google.com/webstore/detail/mnjggcdmjocbbbhaepdhchncahnbgone"><img src="https://img.shields.io/chrome-web-store/users/mnjggcdmjocbbbhaepdhchncahnbgone?label=Chrome%20Users" alt="Badge"></img></a>
<a href="https://sponsor.ajay.app/stats"><img src="https://img.shields.io/badge/dynamic/json?label=Submissions&query=totalSubmissions&suffix=%20segments&url=http%3A%2F%2Fsponsor.ajay.app%2Fapi%2FgetTotalStats&color=darkred" alt="Badge"></img></a>
<a href="https://sponsor.ajay.app/stats"><img src="https://img.shields.io/badge/dynamic/json?label=Contributing%20Users&query=userCount&url=http%3A%2F%2Fsponsor.ajay.app%2Fapi%2FgetTotalStats&color=darkblue" alt="Badge"></img></a>
<a href="https://sponsor.ajay.app/stats"><img src="https://img.shields.io/badge/dynamic/json?label=Active%20Users&query=apiUsers&url=http%3A%2F%2Fsponsor.ajay.app%2Fapi%2FgetTotalStats&color=darkblue" alt="Badge"></img></a>
<a href="https://sponsor.ajay.app/stats"><img src="https://img.shields.io/badge/dynamic/json?label=Time%20Saved%20From%20Skips&query=daysSaved&url=http%3A%2F%2Fsponsor.ajay.app%2Fapi%2FgetDaysSavedFormatted&color=darkgreen&suffix=%20days" alt="Badge"></img></a>
</p>
@@ -50,14 +50,10 @@ See the [Wiki](https://github.com/ajayyy/SponsorBlock/wiki) for important links.
The backend server code is available here: https://github.com/ajayyy/SponsorBlockServer
It is a simple SQLite database that will hold all the timing data.
To make sure that this project doesn't die, I have made the database publicly downloadable at https://sponsor.ajay.app/database.db ([License](https://github.com/ajayyy/SponsorBlock/wiki/Database-and-API-License)). If you are planning on using the database in another project, please read the [API Docs](https://github.com/ajayyy/SponsorBlock/wiki/API-Docs) page for more information.
To make sure that this project doesn't die, I have made the database publicly downloadable at https://sponsor.ajay.app/database ([License](https://github.com/ajayyy/SponsorBlock/wiki/Database-and-API-License)). If you are planning on using the database in another project, please read the [API Docs](https://github.com/ajayyy/SponsorBlock/wiki/API-Docs) page for more information.
The dataset and API are now being used in some [ports](https://github.com/ajayyy/SponsorBlock/wiki/Unofficial-Ports) as well as a [neural network](https://github.com/andrewzlee/NeuralBlock).
A [previous project](https://github.com/Sponsoff/sponsorship_remover) attempted to create a neural network to predict when sponsored segments happen. That project is sadly abandoned now, so I have decided to attempt to revive this idea starting from a crowd-sourced system instead.
# API
You can read the API docs [here](https://github.com/ajayyy/SponsorBlockServer#api-docs).
@@ -79,7 +75,6 @@ The result is in `dist`. This can be loaded as an unpacked extension
Run `npm run dev` to run the extension using a clean browser profile with hot reloading. Use `npm run dev:firefox` for Firefox. This uses [`web-ext run`](https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#commands).
Known chromium bug: Extension is not loaded properly on first start. Visit `chrome://extensions/` and reload the extension.
### Attribution Generation
If you contribute and add a dependency, update the attribution file using the following steps:
@@ -95,14 +90,14 @@ mv ./oss-attribution/attribution.txt ./public/oss-attribution/attribution.txt
The awesome [Invidious API](https://github.com/omarroth/invidious/wiki/API) was previously used.
Originally forked from [YTSponsorSkip](https://github.com/NDevTK/YTSponsorSkip), but zero code remains.
Originally forked from [YTSponsorSkip](https://github.com/NDevTK/YTSponsorSkip), but very little code remains.
Icons made by:
* <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
* <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
* <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
* <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
* <a href="https://iconmonstr.com/about/#creator">Alexander Kahlkopf</a> from <a href="https://iconmonstr.com/">iconmonstr.com</a> and are licensed by <a href="https://iconmonstr.com/license/">iconmonstr License</a>
### License
This project is licensed under GNU GPL v3
This project is licensed under GNU GPL v3 or any later version

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "2.0.13",
"version": "2.0.15",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

44
package-lock.json generated
View File

@@ -4554,6 +4554,15 @@
"requires": {
"glob": "^7.1.3"
}
},
"ssri": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
"integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
}
}
}
},
@@ -5488,15 +5497,6 @@
"randombytes": "^2.1.0"
}
},
"ssri": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz",
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
"dev": true,
"requires": {
"minipass": "^3.1.1"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
@@ -7984,9 +7984,9 @@
}
},
"hosted-git-info": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg=="
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
},
"html-encoding-sniffer": {
"version": "2.0.1",
@@ -11692,9 +11692,9 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.defaults": {
"version": "4.2.0",
@@ -14497,12 +14497,12 @@
}
},
"ssri": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
"integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
"minipass": "^3.1.1"
}
},
"stack-utils": {
@@ -16734,9 +16734,9 @@
"dev": true
},
"y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ=="
},
"yallist": {
"version": "3.1.1",

View File

@@ -1 +1,61 @@
{}
{
"fullName": {
"message": "سبونسر بلوك لليوتيوب - تخطي الرعاية الاعلانية",
"description": "Name of the extension."
},
"Description": {
"message": "تخطي الرعاية الاعلانية ، التسول في الاشتراك والمزيد على مقاطع الفيديو على اليوتيوب. التبليغ عن الرعايه الاعلانيه علي مقاطع الفيديو التي تشاهدها لتوفير وقتك و وقت الآخرين.",
"description": "Description of the extension."
},
"400": {
"message": "الخادم قال أن هذا الطلب خاطيء"
},
"429": {
"message": "لقد قدمت الكثير من اوقات الرعاية الاعلانية لهذا الفيديو الواحد، هل أنت متأكد من وجود هذا العدد؟"
},
"409": {
"message": "تم تقديم هذا بالفعل من قبل"
},
"channelWhitelisted": {
"message": "القناة في القائمة البيضاء!"
},
"Segment": {
"message": "جزء"
},
"Segments": {
"message": "أجزاء"
},
"upvoteButtonInfo": {
"message": "التصويت على هذا الإرسال"
},
"reportButtonTitle": {
"message": "إبلاغ"
},
"reportButtonInfo": {
"message": "الإبلاغ عن هذا التقديم كغير صحيح."
},
"Dismiss": {
"message": "إلغاء"
},
"Loading": {
"message": "جاري التحميل..."
},
"Hide": {
"message": "لا تظهر أبداً"
},
"hitGoBack": {
"message": "قم الضغط علي تخطي للوصول إلى المكان الذي أتيت منه."
},
"unskip": {
"message": "الرجوع في التخطي"
},
"reskip": {
"message": "اعاده التخطي"
},
"paused": {
"message": "ايقاف مؤقت"
},
"manualPaused": {
"message": "تم إيقاف الموقت"
}
}

View File

@@ -1 +1,9 @@
{}
{
"fullName": {
"message": "ইউটিউবের জন্য স্পনসরব্লক - স্পনসরশিপ এড়িয়ে যান",
"description": "Name of the extension."
},
"409": {
"message": "এটি আগেই জমা দেওয়া হয়েছে"
}
}

View File

@@ -79,6 +79,9 @@
"sponsorEnd": {
"message": "Segment Ends Now"
},
"sponsorCancel": {
"message": "Cancel Creating Segment"
},
"noVideoID": {
"message": "No YouTube video found.\nIf this is incorrect, refresh the tab."
},
@@ -407,15 +410,6 @@
"areYouSureReset": {
"message": "Are you sure you would like to reset this?"
},
"confirmPrivacy": {
"message": "The video has been detected as unlisted. Click cancel if you do not want to check for skip segments."
},
"unlistedCheck": {
"message": "Ignore Unlisted/Private Videos"
},
"whatUnlistedCheck": {
"message": "This setting will slightly slow down SponsorBlock. Skip segment lookups require sending the video ID to the server. If you are concerned about unlisted video IDs being sent over the internet, enable this option."
},
"mobileUpdateInfo": {
"message": "m.youtube.com is now supported"
},
@@ -591,11 +585,23 @@
"channelDataNotFound": {
"message": "Channel ID not loaded yet."
},
"adblockerIssue": {
"message": "It seems that something is blocking SponsorBlock's ability to get video data. This is probably your ad blocker. Please check https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
"videoInfoFetchFailed": {
"message": "It seems that something is blocking SponsorBlock's ability to get video data. Please see https://github.com/ajayyy/SponsorBlock/issues/741 for more info."
},
"adblockerIssueUnlistedVideosInfo": {
"message": "If you are unable to resolve this, then disable the setting 'Ignore unlisted/private videos', as SponsorBlock is unable to retrieve the visibility information for this video"
"youtubePermissionRequest": {
"message": "It seems that SponsorBlock is unable to reach the YouTube API. To fix this, accept the permission prompt that will appear next, wait a few seconds, and then reload the page."
},
"acceptPermission": {
"message": "Accept permission"
},
"permissionRequestSuccess": {
"message": "Permission request succeeded!"
},
"permissionRequestFailed": {
"message": "Permission request failed, did you click deny?"
},
"adblockerIssueWhitelist": {
"message": "If you are unable to resolve this, then disable the setting 'Force Channel Check Before Skipping', as SponsorBlock is unable to retrieve the channel information for this video"
},
"itCouldBeAdblockerIssue": {
"message": "If this keeps occuring, it could be caused by your ad blocker. Please check https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"

View File

@@ -41,7 +41,7 @@
"message": "Ladataan..."
},
"Hide": {
"message": "Älä näytä koskaan"
"message": "Älä Näytä Koskaan"
},
"hitGoBack": {
"message": "Paina 'älä ohita' mennäksesi takaisin kohtaan jossa olit."
@@ -104,7 +104,7 @@
"message": "Avaa SponsorBlock-ponnahdusikkuna"
},
"closePopup": {
"message": "Sulje Ponnahdus-ikkuna"
"message": "Sulje Ponnahdusikkuna"
},
"SubmitTimes": {
"message": "Lähetä Segmentit"
@@ -165,7 +165,7 @@
"message": "Asetukset"
},
"showButtons": {
"message": "Näytä painikkeet YouTuben soittimessa"
"message": "Näytä Painikkeet YouTuben Soittimessa"
},
"hideButtons": {
"message": "Piilota painikkeet YouTuben soittimessa"
@@ -174,7 +174,7 @@
"message": "Tämä piilottaa YouTuben soittimessa näkyvät, ohitettavien aikojen lähettämiseen käytetyt painikkeet."
},
"showInfoButton": {
"message": "Näytä info-painike YouTuben soittimessa"
"message": "Näytä Info-Painike YouTuben Soittimessa"
},
"hideInfoButton": {
"message": "Piilota info-painike YouTuben soittimessa"
@@ -186,7 +186,7 @@
"message": "Piilota poista-painike YouTuben soittimessa"
},
"showDeleteButton": {
"message": "Näytä poista-painike YouTuben soittimessa"
"message": "Näytä Poista-Painike YouTuben Soittimessa"
},
"whatDeleteButton": {
"message": "Tämä on YouTuben soittimen painike, joka poistaa kaikki kyseisen videon sponsorointikohdat, joita et ole vielä lähettänyt."
@@ -229,7 +229,7 @@
"description": "The first line of the message displayed after the notice was upgraded."
},
"noticeUpdate2": {
"message": "Jos et vieläkään pidä siitä, paina \"älä koskaan näytä\" -painiketta.",
"message": "Jos et vieläkään pidä siitä, paina \"älä näytä koskaan\" -painiketta.",
"description": "The second line of the message displayed after the notice was upgraded."
},
"setSkipShortcut": {
@@ -408,7 +408,7 @@
"message": "Oletko varma, että haluat nollata tämän?"
},
"confirmPrivacy": {
"message": "Video on havaittu piilotetuksi. Paina peruuta jos et halua tarkistaa ohitettavia segmenttejä."
"message": "Video on havaittu piilotetuksi. Paina peruuta, jos et halua tarkistaa ohitettavia segmenttejä."
},
"unlistedCheck": {
"message": "Ohita Piilotetut/Yksityiset Videot"
@@ -511,10 +511,10 @@
"message": "Maksamaton/Itsensä Mainostus"
},
"category_selfpromo_description": {
"message": "Samankaltainen \"sponsorin\" kanssa paitsi maksamaton tai itsensä mainostus. Tämä sisältää osioita kauppatavarasta, lahjoituksista tai tietoa siitä, kenen kanssa he ovat tehneet yhteistyötä."
"message": "Samankaltainen \"sponsorin\" kanssa, mutta maksamattomalle tai itsensä mainostukselle. Tämä sisältää osioita kauppatavarasta, lahjoituksista tai tietoa siitä, kenen kanssa he ovat tehneet yhteistyötä."
},
"category_music_offtopic": {
"message": "Musiikki: muussa kuin Musiikki-osiossa"
"message": "Musiikki: Ei-Musiikki-Osio"
},
"category_music_offtopic_description": {
"message": "Vain käytettävissä musiikkivideoissa. Tätä tulee käyttää vain musiikkivideoiden osissa, jotka eivät jo kuulu toiseen kategoriaan."

View File

@@ -138,7 +138,7 @@
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
"message": "Astuce: Vous pouvez configurer des raccourcis clavier dans les options"
"message": "Astuce : vous pouvez configurer des raccourcis clavier dans les options"
},
"clearTimesButton": {
"message": "Supprimer les temps"
@@ -291,7 +291,7 @@
"message": "Afficher le temps avec les passages supprimés"
},
"showTimeWithSkipsDescription": {
"message": "Ce temps apparaît entre crochets à côté du temps actuel sous la barre de défilement. Cela indique la durée totale de la vidéo après déduction de tout les segments. Ceci comprend les segments marqués comme étant uniquement à \"Afficher dans la barre de recherche\"."
"message": "Ce temps apparaît entre crochets à côté du temps actuel sous la barre de défilement. Cela indique la durée totale de la vidéo après déduction de tous les segments. Ceci comprend les segments marqués comme étant uniquement à \"Afficher dans la barre de recherche\"."
},
"youHaveSkipped": {
"message": "Vous avez passé "
@@ -324,7 +324,7 @@
"message": "Importer/Exporter Votre ID d'Utilisateur"
},
"whatChangeUserID": {
"message": "Gardez ça privé. C'est comme un mot de passe et ne devrait pas être partagé avec quiconque. Si quelqu'un l'obtiens, il peut vous usurper."
"message": "Cette information doit rester confidentielle. C'est comme un mot de passe et ne devrait pas être partagé avec quiconque. Si quelqu'un l'obtient, il pourra se faire passer pour vous."
},
"setUserID": {
"message": "Définir \"UserID\""
@@ -514,7 +514,10 @@
"message": "Semblable au \"sponsor\", excepté pour la promotion non rémunérée ou l'auto-promotion. Cela inclut les marchandises, les dons et les informations sur leurs collaborateurs."
},
"category_music_offtopic": {
"message": "Musique : Segment non-musical"
"message": "Musique : Segment non musical"
},
"category_music_offtopic_description": {
"message": "A utiliser seulement pour les vidéos de musiques. Ceci ne devrait qu'être utilisé que pour des morceaux de vidéos de musiques qui ne sont pas couvert par d'autres catégories."
},
"category_music_offtopic_short": {
"message": "Hors musique"
@@ -591,6 +594,9 @@
"adblockerIssue": {
"message": "Il semble que quelque chose empêche SponsorBlock de récupérer les données de la vidéo. C'est probablement votre bloqueur de publicités. Veuillez consulter https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},
"adblockerIssueUnlistedVideosInfo": {
"message": "Si vous ne pouvez pas résoudre ça, désactivé le paramètre 'Ignorer vidéos privées ou pas listées\", car SponsorBlock ne peux pas trouver cette vidéo"
},
"itCouldBeAdblockerIssue": {
"message": "Si ça se reproduit, c'est peut-être causé par votre bloqueur de publicités. Veuillez consulter https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},

View File

@@ -295,6 +295,9 @@
"hoursLower": {
"message": "óra"
},
"youHaveSavedTimeEnd": {
"message": " az életükből"
},
"statusReminder": {
"message": "A szerver állapotához tekintse meg a status.sponsor.ajay.app oldalt."
},

View File

@@ -80,7 +80,7 @@
"message": "Segmen Berakhir Sekarang"
},
"noVideoID": {
"message": "Video YouTube tidak ditemukan.\nJika hal ini salah, refresh tab."
"message": "Video YouTube tidak ditemukan.\nJika terjadi kesalahan, silahkan ulangin halaman."
},
"success": {
"message": "Sukses!"
@@ -113,10 +113,10 @@
"message": "Apakah anda yakin ingin mengirim ini?"
},
"whitelistChannel": {
"message": "Daftar putih channel"
"message": "Daftar kanal putih"
},
"removeFromWhitelist": {
"message": "Hapus channel dari daftar putih"
"message": "Hapus kanal dari daftar putih"
},
"voteOnTime": {
"message": "Beri Segmen Vote"
@@ -294,7 +294,7 @@
"message": "Waktu ini muncul di dalam kurung disamping waktu asli di bilah waktu. Ini menunjukkan durasi total video yang tidak termasuk segmen apapun. Ini termasuk segmen yang ditandai hanya \"Tampilkan Di Bilah Waktu\"."
},
"youHaveSkipped": {
"message": "Anda telah melewatkan "
"message": "Anda sudah melewati "
},
"youHaveSaved": {
"message": "Anda sudah menghemat waktu "
@@ -312,10 +312,10 @@
"message": "jam"
},
"youHaveSavedTime": {
"message": "Anda telah menyelamatkan orang"
"message": "Anda sudah menghemat waktu orang lain"
},
"youHaveSavedTimeEnd": {
"message": " dalam hidup mereka"
"message": " dari hidup mereka"
},
"statusReminder": {
"message": "Cek status.sponsor.ajay.app untuk status server."

View File

@@ -80,7 +80,7 @@
"message": "Il Segmento Termina Ora"
},
"noVideoID": {
"message": "Nessun video YouTube trovato.\nSe questo non è corretto, ricarica la scheda."
"message": "Nessun video YouTube trovato.\nSe è un errore, ricarica la scheda."
},
"success": {
"message": "Successo!"
@@ -112,14 +112,20 @@
"submitCheck": {
"message": "Sei sicuro di volerlo inviare?"
},
"whitelistChannel": {
"message": "Aggiungi il canale alle eccezioni"
},
"removeFromWhitelist": {
"message": "Rimuovi il canale dalle eccezioni"
},
"voteOnTime": {
"message": "Vota un Segmento"
},
"Submissions": {
"message": "Iscrizioni"
"message": "Contributi"
},
"savedPeopleFrom": {
"message": "Hai salvato le persone da "
"message": "Hai fatto risparmiare in totale "
},
"viewLeaderboard": {
"message": "Classifica"
@@ -128,11 +134,11 @@
"message": "Invia"
},
"submissionEditHint": {
"message": "La modifica della sezione comparirà dopo aver cliccato Iscriviti",
"message": "La modifica della sezione comparirà dopo che hai cliccato su Inviare",
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
"message": "Suggerimento: Puoi configurare combinazioni di tasti per l'inserimento nelle opzioni"
"message": "Suggerimento: Puoi configurare dei comandi rapidi per l'inserimento nelle opzioni"
},
"clearTimesButton": {
"message": "Cancella Minutaggi"
@@ -144,7 +150,7 @@
"message": "Viene utilizzato nelle pagine delle statistiche pubbliche che mostrano quanto hai contribuito. Vedi"
},
"Username": {
"message": "Nome Utente"
"message": "Nome utente"
},
"setUsername": {
"message": "Imposta Username"
@@ -226,6 +232,9 @@
"message": "Se non ti piace ancora, premi il pulsante \"non mostrare mai\".",
"description": "The second line of the message displayed after the notice was upgraded."
},
"setSkipShortcut": {
"message": "Imposta un tasto per saltare un segmento"
},
"setStartSponsorShortcut": {
"message": "Imposta chiave di associazione per l'inizio del segmento"
},
@@ -242,10 +251,10 @@
"message": "Timeout della connessione. Controlla la tua connessione a Internet. Se internet sta funzionando, il server è probabilmente sovraccarico oppure giù."
},
"disableSkipping": {
"message": "Salta abilitato"
"message": "Saltare è abilitato"
},
"enableSkipping": {
"message": "Salta disabilitato"
"message": "Saltare è disabilitato"
},
"yourWork": {
"message": "Il Tuo Lavoro",
@@ -303,7 +312,7 @@
"message": "ore"
},
"youHaveSavedTime": {
"message": "Hai salvato le persone"
"message": "Hai salvato alle persone"
},
"youHaveSavedTimeEnd": {
"message": " delle loro vite"
@@ -507,6 +516,9 @@
"category_music_offtopic": {
"message": "Musica: Sezione Non-Musicale"
},
"category_music_offtopic_description": {
"message": "Solo per video musicali. Dovrebbe essere usata solo per sezioni di video musicali non già comprese in un'altra categoria."
},
"category_music_offtopic_short": {
"message": "Non-Musicale"
},
@@ -560,6 +572,10 @@
"chooseACategory": {
"message": "Scegli una Categoria"
},
"enableThisCategoryFirst": {
"message": "Per inviare segmenti della categoria \"{0}\", è necessario abilitarlo nelle opzioni. Sarai reindirizzato alle opzioni.",
"description": "Used when submitting segments to only let them select a certain category if they have it enabled in the options."
},
"youMustSelectACategory": {
"message": "Devi selezionare una categoria per tutti i segmenti che stai inviando!"
},
@@ -578,6 +594,9 @@
"adblockerIssue": {
"message": "Sembra che qualcosa stia bloccando la capacità di SponsorBlock di ottenere dati video. Questo probabilmente è il tuo ad blocker. Controlla https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},
"adblockerIssueUnlistedVideosInfo": {
"message": "Se non riesci a risolvere questo problema, disabilita l'impostazione 'Ignora video non elencati/privati', poiché SponsorBlock non è in grado di recuperare le informazioni di visibilità di questo video"
},
"itCouldBeAdblockerIssue": {
"message": "Se questo continua a verificarsi, potrebbe essere causato dal tuo ad-blocker. Controlla https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},

View File

@@ -3,6 +3,19 @@
"message": "SponserBlock for YouTube - 動画のスポンサーセクションを自動でスキップする",
"description": "Name of the extension."
},
"Description": {
"message": "YouTube動画の提供表示や登録要求をスキップします。視聴している動画の当該部分を報告してみんなが時間を節約できるようにしましょう。",
"description": "Description of the extension."
},
"400": {
"message": "サーバーがこのリクエストは無効であると返答しました"
},
"429": {
"message": "一つの動画に対してあまりに多くのセグメントを提出しています。本当にこれだけ必要ですか?"
},
"409": {
"message": "これは既に提出されています。"
},
"channelWhitelisted": {
"message": "チャンネルをホワイトリストに登録しました!"
},
@@ -12,9 +25,15 @@
"Segments": {
"message": "セグメント"
},
"upvoteButtonInfo": {
"message": "この提案を支持する"
},
"reportButtonTitle": {
"message": "報告"
},
"reportButtonInfo": {
"message": "この提案が正しくないことを報告する。"
},
"Dismiss": {
"message": "無視"
},
@@ -24,11 +43,44 @@
"Hide": {
"message": "非表示"
},
"hitGoBack": {
"message": "元の場所に戻るには「スキップを取り消す」をクリックしてください。"
},
"unskip": {
"message": "スキップしない"
"message": "スキップを取り消す"
},
"reskip": {
"message": "再スキップ"
},
"paused": {
"message": "一時停止"
"message": "一時停止"
},
"manualPaused": {
"message": "タイマーが停止しました"
},
"confirmMSG": {
"message": "個々の値を編集・削除するには、情報ボタンをクリックするか右上隅にある拡張機能のアイコンをクリックして拡張機能のポップアップを表示します。"
},
"clearThis": {
"message": "本当に消去しますか?\n\n"
},
"Unknown": {
"message": "スポンサー表示の投稿中にエラーが発生しました。しばらく経ってからもう一度お試しください。"
},
"sponsorFound": {
"message": "この動画用のセグメントはデータベースに登録されています!"
},
"sponsor404": {
"message": "セグメントが見つかりませんでした"
},
"sponsorStart": {
"message": "セグメントが始まりました"
},
"sponsorEnd": {
"message": "セグメントが終わりました"
},
"noVideoID": {
"message": "YouTube動画が見つかりませんでした。\nこれが正しくない場合は、タブを再読み込みしてください。"
},
"success": {
"message": "成功しました!"
@@ -36,30 +88,76 @@
"voted": {
"message": "投票しました!"
},
"serverDown": {
"message": "サーバーがダウンしているようです。今すぐ開発者にお知らせください。"
},
"connectionError": {
"message": "接続エラーが発生しました。エラーコード: "
},
"wantToSubmit": {
"message": "次の動画IDで提出します:"
},
"clearTimes": {
"message": "セグメントをクリア"
},
"openPopup": {
"message": "SponsorBlock のポップアップを開く"
},
"closePopup": {
"message": "ポップアップを閉じる"
},
"SubmitTimes": {
"message": "セグメントを提出"
},
"submitCheck": {
"message": "本当に提出してよろしいですか?"
},
"whitelistChannel": {
"message": "ホワイトリストのチャンネル"
},
"removeFromWhitelist": {
"message": "ホワイトリストからチャンネルを削除"
},
"voteOnTime": {
"message": "セグメントに投票"
},
"Submissions": {
"message": "提出数"
},
"savedPeopleFrom": {
"message": "次のセグメント数から人々を救いました: "
},
"viewLeaderboard": {
"message": "リーダーボード"
},
"recordTimesDescription": {
"message": "送信"
},
"submissionEditHint": {
"message": "提出をクリックするとセクション編集画面が表示されます",
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
"message": "ヒント: オプションから提出時のキーバインドを設定できます"
},
"clearTimesButton": {
"message": "時間をクリア"
},
"submitTimesButton": {
"message": "時間を提出"
},
"publicStats": {
"message": "これは公開の統計ページであなたがどれだけ貢献したかを示すために使用され、ここで確認することができます: "
},
"Username": {
"message": "ユーザー名"
},
"setUsername": {
"message": "ユーザー名を設定"
},
"discordAdvert": {
"message": "公式Discordサーバーに参加して意見やフィードバックをお寄せください"
},
"hideThis": {
"message": "非表示にする"
},
@@ -72,12 +170,52 @@
"hideButtons": {
"message": "YouTube プレイヤーにボタンを表示しない"
},
"hideButtonsDescription": {
"message": "これを有効にするとYouTubeプレーヤーのセグメント提出ボタンが非表示になります。"
},
"showInfoButton": {
"message": "YouTubeプレーヤーの情報ボタンを表示する"
},
"hideInfoButton": {
"message": "YouTubeプレーヤーの情報ボタンを隠す"
},
"whatInfoButton": {
"message": "これはYouTubeのページ上でポップアップを開くためのボタンです。"
},
"hideDeleteButton": {
"message": "YouTube プレイヤーから削除ボタンを隠す"
},
"showDeleteButton": {
"message": "YouTube プレイヤーから削除ボタンを表示する"
},
"whatDeleteButton": {
"message": "これはYouTubeプレーヤー上のボタンで、現在の動画から未提出のセグメントを全て消去します。"
},
"enableViewTracking": {
"message": "スキップ回数の統計を有効にする"
},
"whatViewTracking": {
"message": "この機能は、あなたがスキップしたセグメントを追跡して、そのセグメントがどれだけ役に立ったかを他のユーザーに知らせることで、スパムがデータベースに紛れないようにするための評価基準として使用されます。あなたがセグメントをスキップするたびに、拡張機能はサーバーにメッセージを送信します。使用回数の統計が正確になるよう、できる限り多くの人がこの設定を変更しないことを望みます。:)"
},
"enableQueryByHashPrefix": {
"message": "ハッシュプレフィックスを使って要求"
},
"whatQueryByHashPrefix": {
"message": "動画IDを使用してサーバーからセグメントを要求する代わりに、動画IDのハッシュから最初の4文字が送信されます。それに対して、サーバーは類似したハッシュを持つすべての動画のデータを返却します。"
},
"enableRefetchWhenNotFound": {
"message": "新しい動画ではセグメントを再取得する"
},
"whatRefetchWhenNotFound": {
"message": "動画がまだ新しくセグメントが見つからない場合は、動画を視聴している間、数分おきにセグメントを検索し続けます。"
},
"showNotice": {
"message": "再度通知を表示する"
},
"longDescription": {
"message": "SponsorBlockはスポンサー、イントロ、アウトロ、チャンネル登録のお願いなど、YouTube動画の煩わしい部分をスキップします。SponsorBlockはYouTube動画のスポンサー付きセグメントなどの開始時間と終了時間を誰でも投稿できる、クラウドソースのブラウザ拡張機能です。一人がセグメントの情報を送信すると、この拡張機能を使用している他の全員が、スポンサー付きセグメントをスキップできるようになります。また、ミュージックビデオの音楽がない部分をスキップすることもできます。",
"description": "Full description of the extension on the store pages."
},
"website": {
"message": "ウェブサイト",
"description": "Used on Firefox Store Page"
@@ -86,6 +224,45 @@
"message": "ソースコード",
"description": "Used on Firefox Store Page"
},
"noticeUpdate": {
"message": "通知がアップグレードされました!",
"description": "The first line of the message displayed after the notice was upgraded."
},
"noticeUpdate2": {
"message": "もしそれでも気に入らない場合は、非表示ボタンをクリックしてください。",
"description": "The second line of the message displayed after the notice was upgraded."
},
"setSkipShortcut": {
"message": "セグメントをスキップするキーを設定"
},
"setStartSponsorShortcut": {
"message": "セグメントを開始するキーを設定"
},
"setSubmitKeybind": {
"message": "投稿するキーを設定"
},
"keybindDescription": {
"message": "キーを入力して設定します"
},
"keybindDescriptionComplete": {
"message": "キーバインドを次の通り設定しました: "
},
"0": {
"message": "接続がタイムアウトになりました。インターネット接続をご確認ください。接続に問題がない場合、サーバーが混雑またはダウンしている可能性があります。"
},
"disableSkipping": {
"message": "スキップは有効です"
},
"enableSkipping": {
"message": "スキップは無効です"
},
"yourWork": {
"message": "あなたの貢献",
"description": "Used to describe the section that will show you the statistics from your submissions."
},
"502": {
"message": "サーバーが混雑中です。数秒後にもう一度お試しください。"
},
"errorCode": {
"message": "エラーコード: "
},
@@ -107,8 +284,17 @@
"audioNotification": {
"message": "オーディオ通知をスキップ"
},
"audioNotificationDescription": {
"message": "スキップ時の音声通知は、セグメントがスキップされる毎に音を鳴らす機能です。無効 (または自動スキップが無効) の場合、音は再生されません。"
},
"showTimeWithSkips": {
"message": "スキップした分を除いた時間を表示する"
},
"showTimeWithSkipsDescription": {
"message": "この時間は、シークバーの下にある現在の時間の隣に表示されます。これは、動画の合計時間からすべてのセグメントの時間を差し引いたもので「シークバーに表示」として設定されているセグメントも含まれます。"
},
"youHaveSkipped": {
"message": "スキップしました "
"message": "スキップしたセグメント数: "
},
"minLower": {
"message": "分"

View File

@@ -79,6 +79,9 @@
"sponsorEnd": {
"message": "Koniec segmentu"
},
"sponsorCancel": {
"message": "Anuluj tworzenie segmentu"
},
"noVideoID": {
"message": "Nie znaleziono filmu YouTube.\nJeżeli to błąd, odśwież stronę."
},
@@ -95,7 +98,7 @@
"message": "Wystąpił błąd połączenia. Kod błędu: "
},
"wantToSubmit": {
"message": "Czy chcesz wysłać dla video o id"
"message": "Czy chcesz wysłać dla filmu o id"
},
"clearTimes": {
"message": "Wyczyść segmenty"
@@ -131,10 +134,10 @@
"message": "Ranking"
},
"recordTimesDescription": {
"message": "Prześlij"
"message": "Wyślij"
},
"submissionEditHint": {
"message": "Edycja sekcji pojawi się po kliknięciu „Wyślij”",
"message": "Edycja sekcji pojawi się po wciśnięciu „Wyślij”",
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
@@ -517,7 +520,7 @@
"message": "Muzyka: Sekcja niemuzyczna"
},
"category_music_offtopic_description": {
"message": "Do użytku tylko na filmach muzycznych. Powinno to być używane jedynie do tych sekcji filmów muzycznych, które nie są uwzględnione w innej kategorii."
"message": "Do użytku jedynie w filmach muzycznych. Powinno to być używane jedynie do tych sekcji filmów muzycznych, które nie są uwzględnione w innej kategorii."
},
"category_music_offtopic_short": {
"message": "Bez muzyki"

View File

@@ -56,7 +56,7 @@
"message": "Pausado"
},
"manualPaused": {
"message": "Tempo parado"
"message": "Temporizador parado"
},
"confirmMSG": {
"message": "\n\nPara editar ou remover linhas individuais, clique com o botão direito ou abra o popup da extensão pelo icone no canto superior direito."
@@ -125,7 +125,7 @@
"message": "Envios"
},
"savedPeopleFrom": {
"message": "Você salvou pessoas de "
"message": "Poupaste a outros de "
},
"viewLeaderboard": {
"message": "Placar de classificação"
@@ -147,7 +147,7 @@
"message": "Enviar Intervalos"
},
"publicStats": {
"message": "Isso é usado na página pública de estatísticas que mostra o quanto você já contríbuíu. Veja-a"
"message": "Isso é usado na página pública de estatísticas que mostra o quanto você já contribuiu. Veja-a"
},
"Username": {
"message": "Nome de usuário"
@@ -171,7 +171,7 @@
"message": "Esconder botões no player do Youtube"
},
"hideButtonsDescription": {
"message": "Isto esconde os botões que aparecem no player do Youtube para submeter patrocínios. Entendemos que possa ser\n incómodo a algumas pessoas. Em vez de usar esses botões pode usar os do popup. Para esconder a mensagem que aparece, \n ususe o botão na mesma que diz \"Don't show this again\". Pode sempre reactivar estas definições novamente."
"message": "Esta opção esconde os botões que aparecem para enviar segmentos no player do YouTube."
},
"showInfoButton": {
"message": "Mostrar botão de Informações no player do Youtube"
@@ -315,7 +315,7 @@
"message": "Você poupou das pessoas"
},
"youHaveSavedTimeEnd": {
"message": " de suas vidas"
"message": " das vidas dos outros"
},
"statusReminder": {
"message": "Verifique status.sponsor.ajay.app para o status do servidor."
@@ -423,13 +423,13 @@
"message": "Importar/Exportar Todas as Opções"
},
"whatExportOptions": {
"message": "Essa suas preferências em JSON. Isso inclui seu ID de usuário, então lembre-se de compartilhar com cuidado."
"message": "Essas são suas preferências no formato JSON. Isso inclui seu ID de usuário, então lembre-se de compartilhar com cuidado."
},
"setOptions": {
"message": "Definir Opções"
},
"exportOptionsWarning": {
"message": "Aviso: Alterar as opções é permanente e pode fazer a extensão parar de funcionar. Tem certeza que deseja fazer isso? Certifique-se de fazer um backup de seu antigo por precaução."
"message": "Aviso: Alterar as opções é permanente e pode fazer a extensão parar de funcionar. Tem certeza que deseja fazer isso? Certifique-se de fazer um backup por precaução."
},
"incorrectlyFormattedOptions": {
"message": "Este JSON não está formatado corretamente. Suas opções não foram alteradas."
@@ -487,7 +487,7 @@
"message": "Intervalo/Animação de Introdução"
},
"category_intro_description": {
"message": "Um intervalo sem conteúdo real. Pode ser um quadro em pausa, um frame estático, repetindo animação. Isso não deve ser usado para transições que contenham informação."
"message": "Um intervalo sem conteúdo real. Pode ser uma pausa, um quadro estático, uma animação repetitiva. Isso não deve ser usado em transições que contenham informação."
},
"category_intro_short": {
"message": "Intervalo"
@@ -502,7 +502,7 @@
"message": "Lembrete de interação (inscrever-se)"
},
"category_interaction_description": {
"message": "Quando houver um pequeno lembrete para curtir, inscreva-se ou segui-los no meio do conteúdo. Se é longo ou sobre algo específico, deveria ser sob auto-promoção."
"message": "Quando houver um pequeno lembrete para curtir, inscrever-se ou segui-los no meio do conteúdo. Se é longo ou sobre algo específico, deveria ser sob Não-pago/Auto promoção."
},
"category_interaction_short": {
"message": "Lembrete de interação"
@@ -511,7 +511,7 @@
"message": "Não-pago/Auto promoção"
},
"category_selfpromo_description": {
"message": "Similar a \"patrocinador\", exceto para auto promoções e não-pagas. Isto inclui seções sobre vendas, doações ou informações sobre com quem colaboraram."
"message": "Similar a \"patrocinador\", mas para auto promoções e segmentos não-pagos. Isto inclui seções sobre vendas, doações ou informações sobre com quem colaboraram."
},
"category_music_offtopic": {
"message": "Música: Seção sem música"
@@ -541,7 +541,7 @@
"message": "Sua cor está formatada incorretamente. Deve ser um código hexadecimal de 3 ou 6 dígitos com uma tralha / hashtag no início."
},
"previewColor": {
"message": "Cor de pré-visualização",
"message": "Pré-visualizar cor",
"description": "Referring to submissions that have not been sent to the server yet."
},
"seekBarColor": {
@@ -610,7 +610,7 @@
"message": "Considere ativar a 'forçar verificação de canal antes de pular\""
},
"downvoteDescription": {
"message": "Incorreto/tempo errado"
"message": "Tempo errado ou incorreto"
},
"incorrectCategory": {
"message": "Categoria errada"
@@ -619,7 +619,7 @@
"message": "Este vídeo é categorizado como música. Tem certeza que isto tem um patrocinador? Se este é realmente um \"segmento não musical\", abra as opções da extensão e habilite esta categoria. Assim você pode enviar este segmento como \"não-musical\" ao invés de patrocinador. Por favor leia as diretrizes se estiver confuso."
},
"multipleSegments": {
"message": "Multiplos segmentos"
"message": "Múltiplos segmentos"
},
"guidelines": {
"message": "Diretrizes"

View File

@@ -4,7 +4,7 @@
"description": "Name of the extension."
},
"Description": {
"message": "Пропускайте спонсорские вставки, просьбы подписаться и другое в видео на YouTube. Отправляйте информацию о спонсорах в видео, чтобы сохранять другим время.",
"message": "Пропускайте спонсорские вставки, просьбы подписаться и другое в видео на YouTube. Отправляйте информацию о спонсорах в видео, чтобы экономить другим время.",
"description": "Description of the extension."
},
"400": {

View File

@@ -17,7 +17,7 @@
"message": "Den här har redan blivit rapporterad"
},
"channelWhitelisted": {
"message": "Kanal vitlistad!"
"message": "Kanalen är vitlistad!"
},
"Segment": {
"message": "segment"
@@ -41,16 +41,16 @@
"message": "Laddar..."
},
"Hide": {
"message": "Visa Aldrig"
"message": "Visa aldrig"
},
"hitGoBack": {
"message": "Tryck på Tillbaka för att ångra åtgärden."
},
"unskip": {
"message": "Tillbaka"
"message": "Hoppa inte över"
},
"reskip": {
"message": "Framåt"
"message": "Hoppa över"
},
"paused": {
"message": "Pausad"
@@ -83,7 +83,7 @@
"message": "Hittade ingen YouTube-video.\nUppdatera fliken om detta är felaktigt."
},
"success": {
"message": "Lyckades!"
"message": "Klart!"
},
"voted": {
"message": "Röstat!"
@@ -137,8 +137,11 @@
"message": "Sektionsredigering kommer att visas efter du har klickat på skicka",
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
"message": "Tips: Du kan ställa in snabbtangenter för de olika inskickningsalternativen"
},
"clearTimesButton": {
"message": "Rensa Tider"
"message": "Rensa tider"
},
"submitTimesButton": {
"message": "Rapportera Tider"
@@ -197,6 +200,9 @@
"enableQueryByHashPrefix": {
"message": "Fråga efter hash-prefix"
},
"whatQueryByHashPrefix": {
"message": "I stället för att begära segment från servern med hjälp av video-ID skickas de första 4 tecknen i hashen av video-ID:et. Servern kommer då att skicka tillbaka data för alla videor med liknande hashar."
},
"enableRefetchWhenNotFound": {
"message": "Uppdatera segment på nya videor"
},
@@ -230,13 +236,13 @@
"message": "Ställ in knapp för att hoppa över ett segment"
},
"setStartSponsorShortcut": {
"message": "Ange den tangent som ska fungera som starttangent för ett segment"
"message": "Ange den tangent som ska fungera som snabbstartstangent för ett segment"
},
"setSubmitKeybind": {
"message": "Välj knapp att koppla till rapportering av sponsormeddelande"
},
"keybindDescription": {
"message": "Koppla knapp genom att trycka på den"
"message": "Ange tangent genom att trycka på den"
},
"keybindDescriptionComplete": {
"message": "Kopplad till: "
@@ -345,7 +351,7 @@
"message": "Invidious (invidio.us) är en tredjeparts YouTube-klient. För att aktivera stöd måste du acceptera de extra behörigheterna. Detta kommer INTE att fungera i incognito i Chrome och andra Cromium-varianter."
},
"optionsInfo": {
"message": "Aktivera Invidious stöd, avaktivera hoppa över automatiskt, dölj knappar och mer."
"message": "Aktivera Invidious stöd, inaktivera hoppa över automatiskt, dölj knappar och mer."
},
"addInvidiousInstance": {
"message": "Lägg Till Invidious Instans"
@@ -405,7 +411,7 @@
"message": "Den här videon verkar vara olistad. Klicka på avbryt om du inte vill söka efter överhoppade segment."
},
"unlistedCheck": {
"message": "Ignorera Olistade Videor"
"message": "Ignorera olistade/privata videor"
},
"whatUnlistedCheck": {
"message": "Den här inställningen kommer att slöa ner SponsorBlock. Segmentöverhoppssökningar kräver att video-ID skickas till servern. Om du är orolig över att olistade video-ID:s skickas över internet, aktivera då detta alternativ."
@@ -474,15 +480,24 @@
"category_sponsor": {
"message": "Sponsormeddelande"
},
"category_sponsor_description": {
"message": "Betald marknadsföring, betalda hänvisningar och direktannonser, men inte till egen marknadsföring eller gratis shoutouts till skapare/webbplatser/produkter de gillar."
},
"category_intro": {
"message": "Paus/Introduktion"
},
"category_intro_description": {
"message": "Ett intervall utan faktiskt innehåll. Kan vara en paus, statisk ram, upprepande animation. Denna bör inte användas för övergångar som innehåller information."
},
"category_intro_short": {
"message": "Uppehåll"
},
"category_outro": {
"message": "Slutkort/Credits"
},
"category_outro_description": {
"message": "Credits eller när YouTube-slutkort visas. Inte för slut med information."
},
"category_interaction": {
"message": "Interaktionspåminnelse (Prenumerera)"
},
@@ -495,9 +510,15 @@
"category_selfpromo": {
"message": "Obetald/självbefodran"
},
"category_selfpromo_description": {
"message": "Som \"sponsormeddelande\" men med undantag för obetald eller självkampanj. Detta inkluderar avsnitt om varor, donationer eller information om vem de samarbetade med."
},
"category_music_offtopic": {
"message": "Musik: Icke-musikavsnitt"
},
"category_music_offtopic_description": {
"message": "Ska endast användas i musikvideor. Denna ska endast användas för delar av musikvideor som inte redan omfattas av en annan kategori."
},
"category_music_offtopic_short": {
"message": "Icke-musik"
},
@@ -508,7 +529,7 @@
"message": "Läser meddelande"
},
"disable": {
"message": "Avaktivera"
"message": "Inaktivera"
},
"manualSkip": {
"message": "Hoppa Över Manuellt"
@@ -573,6 +594,9 @@
"adblockerIssue": {
"message": "Det verkar som om något blockerar SponsorBlocks från att hämta videodata. Det beror förmodligen på din annonsblockerare. Vänligen kontrollera https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},
"adblockerIssueUnlistedVideosInfo": {
"message": "Om du inte kan lösa detta kan du inaktivera 'Ignorera olistade/privata videor' i inställningar, eftersom SponsorBlock inte kan hämta synlighetsinformationen för den här videon"
},
"itCouldBeAdblockerIssue": {
"message": "Om detta fortsätter att inträffa, kan orsaken vara din annonsblockerare. Vänligen kontrollera https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},
@@ -608,7 +632,7 @@
"message": "Kategorier finns här!"
},
"categoryUpdate2": {
"message": "Öppna inställningarna för att skippa intros, outros, merch, osv."
"message": "Öppna inställningarna för att hoppa över intros, outros, merch, osv."
},
"help": {
"message": "Hjälp"

View File

@@ -516,6 +516,9 @@
"category_music_offtopic": {
"message": "Müzik: Müzik Olmayan Bölüm"
},
"category_music_offtopic_description": {
"message": "Yalnızca müzik videolarında kullanım içindir. Bu yalnızca başka bir kategoriye katılmamış müzik videolarının parçaları için kullanılmalıdır."
},
"category_music_offtopic_short": {
"message": "Müzik Olmayan Bölüm"
},

View File

@@ -516,6 +516,9 @@
"category_music_offtopic": {
"message": "Музика: Сегмент без музики"
},
"category_music_offtopic_description": {
"message": "Тільки для використання в музичних кліпах. Використовується для сегментів музичних кліпів, які не належать до іншої категорії."
},
"category_music_offtopic_short": {
"message": "Без музики"
},

View File

@@ -42,12 +42,12 @@
<img src="https://i.imgur.com/caf5Bju.png">
</span>
Videos will automatically be skipped if they are found in the database. You can open the popup by clicking the extension icon to get a preview of what they are.
Video segments will automatically be skipped if they are found in the database. You can open the popup by clicking the extension icon to get a preview of what they are.
<br/>
<br/>
Whenever you skip a video, you will get a notice report that submission. If the timing seems wrong, report it! You can also vote in the popup. The extension auto upvotes it if you don't report it, so make sure to report when necessary (this can be disabled in the options).
Whenever you skip a segment, you will get notice. If the timing seems wrong vote down by clicking downvote! You can also vote in the popup.
</p>
<div class="center"><img height="120px" src="https://user-images.githubusercontent.com/12688112/63067735-5a638700-bede-11e9-8147-f321b57527ec.gif"></div>
@@ -81,8 +81,8 @@
<h1>This is too slow</h1>
<p>
There are hotkeys if you want to use them. You must be focused on the YouTube player to use them. Press the semicolon key to indicate the start/end of a sponsor segment and click the appostrophe to submit.
These can be changed in the options. If you don't use QWERTY, you should probably change the keybinds.
There are hotkeys if you want to use them. You must be focused on the YouTube player to use them. Press the semicolon key to indicate the start/end of a sponsor segment and click the apostrophe to submit.
These can be changed in the options. If you don't use QWERTY, you should probably change the keybinding.
</p>
<h1>I hate these buttons, they are so ugly</h1>
@@ -131,9 +131,9 @@
<p>The awesome <a href="https://github.com/omarroth/invidious/wiki/API">Invidious API</a> is used to grab the time the video was published.</p>
<p>Some icons made by <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></p>
<p>Some icons made by <a href="https://www.flaticon.com/authors/gregor-cresnar" title="Gregor Cresnar">Gregor Cresnar</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></p>
<p>Some icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></p>
<p>Some icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> and are licensed by <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></p>
<p style="text-align: center;"><a href="/oss-attribution/attribution.txt">Open Source Licenses</a></p>

View File

@@ -309,23 +309,6 @@
<br/>
<br/>
<div option-type="toggle" sync-option="hashPrefix">
<label class="switch-container" label-name="__MSG_enableQueryByHashPrefix__">
<label class="switch">
<input type="checkbox" checked>
<span class="slider round"></span>
</label>
</label>
<br/>
<br/>
<div class="small-description">__MSG_whatQueryByHashPrefix__</div>
</div>
<br/>
<br/>
<div option-type="toggle" sync-option="refetchWhenNotFound">
<label class="switch-container" label-name="__MSG_enableRefetchWhenNotFound__">
<label class="switch">
@@ -343,23 +326,6 @@
<br/>
<br/>
<div option-type="toggle" sync-option="checkForUnlistedVideos">
<label class="switch-container" label-name="__MSG_unlistedCheck__">
<label class="switch">
<input type="checkbox">
<span class="slider round"></span>
</label>
</label>
<br/>
<br/>
<div class="small-description">__MSG_whatUnlistedCheck__</div>
</div>
<br/>
<br/>
<div option-type="private-text-change" sync-option="userID" confirm-message="userIDChangeWarning">
<div class="option-button trigger-button">
__MSG_changeUserID__

View File

@@ -0,0 +1,28 @@
<!DOCTYPE html>
<head>
<title>Permissions - SponsorBlock</title>
<meta charset="utf-8">
<link href="styles.css" rel="stylesheet"/>
<script src="../js/vendor.js"></script>
<script src="../js/permissions.js"></script>
</head>
<body class="sponsorBlockPageBody">
<div id="title" class="titleBar">
<img src="../icons/LogoSponsorBlocker256px.png" height="80" class="profilepic"/>
SponsorBlock
</div>
<br/>
<div class="center">
<div id="acceptPermissionButton" class="option-button inline">
__MSG_acceptPermission__
</div>
</div>
</body>

View File

@@ -0,0 +1,356 @@
/* Options page CSS */
body {
font-family: sans-serif;
}
.center {
text-align: center;
}
.inline {
display: inline-block;
}
.bold {
font-weight: bold;
}
.hidden {
display: none !important;
}
.keybind-status {
display: inline;
}
.small-description {
color: white;
font-size: 13px;
}
.medium-description {
color: white;
font-size: 15px;
}
.option-text-box {
width: 300px;
}
.option-button {
cursor: pointer;
background-color: #c00000;
padding: 10px;
color: white;
border-radius: 5px;
font-size: 14px;
width: max-content;
}
.option-button:hover {
background-color: #fc0303;
}
.option-button.disabled {
cursor: default;
background-color: #520000;
color: grey;
}
#options {
max-width: 60%;
text-align: left;
display: inline-block;
}
.switch-container:after {
content: attr(label-name);
position: absolute;
padding: 4px;
width: max-content;
font-size: 14px;
color: white;
}
.text-label-container {
font-size: 14px;
color: white;
}
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #707070;
}
.animated * {
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
}
.animated .slider:before {
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #fc0303;
}
input:checked + .slider:before {
-webkit-transform: translateX(16px);
-ms-transform: translateX(16px);
transform: translateX(16px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
/* Boilerplate CSS from https://ajay.app */
body {
background-color: #333333;
}
.projectPreview {
position: relative;
}
.projectPreviewImage {
position: absolute;
left: -90px;
width: 80px;
top: 50%;
transform: translateY(-50%);
}
.projectPreviewImageLarge {
position: absolute;
left: -210px;
width: 200px;
top: 50%;
transform: translateY(-20%);
}
.projectPreviewImageLargeRight {
position: absolute;
right: -210px;
width: 200px;
top: 50%;
transform: translateY(-50%);
}
.createdBy {
font-size: 14px;
text-align: center;
padding-top: 0px;
padding-bottom: 0px;
display: inline-block;
}
#title {
background-color: #636363;
text-align: center;
vertical-align: middle;
font-size: 50px;
color: #212121;
padding: 20px;
text-decoration: none;
transition: font-size 1s;
}
.subtitle {
font-size: 40px;
color: #dad8d8;
padding-top: 10px;
transition: font-size 0.4s;
}
.subtitle:hover {
font-size: 45px;
transition: font-size 0.4s;
}
.profilepic {
background-color: #636363 !important;
vertical-align: middle;
}
.profilepiccircle {
vertical-align: middle;
overflow: hidden;
border-radius: 50%;
}
a {
text-decoration: underline;
color: inherit;
}
.link {
padding: 20px;
height: 80px;
transition: height 0.2s;
}
.link:hover {
height: 95px;
transition: height 0.2s;
}
#contact,.smalllink {
font-size: 25px;
color: #e8e8e8;
text-align: center;
padding: 10px;
}
#contact {
text-decoration: none;
}
p,li {
font-size: 20px;
color: #c4c4c4;
padding: 10px;
}
p,li,code,a {
max-width: 60%;
text-align: left;
overflow-wrap: break-word;
}
@media screen and (orientation:portrait) {
p,li,code,a {
max-width: 100%;
}
.projectPreviewImage {
position: unset;
width: 130px;
display: block;
margin: auto;
transform: none;
}
}
.previewImage {
max-height: 200px;
}
img {
max-width: 100%;
text-align: center;
}
#recentPostTitle {
font-size: 30px;
color: #dad8d8;
}
#recentPostDate {
font-size: 15px;
color: #dad8d8;
}
h1,h2,h3,h4,h5,h6 {
color: #dad8d8;
}
svg {
text-decoration: none;
}
.number-container:before {
content: attr(label-name);
padding-right: 4px;
width: max-content;
font-size: 14px;
color: white;
}
/* React styles */
.categoryTableElement {
font-size: 16px;
color: white;
}
.categoryTableElement > * {
padding-right: 15px;
padding-bottom: 15px;
}
.categoryOptionsSelector {
background-color: #c00000;
color: white;
border: none;
font-size: 14px;
padding: 5px;
border-radius: 5px;
}
.categoryColorTextBox {
width: 60px;
background: none;
border: none;
}

View File

@@ -71,7 +71,7 @@
</div>
<div id="submissionSection" style="display: none">
<b style="display: block; margin-top: 12px;">__MSG_submissionEditHint__</b>
<div id="submitTimesContainer" style="display: none; margin-top: 12px;">
<div id="submitTimesContainer" style="margin-top: 12px;">
<button id="submitTimes" class="mediumButton">__MSG_submitTimesButton__</button>
</div>
</div>

View File

@@ -37,6 +37,9 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
case "openHelp":
chrome.tabs.create({url: chrome.runtime.getURL('help/index_en.html')});
return;
case "openPage":
chrome.tabs.create({url: chrome.runtime.getURL(request.url)});
return;
case "sendRequest":
sendRequestToCustomServer(request.type, request.url, request.data).then(async (response) => {
callback({

View File

@@ -344,7 +344,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
//if it is not a complete sponsor time
if (sponsorTimes[index].segment.length < 2) {
//update video player
this.props.contentContainer().changeStartSponsorButton(true, false);
this.props.contentContainer().updateEditButtonsOnPlayer();
}
sponsorTimes.splice(index, 1);
@@ -359,7 +359,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
this.props.submissionNotice.cancel();
//update video player
this.props.contentContainer().changeStartSponsorButton(true, false);
this.props.contentContainer().updateEditButtonsOnPlayer();
} else {
//update display
this.props.submissionNotice.forceUpdate();

View File

@@ -6,6 +6,7 @@ const utils = new Utils();
interface SBConfig {
userID: string,
/** Contains unsubmitted segments that the user has created. */
segmentTimes: SBMap<string, SponsorTime[]>,
defaultCategory: string,
whitelistedChannels: string[],
@@ -34,8 +35,8 @@ interface SBConfig {
audioNotificationOnSkip,
checkForUnlistedVideos: boolean,
testingServer: boolean,
hashPrefix: boolean,
refetchWhenNotFound: boolean,
ytInfoPermissionGranted: boolean,
// What categories should be skipped
categorySelections: CategorySelection[],
@@ -167,8 +168,8 @@ const Config: SBObject = {
audioNotificationOnSkip: false,
checkForUnlistedVideos: false,
testingServer: false,
hashPrefix: true,
refetchWhenNotFound: true,
ytInfoPermissionGranted: false,
categorySelections: [{
name: "sponsor",

View File

@@ -1,6 +1,6 @@
import Config from "./config";
import { SponsorTime, CategorySkipOption, VideoID, SponsorHideType, FetchResponse, VideoInfo, StorageChangesObject } from "./types";
import { SponsorTime, IncompleteSponsorTime, CategorySkipOption, VideoID, SponsorHideType, FetchResponse, VideoInfo, StorageChangesObject } from "./types";
import { ContentContainer } from "./types";
import Utils from "./utils";
@@ -71,8 +71,11 @@ let channelWhitelisted = false;
// create preview bar
let previewBar: PreviewBar = null;
//the player controls on the YouTube player
let controls = null;
/** Element containing the player controls on the YouTube player. */
let controls: HTMLElement | null = null;
/** Contains buttons created by `createButton()`. */
const playerButtons: Record<string, {button: HTMLButtonElement, image: HTMLImageElement}> = {};
// Direct Links after the config is loaded
utils.wait(() => Config.config !== null, 1000, 1).then(() => videoIDChange(getYouTubeVideoID(document.URL)));
@@ -81,10 +84,10 @@ utils.wait(() => Config.config !== null, 1000, 1).then(() => videoIDChange(getYo
//this only happens if there is an error
let sponsorLookupRetries = 0;
//if showing the start sponsor button or the end sponsor button on the player
let showingStartSponsor = true;
/** Currently timed segment, which will be added to the unsubmitted segments when ready. */
let currentlyTimedSegment: IncompleteSponsorTime | null = null;
//the sponsor times being prepared to be submitted
/** Segments created by the user which have not yet been submitted. */
let sponsorTimesSubmitting: SponsorTime[] = [];
//becomes true when isInfoFound is called
@@ -111,12 +114,15 @@ const skipNoticeContentContainer: ContentContainer = () => ({
onMobileYouTube,
sponsorSubmissionNotice: submissionNotice,
resetSponsorSubmissionNotice,
changeStartSponsorButton,
updateEditButtonsOnPlayer,
previewTime,
videoInfo,
getRealCurrentTime: getRealCurrentTime
});
// value determining when to count segment as skipped and send telemetry to server (percent based)
const manualSkipPercentCount = 0.5;
//get messages from the background script and the popup
chrome.runtime.onMessage.addListener(messageListener);
@@ -127,11 +133,11 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
videoIDChange(getYouTubeVideoID(document.URL));
break;
case "sponsorStart":
sponsorMessageStarted(sendResponse);
startOrEndTimingNewSegment()
break;
case "sponsorDataChanged":
updateSponsorTimesSubmitting();
sendResponse({
creatingSegment: currentlyTimedSegment !== null,
});
break;
case "isInfoFound":
@@ -150,7 +156,8 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
break;
case "getVideoID":
sendResponse({
videoID: sponsorVideoID
videoID: sponsorVideoID,
creatingSegment: currentlyTimedSegment !== null,
});
break;
@@ -170,10 +177,6 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
channelWhitelisted = request.value;
sponsorsLookup(sponsorVideoID);
break;
case "changeStartSponsorButton":
changeStartSponsorButton(request.showStartSponsor, request.uploadButtonVisible);
break;
case "submitTimes":
submitSponsorTimes();
@@ -250,25 +253,25 @@ async function videoIDChange(id) {
// Wait for options to be ready
await utils.wait(() => Config.config !== null, 5000, 1);
// Get new video info
getVideoInfo();
// If enabled, it will check if this video is private or unlisted and double check with the user if the sponsors should be looked up
if (Config.config.checkForUnlistedVideos) {
try {
await utils.wait(() => !!videoInfo, 5000, 1);
} catch (err) {
alert(chrome.i18n.getMessage("adblockerIssue") + "\n\n" + chrome.i18n.getMessage("adblockerIssueUnlistedVideosInfo"));
}
if (isUnlisted()) {
const shouldContinue = confirm(chrome.i18n.getMessage("confirmPrivacy"));
if(!shouldContinue) return;
const shouldContinue = confirm("SponsorBlock: You have the setting 'Ignore Unlisted/Private Videos' enabled."
+ " Due to a change in how segment fetching works, this setting is not needed anymore as it cannot leak your video ID to the server."
+ " It instead sends just the first 4 characters of a longer hash of the videoID to the server, and filters through a subset of the database."
+ " More info about this implementation can be found here: https://github.com/ajayyy/SponsorBlockServer/issues/25"
+ "\n\nPlease click okay to confirm that you acknowledge this and continue using SponsorBlock.");
if (shouldContinue) {
Config.config.checkForUnlistedVideos = false;
} else {
return;
}
}
// Get new video info
getVideoInfo();
// Update whitelist data when the video data is loaded
utils.wait(() => !!videoInfo, 5000, 10).then(whitelistCheck);
whitelistCheck();
//setup the preview bar
if (previewBar === null) {
@@ -294,33 +297,21 @@ async function videoIDChange(id) {
//close popup
closeInfoMenu();
sponsorsLookup(id);
//make sure everything is properly added
updateVisibilityOfPlayerControlsButton().then(() => {
//see if the onvideo control image needs to be changed
const segments = Config.config.segmentTimes.get(sponsorVideoID);
if (segments != null && segments.length > 0 && segments[segments.length - 1].segment.length >= 2) {
changeStartSponsorButton(true, true);
} else if (segments != null && segments.length > 0 && segments[segments.length - 1].segment.length < 2) {
changeStartSponsorButton(false, true);
} else {
changeStartSponsorButton(true, false);
}
});
// Make sure all player buttons are properly added
updateVisibilityOfPlayerControlsButton();
//reset sponsor times submitting
// Clear unsubmitted segments from the previous video
sponsorTimesSubmitting = [];
currentlyTimedSegment = null;
updateSponsorTimesSubmitting();
//see if video controls buttons should be added
if (!onInvidious) {
updateVisibilityOfPlayerControlsButton();
}
}
function handleMobileControlsMutations(): void {
updateVisibilityOfPlayerControlsButton();
if (previewBar !== null) {
if (document.body.contains(previewBar.container)) {
const progressBarBackground = document.querySelector<HTMLElement>(".progress-bar-background");
@@ -573,33 +564,22 @@ async function sponsorsLookup(id: string) {
}
// Check for hashPrefix setting
let getRequest;
if (Config.config.hashPrefix) {
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
getRequest = utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
categories
});
} else {
getRequest = utils.asyncRequestToServer('GET', "/api/skipSegments", {
videoID: id,
categories
});
}
getRequest.then(async (response: FetchResponse) => {
const hashPrefix = (await utils.getHash(id, 1)).substr(0, 4);
utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
categories
}).then(async (response: FetchResponse) => {
if (response?.ok) {
let result = JSON.parse(response.responseText);
if (Config.config.hashPrefix) {
result = result.filter((video) => video.videoID === id);
if (result.length > 0) {
result = result[0].segments;
if (result.length === 0) { // return if no segments found
retryFetch(id);
return;
}
} else { // return if no video found
result = result.filter((video) => video.videoID === id);
if (result.length > 0) {
result = result[0].segments;
if (result.length === 0) { // return if no segments found
retryFetch(id);
return;
}
} else { // return if no video found
retryFetch(id);
return;
}
const recievedSegments: SponsorTime[] = result;
@@ -727,6 +707,21 @@ async function getVideoInfo(): Promise<void> {
}
}
async function videoInfoFetchFailed(errorMessage: string): Promise<void> {
console.log("failed\t" + errorMessage)
if (utils.isFirefox() && !Config.config.ytInfoPermissionGranted) {
// Attempt to ask permission for youtube.com domain
alert(chrome.i18n.getMessage("youtubePermissionRequest"));
chrome.runtime.sendMessage({
message: "openPage",
url: "permissions/index.html#youtube.com"
});
} else {
alert(chrome.i18n.getMessage("videoInfoFetchFailed") + "\n\n" + chrome.i18n.getMessage(errorMessage));
}
}
function getYouTubeVideoID(url: string) {
// For YouTube TV support
if(url.startsWith("https://www.youtube.com/tv#/")) url = url.replace("#", "");
@@ -823,8 +818,31 @@ function updatePreviewBar(): void {
}
//checks if this channel is whitelisted, should be done only after the channelID has been loaded
function whitelistCheck() {
channelID = videoInfo?.videoDetails?.channelId;
async function whitelistCheck() {
const whitelistedChannels = Config.config.whitelistedChannels;
const getChannelID = () => videoInfo?.videoDetails?.channelId
?? document.querySelector(".ytd-channel-name a")?.getAttribute("href")?.replace(/\/.+\//, "") // YouTube
?? document.querySelector(".ytp-title-channel-logo")?.getAttribute("href")?.replace(/https:\/.+\//, "") // YouTube Embed
?? document.querySelector("a > .channel-profile")?.parentElement?.getAttribute("href")?.replace(/\/.+\//, ""); // Invidious
try {
await utils.wait(() => !!getChannelID(), 6000, 20);
} catch {
if (Config.config.forceChannelCheck) {
// treat as not whitelisted
channelID = "";
// Don't warn for Invidious embeds
if (!(onInvidious && document.URL.includes("/embed/"))) {
videoInfoFetchFailed("adblockerIssueWhitelist");
}
}
return;
}
channelID = getChannelID();
if (!channelID) {
channelID = null;
@@ -832,8 +850,6 @@ function whitelistCheck() {
}
//see if this is a whitelisted channel
const whitelistedChannels = Config.config.whitelistedChannels;
if (whitelistedChannels != undefined && whitelistedChannels.includes(channelID)) {
channelWhitelisted = true;
}
@@ -963,6 +979,26 @@ function previewTime(time: number, unpause = true) {
}
}
//send telemetry and count skip
function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped: number, fullSkip: boolean) {
if (!Config.config.trackViewCount) return;
let counted = false;
for (const segment of skippingSegments) {
const index = sponsorTimes.indexOf(segment);
if (index !== -1 && !sponsorSkipped[index]) {
sponsorSkipped[index] = true;
if (!counted) {
Config.config.minutesSaved = Config.config.minutesSaved + secondsSkipped / 60;
Config.config.skipCount = Config.config.skipCount + 1;
counted = true;
}
if (fullSkip) utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
}
}
}
//skip from the start time to the end time for a certain index sponsor time
function skipToTime(v: HTMLVideoElement, skipTime: number[], skippingSegments: SponsorTime[], openNotice: boolean) {
// There will only be one submission if it is manual skip
@@ -986,29 +1022,7 @@ function skipToTime(v: HTMLVideoElement, skipTime: number[], skippingSegments: S
}
//send telemetry that a this sponsor was skipped
if (Config.config.trackViewCount && autoSkip) {
let alreadySkipped = false;
let isPreviewSegment = false;
for (const segment of skippingSegments) {
const index = sponsorTimes.indexOf(segment);
if (index !== -1 && !sponsorSkipped[index]) {
utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
sponsorSkipped[index] = true;
} else if (sponsorSkipped[index]) {
alreadySkipped = true;
}
if (index === -1) isPreviewSegment = true;
}
// Count this as a skip
if (!alreadySkipped && !isPreviewSegment) {
Config.config.minutesSaved = Config.config.minutesSaved + (skipTime[1] - skipTime[0]) / 60;
Config.config.skipCount = Config.config.skipCount + 1;
}
}
if (autoSkip) sendTelemetryAndCount(skippingSegments, skipTime[1] - skipTime[0], true);
}
function unskipSponsorTime(segment: SponsorTime) {
@@ -1019,13 +1033,18 @@ function unskipSponsorTime(segment: SponsorTime) {
}
function reskipSponsorTime(segment: SponsorTime) {
const skippedTime = Math.max(segment.segment[1] - video.currentTime, 0);
const segmentDuration = segment.segment[1] - segment.segment[0];
const fullSkip = skippedTime / segmentDuration > manualSkipPercentCount;
video.currentTime = segment.segment[1];
sendTelemetryAndCount([segment], skippedTime, fullSkip);
startSponsorSchedule(true, segment.segment[1], false);
}
function createButton(baseID, title, callback, imageName, isDraggable=false): boolean {
if (document.getElementById(baseID + "Button") != null) return false;
function createButton(baseID: string, title: string, callback: () => void, imageName: string, isDraggable = false): HTMLElement {
const existingElement = document.getElementById(baseID + "Button");
if (existingElement !== null) return existingElement;
// Button HTML
const newButton = document.createElement("button");
@@ -1049,9 +1068,15 @@ function createButton(baseID, title, callback, imageName, isDraggable=false): bo
newButton.appendChild(newButtonImage);
// Add the button to player
controls.prepend(newButton);
if (controls) controls.prepend(newButton);
return true;
// Store the elements to prevent unnecessary querying
playerButtons[baseID] = {
button: newButton,
image: newButtonImage,
};
return newButton;
}
function getControls(): HTMLElement | false {
@@ -1061,8 +1086,8 @@ function getControls(): HTMLElement | false {
// Mobile YouTube
".player-controls-top",
// Invidious/videojs video element's controls element
".vjs-control-bar"
]
".vjs-control-bar",
];
for (const controlsSelector of controlsSelectors) {
const controls = document.querySelectorAll(controlsSelector);
@@ -1075,53 +1100,75 @@ function getControls(): HTMLElement | false {
return false;
}
//adds all the player controls buttons
async function createButtons(): Promise<boolean> {
/** Creates any missing buttons on the YouTube player if possible. */
async function createButtons(): Promise<void> {
if (onMobileYouTube) return;
const result = await utils.wait(getControls).catch();
//set global controls variable
controls = result;
let createdButton = false;
controls = await utils.wait(getControls).catch();
// Add button if does not already exist in html
createdButton = createButton("startSponsor", "sponsorStart", startSponsorClicked, "PlayerStartIconSponsorBlocker256px.png") || createdButton;
createdButton = createButton("info", "openPopup", openInfoMenu, "PlayerInfoIconSponsorBlocker256px.png") || createdButton;
createdButton = createButton("delete", "clearTimes", clearSponsorTimes, "PlayerDeleteIconSponsorBlocker256px.png") || createdButton;
createdButton = createButton("submit", "SubmitTimes", submitSponsorTimes, "PlayerUploadIconSponsorBlocker256px.png") || createdButton;
return createdButton;
createButton("startSponsor", "sponsorStart", () => closeInfoMenuAnd(() => startOrEndTimingNewSegment()), "PlayerStartIconSponsorBlocker256px.png");
createButton("cancelSponsor", "sponsorCancel", () => closeInfoMenuAnd(() => cancelCreatingSegment()), "PlayerUploadFailedIconSponsorBlocker256px.png");
createButton("info", "openPopup", openInfoMenu, "PlayerInfoIconSponsorBlocker256px.png");
createButton("delete", "clearTimes", () => closeInfoMenuAnd(() => clearSponsorTimes()), "PlayerDeleteIconSponsorBlocker256px.png");
createButton("submit", "SubmitTimes", submitSponsorTimes, "PlayerUploadIconSponsorBlocker256px.png");
}
//adds or removes the player controls button to what it should be
async function updateVisibilityOfPlayerControlsButton(): Promise<boolean> {
//not on a proper video yet
if (!sponsorVideoID) return false;
/** Creates any missing buttons on the player and updates their visiblity. */
async function updateVisibilityOfPlayerControlsButton(): Promise<void> {
// Not on a proper video yet
if (!sponsorVideoID) return;
const createdButtons = await createButtons();
if (!createdButtons) return;
await createButtons();
if (Config.config.hideVideoPlayerControls || onInvidious) {
document.getElementById("startSponsorButton").style.display = "none";
document.getElementById("submitButton").style.display = "none";
} else {
document.getElementById("startSponsorButton").style.removeProperty("display");
}
updateEditButtonsOnPlayer();
//don't show the info button on embeds
// Don't show the info button on embeds
if (Config.config.hideInfoButtonPlayerControls || document.URL.includes("/embed/") || onInvidious) {
document.getElementById("infoButton").style.display = "none";
playerButtons.info.button.style.display = "none";
} else {
document.getElementById("infoButton").style.removeProperty("display");
playerButtons.info.button.style.removeProperty("display");
}
if (Config.config.hideDeleteButtonPlayerControls || onInvidious) {
document.getElementById("deleteButton").style.display = "none";
}
/** Updates the visibility of buttons on the player related to creating segments. */
function updateEditButtonsOnPlayer(): void {
// Don't try to update the buttons if we aren't on a YouTube video page
if (!sponsorVideoID) return;
const buttonsEnabled = !Config.config.hideVideoPlayerControls && !onInvidious;
let creatingSegment = false;
let submitButtonVisible = false;
let deleteButtonVisible = false;
// Only check if buttons should be visible if they're enabled
if (buttonsEnabled) {
creatingSegment = currentlyTimedSegment !== null;
// Show only if there are any segments to submit
submitButtonVisible = sponsorTimesSubmitting.length > 0;
// Show only if there are any segments to delete
deleteButtonVisible = sponsorTimesSubmitting.length > 0;
}
return createdButtons;
// Update the elements
playerButtons.startSponsor.button.style.display = buttonsEnabled ? "unset" : "none";
playerButtons.cancelSponsor.button.style.display = buttonsEnabled && creatingSegment ? "unset" : "none";
if (buttonsEnabled) {
if (creatingSegment) {
playerButtons.startSponsor.image.src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
playerButtons.startSponsor.button.setAttribute("title", chrome.i18n.getMessage("sponsorEnd"));
} else {
playerButtons.startSponsor.image.src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
playerButtons.startSponsor.button.setAttribute("title", chrome.i18n.getMessage("sponsorStart"));
}
}
playerButtons.submit.button.style.display = submitButtonVisible && !Config.config.hideUploadButtonPlayerControls ? "unset" : "none";
playerButtons.delete.button.style.display = deleteButtonVisible && !Config.config.hideDeleteButtonPlayerControls ? "unset" : "none";
}
/**
@@ -1142,30 +1189,40 @@ function getRealCurrentTime(): number {
}
}
function startSponsorClicked() {
//it can't update to this info yet
closeInfoMenu();
toggleStartSponsorButton();
//add to sponsorTimes
if (sponsorTimesSubmitting.length > 0 && sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment.length < 2) {
//it is an end time
sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment[1] = getRealCurrentTime();
sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment.sort((a, b) => a > b ? 1 : (a < b ? -1 : 0));
} else {
//it is a start time
sponsorTimesSubmitting.push({
function startOrEndTimingNewSegment() {
if (!currentlyTimedSegment) {
// Start a new segment
currentlyTimedSegment = {
segment: [getRealCurrentTime()],
UUID: null,
category: Config.config.defaultCategory
category: Config.config.defaultCategory,
};
} else {
// Finish creating the new segment
const existingTime = currentlyTimedSegment.segment[0];
const currentTime = getRealCurrentTime();
sponsorTimesSubmitting.push({
...currentlyTimedSegment,
// Swap timestamps if the user put the segment end before the start
segment: [Math.min(existingTime, currentTime), Math.max(existingTime, currentTime)],
});
currentlyTimedSegment = null;
// Save the newly created segment
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
}
//save this info
Config.config.segmentTimes.set(sponsorVideoID, sponsorTimesSubmitting);
updateEditButtonsOnPlayer();
updateSponsorTimesSubmitting(false)
updateSponsorTimesSubmitting(false);
}
function cancelCreatingSegment() {
currentlyTimedSegment = null;
updateEditButtonsOnPlayer();
}
function updateSponsorTimesSubmitting(getFromConfig = true) {
@@ -1194,38 +1251,6 @@ function updateSponsorTimesSubmitting(getFromConfig = true) {
}
}
async function changeStartSponsorButton(showStartSponsor: boolean, uploadButtonVisible: boolean): Promise<boolean> {
if(!sponsorVideoID || onMobileYouTube) return false;
//if it isn't visible, there is no data
const shouldHide = (uploadButtonVisible && !(Config.config.hideDeleteButtonPlayerControls || onInvidious)) ? "unset" : "none"
document.getElementById("deleteButton").style.display = shouldHide;
if (showStartSponsor) {
showingStartSponsor = true;
(<HTMLImageElement> document.getElementById("startSponsorImage")).src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", chrome.i18n.getMessage("sponsorStart"));
if (document.getElementById("startSponsorImage").style.display != "none" && uploadButtonVisible && !Config.config.hideUploadButtonPlayerControls && !onInvidious) {
document.getElementById("submitButton").style.display = "unset";
} else if (!uploadButtonVisible || onInvidious) {
//disable submit button
document.getElementById("submitButton").style.display = "none";
}
} else {
showingStartSponsor = false;
(<HTMLImageElement> document.getElementById("startSponsorImage")).src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker256px.png");
document.getElementById("startSponsorButton").setAttribute("title", chrome.i18n.getMessage("sponsorEND"));
//disable submit button
document.getElementById("submitButton").style.display = "none";
}
}
function toggleStartSponsorButton() {
changeStartSponsorButton(!showingStartSponsor, true);
}
function openInfoMenu() {
if (document.getElementById("sponsorBlockPopupContainer") != null) {
//it's already added
@@ -1235,7 +1260,7 @@ function openInfoMenu() {
popupInitialised = false;
//hide info button
document.getElementById("infoButton").style.display = "none";
if (playerButtons.info) playerButtons.info.button.style.display = "none";
sendRequestToCustomServer('GET', chrome.extension.getURL("popup.html"), function(xmlhttp) {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
@@ -1297,20 +1322,28 @@ function openInfoMenu() {
function closeInfoMenu() {
const popup = document.getElementById("sponsorBlockPopupContainer");
if (popup != null) {
popup.remove();
if (popup === null) return;
//show info button if it's not an embed
if (!document.URL.includes("/embed/")) {
document.getElementById("infoButton").style.display = "unset";
}
popup.remove();
// Show info button if it's not an embed
if (!document.URL.includes("/embed/") && playerButtons.info) {
playerButtons.info.button.style.display = "unset";
}
}
function clearSponsorTimes() {
//it can't update to this info yet
/**
* The content script currently has no way to notify the info menu of changes. As a workaround we close it, thus making it query the new information when reopened.
*
* This function and all its uses should be removed when this issue is fixed.
* */
function closeInfoMenuAnd<T>(func: () => T): T {
closeInfoMenu();
return func();
}
function clearSponsorTimes() {
const currentVideoID = sponsorVideoID;
const sponsorTimes = Config.config.segmentTimes.get(currentVideoID);
@@ -1328,8 +1361,7 @@ function clearSponsorTimes() {
updatePreviewBar();
//set buttons to be correct
changeStartSponsorButton(true, false);
updateEditButtonsOnPlayer();
}
}
@@ -1395,18 +1427,6 @@ function dontShowNoticeAgain() {
closeAllSkipNotices();
}
function sponsorMessageStarted(callback: (response: MessageResponse) => void) {
video = document.querySelector('video');
//send back current time
callback({
time: video.currentTime
})
//update button
toggleStartSponsorButton();
}
/**
* Helper method for the submission notice to clear itself when it closes
*/
@@ -1417,9 +1437,6 @@ function resetSponsorSubmissionNotice() {
function submitSponsorTimes() {
if (submissionNotice !== null) return;
//it can't update to this info yet
closeInfoMenu();
if (sponsorTimesSubmitting !== undefined && sponsorTimesSubmitting.length > 0) {
submissionNotice = new SubmissionNotice(skipNoticeContentContainer, sendSubmitMessage);
}
@@ -1428,10 +1445,10 @@ function submitSponsorTimes() {
//send the message to the background js
//called after all the checks have been made that it's okay to do so
async function sendSubmitMessage(): Promise<void> {
//add loading animation
(<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
document.getElementById("submitButton").style.animation = "rotate 1s 0s infinite";
async function sendSubmitMessage() {
// Add loading animation
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker256px.png");
playerButtons.submit.button.style.animation = "rotate 1s 0s infinite";
//check if a sponsor exceeds the duration of the video
for (let i = 0; i < sponsorTimesSubmitting.length; i++) {
@@ -1458,17 +1475,19 @@ async function sendSubmitMessage(): Promise<void> {
const response = await utils.asyncRequestToServer("POST", "/api/skipSegments", {
videoID: sponsorVideoID,
userID: Config.config.userID,
segments: sponsorTimesSubmitting
segments: sponsorTimesSubmitting,
});
if (response.status === 200) {
//hide loading message
const submitButton = document.getElementById("submitButton");
// Handle submission success
const submitButton = playerButtons.submit.button;
// Make the animation finite
submitButton.style.animation = "rotate 1s";
//finish this animation
//when the animation is over, hide the button
const animationEndListener = function() {
changeStartSponsorButton(true, false);
// When the animation is over, hide the button
const animationEndListener = () => {
updateEditButtonsOnPlayer();
submitButton.style.animation = "none";
@@ -1477,13 +1496,12 @@ async function sendSubmitMessage(): Promise<void> {
submitButton.addEventListener("animationend", animationEndListener);
//clear the sponsor times
// Remove segments from storage since they've already been submitted
Config.config.segmentTimes.delete(sponsorVideoID);
//add submissions to current sponsors list
if (sponsorTimes === null) sponsorTimes = [];
sponsorTimes = sponsorTimes.concat(sponsorTimesSubmitting);
// Add submissions to current sponsors list
// FIXME: segments from sponsorTimesSubmitting do not contain UUIDs .-.
sponsorTimes = (sponsorTimes || []).concat(sponsorTimesSubmitting);
// Increase contribution count
Config.config.sponsorTimesContributed = Config.config.sponsorTimesContributed + sponsorTimesSubmitting.length;
@@ -1493,13 +1511,14 @@ async function sendSubmitMessage(): Promise<void> {
Config.config.submissionCountSinceCategories = Config.config.submissionCountSinceCategories + 1;
// Empty the submitting times
currentlyTimedSegment = null;
sponsorTimesSubmitting = [];
updatePreviewBar();
} else {
//show that the upload failed
document.getElementById("submitButton").style.animation = "unset";
(<HTMLImageElement> document.getElementById("submitImage")).src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
// Show that the upload failed
playerButtons.submit.button.style.animation = "unset";
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker256px.png");
alert(utils.getErrorMessage(response.status, response.responseText));
}
@@ -1530,8 +1549,9 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
function addHotkeyListener(): boolean {
let videoRoot = document.getElementById("movie_player") as HTMLDivElement;
if (onInvidious) videoRoot = (document.getElementById("player-container") ?? document.getElementById("player")) as HTMLDivElement;
if (video.baseURI.startsWith("https://www.youtube.com/tv#/")) videoRoot = document.querySelector("ytlr-watch-page") as HTMLDivElement;
if (!videoRootsWithEventListeners.includes(videoRoot)) {
if (videoRoot && !videoRootsWithEventListeners.includes(videoRoot)) {
videoRoot.addEventListener("keydown", hotkeyListener);
videoRootsWithEventListeners.push(videoRoot);
return true;
@@ -1555,7 +1575,7 @@ function hotkeyListener(e: KeyboardEvent): void {
}
break;
case startSponsorKey:
startSponsorClicked();
startOrEndTimingNewSegment();
break;
case submitKey:
submitSponsorTimes();
@@ -1563,14 +1583,6 @@ function hotkeyListener(e: KeyboardEvent): void {
}
}
/**
* Is this an unlisted YouTube video.
* Assumes that the the privacy info is available.
*/
function isUnlisted(): boolean {
return videoInfo?.microformat?.playerMicroformatRenderer?.isUnlisted || videoInfo?.videoDetails?.isPrivate;
}
/**
* Adds the CSS to the page if needed. Required on optional sites with Chrome.
*/

View File

@@ -12,7 +12,6 @@ interface DefaultMessage {
message:
"update"
| "sponsorStart"
| "sponsorDataChanged"
| "isInfoFound"
| "getVideoID"
| "getChannelID"
@@ -25,13 +24,7 @@ interface BoolValueMessage {
value: boolean;
}
interface ChangeStartSponsorButtonMessage {
message: "changeStartSponsorButton";
showStartSponsor: boolean;
uploadButtonVisible: boolean;
}
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage | ChangeStartSponsorButtonMessage);
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage);
interface IsInfoFoundMessageResponse {
found: boolean;
@@ -47,7 +40,7 @@ interface GetChannelIDResponse {
}
interface SponsorStartResponse {
time: number;
creatingSegment: boolean;
}
interface IsChannelWhitelistedResponse {

View File

@@ -288,7 +288,7 @@ function invidiousInit(checkbox: HTMLInputElement, option: string) {
if (utils.isFirefox()) permissions = [];
chrome.permissions.contains({
origins: utils.getInvidiousInstancesRegex(),
origins: utils.getPermissionRegex(),
permissions: permissions
}, function (result) {
if (result != checkbox.checked) {

35
src/permissions.ts Normal file
View File

@@ -0,0 +1,35 @@
import Config from "./config";
import Utils from "./utils";
const utils = new Utils();
// This is needed, if Config is not imported before Utils, things break.
// Probably due to cyclic dependencies
Config.config;
window.addEventListener('DOMContentLoaded', init);
async function init() {
utils.localizeHtmlPage();
const domains = document.location.hash.replace("#", "").split(",");
const acceptButton = document.getElementById("acceptPermissionButton");
acceptButton.addEventListener("click", () => {
chrome.permissions.request({
origins: utils.getPermissionRegex(domains),
permissions: []
}, (granted) => {
if (granted) {
alert(chrome.i18n.getMessage("permissionRequestSuccess"));
Config.config.ytInfoPermissionGranted = true;
chrome.tabs.getCurrent((tab) => {
chrome.tabs.remove(tab.id);
});
} else {
alert(chrome.i18n.getMessage("permissionRequestFailed"));
}
});
});
}

View File

@@ -126,8 +126,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
PageElements.optionsButton.addEventListener("click", openOptions);
PageElements.helpButton.addEventListener("click", openHelp);
//if true, the button now selects the end time
let startTimeChosen = false;
/** If true, the content script is in the process of creating a new segment. */
let creatingSegment = false;
//the start and end time pairs (2d)
let sponsorTimes: SponsorTime[] = [];
@@ -233,11 +233,13 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
function onTabs(tabs) {
messageHandler.sendMessage(tabs[0].id, {message: 'getVideoID'}, function(result) {
if (result != undefined && result.videoID) {
if (result !== undefined && result.videoID) {
currentVideoID = result.videoID;
creatingSegment = result.creatingSegment;
loadTabData(tabs);
} else if (result == undefined && chrome.runtime.lastError) {
// this isn't a YouTube video then, or at least the content script is not loaded
} else if (result === undefined && chrome.runtime.lastError) {
//this isn't a YouTube video then, or at least the content script is not loaded
displayNoVideo();
}
});
@@ -253,19 +255,11 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
//load video times for this video
const sponsorTimesStorage = Config.config.segmentTimes.get(currentVideoID);
if (sponsorTimesStorage != undefined && sponsorTimesStorage.length > 0) {
if (sponsorTimesStorage[sponsorTimesStorage.length - 1] != undefined && sponsorTimesStorage[sponsorTimesStorage.length - 1].segment.length < 2) {
startTimeChosen = true;
PageElements.sponsorStart.innerHTML = chrome.i18n.getMessage("sponsorEnd");
}
sponsorTimes = sponsorTimesStorage;
//show submission section
PageElements.submissionSection.style.display = "unset";
showSubmitTimesIfNecessary();
}
updateSegmentEditingUI();
//check if this video's sponsors are known
messageHandler.sendMessage(
tabs[0].id,
@@ -321,51 +315,44 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
//the content script will get the message if a YouTube page is open
messageHandler.query({
active: true,
currentWindow: true
}, tabs => {
currentWindow: true,
}, (tabs) => {
messageHandler.sendMessage(
tabs[0].id,
{from: 'popup', message: 'sponsorStart'},
startSponsorCallback
async (response) => {
startSponsorCallback(response);
// Perform a second update after the config changes take effect as a workaround for a race condition
const removeListener = (listener: typeof lateUpdate) => {
const index = Config.configListeners.indexOf(listener);
if (index !== -1) Config.configListeners.splice(index, 1);
};
const lateUpdate = () => {
startSponsorCallback(response);
removeListener(lateUpdate);
};
Config.configListeners.push(lateUpdate);
// Remove the listener after 200ms in case the changes were propagated by the time we got the response
setTimeout(() => removeListener(lateUpdate), 200);
},
);
});
}
function startSponsorCallback(response) {
const sponsorTimesIndex = sponsorTimes.length - (startTimeChosen ? 1 : 0);
function startSponsorCallback(response: {creatingSegment: boolean}) {
creatingSegment = response.creatingSegment;
if (sponsorTimes[sponsorTimesIndex] == undefined) {
sponsorTimes[sponsorTimesIndex] = {
segment: [],
category: Config.config.defaultCategory,
UUID: null
};
// Only update the segments after a segment was created
if (!creatingSegment) {
sponsorTimes = Config.config.segmentTimes.get(currentVideoID) || [];
}
sponsorTimes[sponsorTimesIndex].segment[startTimeChosen ? 1 : 0] = response.time;
const localStartTimeChosen = startTimeChosen;
Config.config.segmentTimes.set(currentVideoID, sponsorTimes);
//send a message to the client script
if (localStartTimeChosen) {
messageHandler.query({
active: true,
currentWindow: true
}, tabs => {
messageHandler.sendMessage(
tabs[0].id,
{message: "sponsorDataChanged"}
);
});
}
updateStartTimeChosen();
//show submission section
PageElements.submissionSection.style.display = "unset";
showSubmitTimesIfNecessary();
// Update the UI
updateSegmentEditingUI();
}
//display the video times from the array at the top, in a different section
@@ -484,34 +471,13 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
PageElements.showNoticeAgain.style.display = "none";
}
function updateStartTimeChosen() {
//update startTimeChosen letiable
if (!startTimeChosen) {
startTimeChosen = true;
PageElements.sponsorStart.innerHTML = chrome.i18n.getMessage("sponsorEnd");
} else {
resetStartTimeChosen();
}
/** Updates any UI related to segment editing and submission according to the current state. */
function updateSegmentEditingUI() {
PageElements.sponsorStart.innerText = chrome.i18n.getMessage(creatingSegment ? "sponsorEnd" : "sponsorStart");
PageElements.submissionSection.style.display = sponsorTimes && sponsorTimes.length > 0 ? "unset" : "none";
}
//set it to false
function resetStartTimeChosen() {
startTimeChosen = false;
PageElements.sponsorStart.innerHTML = chrome.i18n.getMessage("sponsorStart");
}
//hides and shows the submit times button when needed
function showSubmitTimesIfNecessary() {
//check if an end time has been specified for the latest sponsor time
if (sponsorTimes.length > 0 && sponsorTimes[sponsorTimes.length - 1].segment.length > 1) {
//show submit times button
document.getElementById("submitTimesContainer").style.display = "flex";
} else {
//hide submit times button
document.getElementById("submitTimesContainer").style.display = "none";
}
}
//make the options div visible
function openOptions() {
chrome.runtime.sendMessage({"message": "openConfig"});
@@ -726,10 +692,11 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
* @param {float} seconds
* @returns {string}
*/
function getFormattedHours(minues) {
const hours = Math.floor(minues / 60);
return (hours > 0 ? hours + "h " : "") + (minues % 60).toFixed(1);
}
function getFormattedHours(minutes) {
minutes = Math.round(minutes * 10) / 10
const hours = Math.floor(minutes / 60);
return (hours > 0 ? hours + "h " : "") + (minutes % 60).toFixed(1);
}
//end of function
}

View File

@@ -17,7 +17,7 @@ export interface ContentContainer {
onMobileYouTube: boolean,
sponsorSubmissionNotice: SubmissionNotice,
resetSponsorSubmissionNotice: () => void,
changeStartSponsorButton: (showStartSponsor: boolean, uploadButtonVisible: boolean) => Promise<boolean>,
updateEditButtonsOnPlayer: () => void,
previewTime: (time: number, unpause?: boolean) => void,
videoInfo: VideoInfo,
getRealCurrentTime: () => number
@@ -60,6 +60,10 @@ export interface SponsorTime {
hidden?: SponsorHideType;
}
export type IncompleteSponsorTime = Omit<SponsorTime, 'segment'> & {
segment: [number];
};
export interface PreviewBarOption {
color: string,
opacity: string
@@ -160,4 +164,4 @@ export type VideoID = string;
export type StorageChangesObject = { [key: string]: chrome.storage.StorageChange };
export type UnEncodedSegmentTimes = [string, SponsorTime[]][];
export type UnEncodedSegmentTimes = [string, SponsorTime[]][];

View File

@@ -3,10 +3,10 @@ import { CategorySelection, SponsorTime, FetchResponse, BackgroundScriptContaine
import * as CompileConfig from "../config.json";
class Utils {
export default class Utils {
// Contains functions needed from the background script
backgroundScriptContainer: BackgroundScriptContainer | null = null;
backgroundScriptContainer: BackgroundScriptContainer | null;
// Used to add content scripts and CSS required
js = [
@@ -19,12 +19,12 @@ class Utils {
"popup.css"
];
constructor(backgroundScriptContainer?: BackgroundScriptContainer) {
constructor(backgroundScriptContainer: BackgroundScriptContainer = null) {
this.backgroundScriptContainer = backgroundScriptContainer;
}
// Function that can be used to wait for a condition before returning
async wait(condition: () => HTMLElement | boolean, timeout = 5000, check = 100): Promise<HTMLElement | boolean> {
/** Function that can be used to wait for a condition before returning. */
async wait<T>(condition: () => T | false, timeout = 5000, check = 100): Promise<T> {
return await new Promise((resolve, reject) => {
setTimeout(() => reject("TIMEOUT"), timeout);
@@ -43,6 +43,12 @@ class Utils {
});
}
containsPermission(permissions: chrome.permissions.Permissions): Promise<boolean> {
return new Promise((resolve) => {
chrome.permissions.contains(permissions, resolve)
});
}
/**
* Asks for the optional permissions required for all extra sites.
* It also starts the content script registrations.
@@ -57,7 +63,7 @@ class Utils {
if (this.isFirefox()) permissions = [];
chrome.permissions.request({
origins: this.getInvidiousInstancesRegex(),
origins: this.getPermissionRegex(),
permissions: permissions
}, async (granted) => {
if (granted) {
@@ -78,7 +84,6 @@ class Utils {
* For now, it is just SB.config.invidiousInstances.
*/
setupExtraSiteContentScripts(): void {
if (this.isFirefox()) {
const firefoxJS = [];
for (const file of this.js) {
@@ -95,7 +100,7 @@ class Utils {
allFrames: true,
js: firefoxJS,
css: firefoxCSS,
matches: this.getInvidiousInstancesRegex()
matches: this.getPermissionRegex()
};
if (this.backgroundScriptContainer) {
@@ -106,7 +111,7 @@ class Utils {
} else {
chrome.declarativeContent.onPageChanged.removeRules(["invidious"], () => {
const conditions = [];
for (const regex of this.getInvidiousInstancesRegex()) {
for (const regex of this.getPermissionRegex()) {
conditions.push(new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlMatches: regex }
}));
@@ -149,7 +154,7 @@ class Utils {
}
chrome.permissions.remove({
origins: this.getInvidiousInstancesRegex()
origins: this.getPermissionRegex()
});
}
@@ -250,16 +255,20 @@ class Utils {
}
/**
* @returns {String[]} Invidious Instances in regex form
* @returns {String[]} Domains in regex form
*/
getInvidiousInstancesRegex(): string[] {
const invidiousInstancesRegex: string[] = [];
for (const url of Config.config.invidiousInstances) {
invidiousInstancesRegex.push("https://*." + url + "/*");
invidiousInstancesRegex.push("http://*." + url + "/*");
getPermissionRegex(domains: string[] = []): string[] {
const permissionRegex: string[] = [];
if (domains.length === 0) {
domains = [...Config.config.invidiousInstances];
}
return invidiousInstancesRegex;
for (const url of domains) {
permissionRegex.push("https://*." + url + "/*");
permissionRegex.push("http://*." + url + "/*");
}
return permissionRegex;
}
generateUserID(length = 36): string {
@@ -434,5 +443,3 @@ class Utils {
}
}
export default Utils;

View File

@@ -9,7 +9,8 @@ module.exports = env => ({
popup: path.join(__dirname, srcDir + 'popup.ts'),
background: path.join(__dirname, srcDir + 'background.ts'),
content: path.join(__dirname, srcDir + 'content.ts'),
options: path.join(__dirname, srcDir + 'options.ts')
options: path.join(__dirname, srcDir + 'options.ts'),
permissions: path.join(__dirname, srcDir + 'permissions.ts')
},
output: {
path: path.join(__dirname, '../dist/js'),