Compare commits

..

806 Commits

Author SHA1 Message Date
Ajay
198ae9c41f bump version 2023-05-28 16:12:29 -04:00
Ajay
1b2be35bd6 Check multiple times if preview bar failed to be added 2023-05-28 16:11:49 -04:00
Ajay
ff3d8ff2d6 Add waiting for when preview bar detects incorrect number of chapters 2023-05-28 15:51:44 -04:00
Ajay
932ed34947 remove duplicates from translations 2023-05-28 15:04:12 -04:00
Ajay
ed59101fc7 Upload to release incrementally 2023-05-28 14:55:47 -04:00
Ajay
a4e8cdd0f6 Fix release worflow 2023-05-28 14:48:43 -04:00
Ajay
40604d7604 bump version 2023-05-28 14:42:09 -04:00
Ajay
d5d766b429 Another video element change check when video id changes 2023-05-24 23:50:12 -04:00
Ajay
a83e83c1b1 Potential fix for preview bar disappearing sometimes 2023-05-24 23:43:41 -04:00
Ajay
6585a4e325 Fix large times when locale uses dots for chapter names
Fixes #1757
2023-05-24 19:06:38 -04:00
Ajay
20ab0768df Fix chapters not saving after clicking suggestion
They still submitted properly, it only mattered if you closed the submission box
2023-05-21 19:55:58 -04:00
Ajay
b07381e5d0 Remove extra log 2023-05-12 23:55:33 -04:00
Ajay
4a1829839f Slightly improve firefox skipping 2023-05-12 23:53:37 -04:00
Ajay
93d864e927 Don't use unmute skip trick on chromium if there are mutes happening 2023-05-11 20:20:05 -04:00
Ajay
232b1816fe Fix mute segment right after skip being delayed 2023-05-11 20:17:57 -04:00
Ajay
54437ed0fd Add warning if CPU Tamer extension is detected 2023-05-10 19:38:03 -04:00
Ajay
282a4670ce Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2023-05-10 15:52:05 -04:00
Ajay
5973b801b9 Fix popup buttons centering 2023-05-10 15:52:03 -04:00
Ajay Ramachandran
628595bf5a Merge pull request #1749 from mini-bomba/previewbar-minwidth
Set min width of previewbar segments to 1px
2023-05-10 15:13:03 -04:00
Ajay
86498eb399 Add submodule build instructions to readme 2023-05-10 15:09:27 -04:00
Ajay
92fabdf37a Move more funcs to shared lib 2023-05-09 22:12:15 -04:00
Ajay
33d098d78a Fix popup padding css 2023-05-09 20:47:09 -04:00
Ajay
e094f95602 Move some options page funcs to shared lib 2023-05-09 16:49:54 -04:00
Ajay
b35bcae213 Fix copying bad files when compiling 2023-05-09 16:06:56 -04:00
Ajay
46ae92c321 Upload source before doing npm ci 2023-05-09 13:32:47 -04:00
Ajay
cc45e764cf Upload source code with modules to github 2023-05-09 13:30:31 -04:00
Ajay
f1026d403f Make workflows recursively checkout submodules 2023-05-09 13:24:32 -04:00
Ajay
c60c534a9e Fix submodule defintion file missing 2023-05-09 13:21:40 -04:00
Ajay
0e0555c32c Delete original locale files from repo 2023-05-09 13:20:22 -04:00
Ajay
928f1ed0e8 Add translations as git submodule 2023-05-09 13:18:36 -04:00
Ajay
14da4b5fcc Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2023-05-08 20:16:50 -04:00
Ajay
9d6e23d171 Fix margin issue on category pill tooltip 2023-05-08 20:16:44 -04:00
Ajay Ramachandran
68a6286af6 Merge pull request #1715 from Blueberryy/master
Add notice time to translation file
2023-05-08 17:10:55 -04:00
Ajay Ramachandran
7960fde155 Add description to translation 2023-05-08 17:08:02 -04:00
Ajay Ramachandran
afe7271419 New Crowdin updates (#1733) 2023-05-08 17:06:22 -04:00
Ajay
c6c3bd3a3d bump version 2023-05-08 17:03:49 -04:00
Ajay
f2482ee973 Add auto-config import to clickbait extension, move more funcs to shared lib
Also fix a isSafari call
2023-05-08 17:02:49 -04:00
Ajay
71dd4a97bf Fix SponsorBlock on latest YouTube layout 2023-05-07 23:56:55 -04:00
mini-bomba
f771a5a7ec Set min width of previewbar segments to 1px
This fixes short segments on long videos not appearing at all in small embeds
2023-05-07 14:25:55 +02:00
Ajay Ramachandran
d8ca29a18b Update funding 2023-05-06 23:35:45 -04:00
Ajay
4d7018a017 Fix safari check not running function
Should make Firefox more precise
2023-05-06 20:05:43 -04:00
Ajay
ca24e82a6d Fix skip looping
Fixes #1747
2023-05-06 20:04:17 -04:00
Ajay Ramachandran
186fa7af61 Merge pull request #1739 from mini-bomba/invidious-duration-without-skips
Show time with skips removed on invidious
2023-05-03 11:52:37 -04:00
mini-bomba
75b406cb5b Show time with skips removed on invidious 2023-05-02 21:42:09 +02:00
Ajay
d20b46f3ef bump version 2023-04-30 20:32:59 -04:00
Ajay
b2f3605571 Fix submit button in fullscreen and theater mode 2023-04-30 18:13:38 -04:00
Ajay
da1be6c87b bump version 2023-04-30 16:49:45 -04:00
Ajay
62a60daac7 Fix preview bar not being created on video element change if not created previously 2023-04-30 14:54:50 -04:00
Ajay
45d45b0068 Fix preview bar not appearing on all videos 2023-04-30 14:35:37 -04:00
Blueberryy
4cae6e8f41 Real fix by mini-bomba
@mini-bomba

Co-Authored-By: mini-bomba <55105495+mini-bomba@users.noreply.github.com>
2023-04-29 15:52:24 +05:00
Ajay
d3fa735481 Don't show harmful vote option for non chapters 2023-04-27 22:29:08 -04:00
Ajay Ramachandran
052a805a98 Merge pull request #1729 from ajayyy/dependabot/npm_and_yarn/xml2js-and-web-ext-0.5.0
Bump xml2js and web-ext
2023-04-27 15:22:06 -04:00
Ajay Ramachandran
6e8c406da9 New Crowdin updates (#1722) 2023-04-27 15:20:11 -04:00
dependabot[bot]
6e6c3819e5 Bump xml2js and web-ext
Bumps [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) to 0.5.0 and updates ancestor dependency [web-ext](https://github.com/mozilla/web-ext). These dependencies need to be updated together.


Updates `xml2js` from 0.4.23 to 0.5.0
- [Release notes](https://github.com/Leonidas-from-XIV/node-xml2js/releases)
- [Commits](https://github.com/Leonidas-from-XIV/node-xml2js/commits/0.5.0)

Updates `web-ext` from 7.5.0 to 7.6.2
- [Release notes](https://github.com/mozilla/web-ext/releases)
- [Commits](https://github.com/mozilla/web-ext/compare/7.5.0...7.6.2)

---
updated-dependencies:
- dependency-name: xml2js
  dependency-type: indirect
- dependency-name: web-ext
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-27 19:18:54 +00:00
Ajay
2b739e33e6 bump version 2023-04-27 15:18:34 -04:00
Ajay
7768447ab0 Upgrade maze-utils, move video element refreshes to lib 2023-04-27 15:18:17 -04:00
Ajay
e31efbbf81 Fix looped videos sometimes not skipping start segment
Fixes  #1723
2023-04-21 22:16:13 -04:00
Blueberryy
dc0d7d7e45 Another fix NoticeComponent.tsx 2023-04-20 18:58:11 +05:00
Blueberryy
ade4214b25 fIX messages.json 2023-04-20 18:50:23 +05:00
Blueberryy
6bc4c686ec FIX NoticeComponent.tsx 2023-04-20 18:49:22 +05:00
Ajay Ramachandran
ab7dfe80f7 Merge pull request #1721 from biot/received
Spelling fix
2023-04-19 17:35:43 -04:00
Bert Vermeulen
c5f549f937 Spelling fix 2023-04-19 19:26:45 +02:00
Ajay
a7aa4042ff Fix video labels showing all categories regardless of settings 2023-04-17 20:29:52 -04:00
Ajay
8136a53981 Fix wrapping issue on safari 2023-04-17 20:02:11 -04:00
Ajay Ramachandran
624c61f383 bump version 2023-04-17 17:58:09 -04:00
Ajay Ramachandran
bf1be68d06 New Crowdin updates (#1695) 2023-04-17 17:57:54 -04:00
Blueberryy
1b714470de add translatable s in notice 2023-04-11 23:03:29 +05:00
Blueberryy
32fd64ee25 add translatable s in notice 2023-04-11 23:03:23 +05:00
Ajay Ramachandran
e1521e9837 Merge pull request #1710 from mini-bomba/controls-skip-inline-players
Don't attach controls to inline preview players
2023-03-31 13:07:12 -04:00
Ajay Ramachandran
7b5303b1d8 Merge pull request #1711 from mini-bomba/darkreader-proofing-the-fvlabels
Reset fvlabel color definitions when segment == null
2023-03-31 13:06:37 -04:00
mini-bomba
78f6c66547 Reset fvlabel color definitions when segment == null
Without this, we would try to use the color for an 'undefined' category on the first render pass of the element.
It was then immediately re-rendered with a segment set, but DR missed the update, which caused it to stick to that 'undefined' category and the label became transparent.
2023-03-25 13:19:47 +01:00
Ajay
c2252af575 Move more thumbnail logic to lib 2023-03-24 19:07:26 -04:00
mini-bomba
1ef6c1977f Don't attach controls to inline preview players
Co-authored-by: Ajay <dev@ajay.app>
2023-03-24 23:59:59 +01:00
Ajay Ramachandran
e1b30204ce Merge pull request #1709 from mini-bomba/previewbar-left-right
Define left + right on previewbar segments instead of left + width
2023-03-24 18:34:44 -04:00
mini-bomba
0001d28f14 Define left + right on previewbar segments instead of left + width 2023-03-24 23:21:42 +01:00
Ajay Ramachandran
3dcc4240dc Merge pull request #1708 from mchangrh/windows-webpack
fix paths for windows dev
2023-03-24 17:50:24 -04:00
Michael C
4db3343029 fix paths for windows dev 2023-03-24 17:40:29 -04:00
Ajay Ramachandran
5711e70dbb Merge pull request #1707 from mini-bomba/fix-videoid-mismatch-error
Fix the incorrectVideoCheck() error showing the same videoID as recorded & actual
2023-03-24 15:51:47 -04:00
Ajay
6d7953a1ca Fix potentially leaking set interval 2023-03-24 15:51:36 -04:00
mini-bomba
356ce5a6f3 Fix the incorrectVideoCheck() error showing the same videoID as recorded & actual 2023-03-24 19:18:00 +01:00
Ajay Ramachandran
c1a61b9795 Merge pull request #1704 from mini-bomba/darkreader-proofing-the-dynamic-css
Darkreader-proofing the dynamic CSS variables
2023-03-22 00:11:22 -04:00
mini-bomba
e159989f17 Generate darkreader variables with our category color variables
This ensures the timeline, fv labels and thumbnail labels don't go transparent if darkreader forgets to set it's variable overrides.
2023-03-21 20:38:20 +01:00
Ajay
f6a42a7908 Fix manual skips after autoskips when inside a chapter 2023-03-20 23:10:13 -04:00
Ajay
3ddfc2f0dd reformat webpack document script definition 2023-03-20 14:14:28 -04:00
Ajay
4cf827b48a Remove exclusive_accessCategoryAdded migration 2023-03-18 21:31:27 -04:00
Ajay
f00b3abbe4 Enable chapter by default 2023-03-18 21:30:33 -04:00
Ajay
2f68a66f13 Remove chapters payment checks 2023-03-18 21:27:26 -04:00
Ajay
9831c3393f Remove chapters update message 2023-03-18 21:12:56 -04:00
Ajay
09511e8b3d Remove vendor references 2023-03-18 14:37:14 -04:00
Ajay
0e89549f6a bump version 2023-03-18 04:49:36 -04:00
Ajay Ramachandran
ef00e07647 Merge pull request #1623 from mini-bomba/labels-on-thumbnails
Show Full-Video Labels on thumbnails
2023-03-18 04:40:26 -04:00
Ajay
3a1d631e01 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into labels-on-thumbnails-merged 2023-03-18 02:08:02 -04:00
Ajay
488f5efa2f Add option to disable thumbnail icons 2023-03-18 02:05:14 -04:00
Ajay
e15e33b048 Lock version number for maze utils 2023-03-18 02:04:45 -04:00
Ajay
504f5c565b Fix oss attribution workflow 2023-03-18 00:31:07 -04:00
Ajay
94e168f803 bump version 2023-03-18 00:28:39 -04:00
Ajay
43e07fe725 Fix Invidious support on Firefox 2023-03-18 00:28:26 -04:00
Ajay
2374f4d31b Fix invidious support for thumbnail labels 2023-03-17 23:41:59 -04:00
Ajay
52f58b8ea4 Don't trigger hover autoplay from hovering over thumbnail label 2023-03-17 22:57:44 -04:00
Ajay
18f860c6a2 Increase opacity on hover 2023-03-17 22:11:13 -04:00
Ajay
5d610a342f Inject document script using raw HTML to be fast enough to still be able to hijack listener when visiting YouTube channel page directly 2023-03-17 21:10:26 -04:00
Ajay
758f0b7526 Show Full-Video Labels on thumbnails
Co-authored-by: mini-bomba <mini-bomba@users.noreply.github.com>
2023-03-10 03:49:01 -05:00
Ajay Ramachandran
3ace3b9650 Merge pull request #1674 from ajayyy/dependabot/npm_and_yarn/cacheable-request-and-got-10.2.7
Bump cacheable-request and got
2023-03-07 22:46:42 -05:00
Ajay Ramachandran
037d468c30 Merge pull request #1664 from ajayyy/dependabot/npm_and_yarn/http-cache-semantics-4.1.1
Bump http-cache-semantics from 4.1.0 to 4.1.1
2023-03-07 22:46:35 -05:00
Ajay Ramachandran
bf13c12443 Merge pull request #1661 from mchangrh/dependency-upgrade
Dependency upgrade
2023-03-07 22:45:10 -05:00
Michael C
a1f3892bd1 update dependencies 2023-03-07 22:11:28 -05:00
Ajay Ramachandran
9550a66291 Merge pull request #1691 from mchangrh/prettify-ci
update CI to prettify oss-attribution
2023-03-07 22:04:36 -05:00
Michael C
a024352b15 update GHA 2023-03-07 22:00:26 -05:00
Michael C
ef222ce229 upgrade dependencies
- remove speed-measure-webpack-plugin since it was there only for POC
2023-03-07 22:00:26 -05:00
Michael C
b310152f7f update CI to prettify oss-attribution
- also fix TS warnings in invidiousCI.ts
2023-03-07 21:55:48 -05:00
Ajay
afe8d2a20c bump version 2023-03-07 21:31:04 -05:00
github-actions[bot]
bc038c3eb3 Update OSS Attribution (#1678)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-07 21:30:30 -05:00
Ajay Ramachandran
729c816f6e Update translations (#1690) 2023-03-07 21:29:59 -05:00
github-actions[bot]
d6541945ef Update Invidious List (#1686)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-07 21:27:35 -05:00
Ajay
369d241874 bump maze utils 2023-03-07 21:27:13 -05:00
Ajay
66f3d34942 Fix chapter imports when not in focus 2023-03-03 19:47:08 -05:00
Ajay
419f0e0907 Fix duplicate code 2023-02-28 00:14:37 -05:00
Ajay
c0954b2819 Add new skip workaround for Firefox
Wait until next animation frame before starting the skipping timer
2023-02-28 00:10:54 -05:00
Ajay
290c910a1b rename submission button to "Open Submission Menu" 2023-02-26 22:12:05 -05:00
Ajay
1ffe42771f Fix unhiding one segment unhiding all 2023-02-26 20:15:33 -05:00
Ajay
b25a0a4db1 Lower case and trim invidious instances 2023-02-24 14:21:17 -05:00
Ajay
21f1e52571 Only update invidious instances if there are more, and don't remove old ones 2023-02-24 14:19:27 -05:00
Ajay
11f6fc9a31 Don't reset custom invidious instances on safari 2023-02-24 14:17:02 -05:00
Ajay
4af318403a Update channel id regex 2023-02-22 00:28:46 -05:00
Ajay
c14b33283d Switch headless mode to new due to chrome update
https://bugs.chromium.org/p/chromium/issues/detail?id=706008#c42
2023-02-22 00:22:20 -05:00
Ajay
069b1c1681 Fix odd skipping behavior sometimes with auto skip on music videos
Fix #1682
2023-02-22 00:16:51 -05:00
Ajay
dfbe036119 Fix skipping not working 2023-02-22 00:11:56 -05:00
Ajay
00c09052dc update chrome driver 2023-02-22 00:06:35 -05:00
Ajay
4095ca8642 Fix missing userid generation call swaps 2023-02-18 22:44:34 -05:00
Ajay
4ca6a331f1 Move generate userID to shared lib 2023-02-18 02:54:42 -05:00
Ajay
1d05c2b3df Convert dots to colons when importing existing chapters 2023-02-14 18:38:47 -05:00
Ajay
1d0ac86e5a Move get hash to shared lib 2023-02-14 01:42:25 -05:00
Ajay
12c63b4ff9 Fix setup tab updates missing 2023-02-14 01:24:25 -05:00
Ajay
8c994f362d Move requesting logic to shared lib 2023-02-14 01:20:46 -05:00
Ajay
5ecb809c73 Remove unused interface 2023-02-13 13:14:23 -05:00
github-actions[bot]
6ee58167d8 Update OSS Attribution (#1676)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-13 03:26:09 -05:00
Ajay
c4619aee51 Fix category pill disappearing on mobile youtube 2023-02-13 03:22:55 -05:00
Ajay
d3117d603f Fix mobile and invidious 2023-02-13 02:43:43 -05:00
Ajay
5859c33ce8 Move video handing and config to shared library 2023-02-13 02:31:25 -05:00
dependabot[bot]
241c17eb7e Bump cacheable-request and got
Bumps [cacheable-request](https://github.com/jaredwray/cacheable-request) and [got](https://github.com/sindresorhus/got). These dependencies needed to be updated together.

Updates `cacheable-request` from 7.0.2 to 10.2.7
- [Release notes](https://github.com/jaredwray/cacheable-request/releases)
- [Commits](https://github.com/jaredwray/cacheable-request/commits)

Updates `got` from 12.1.0 to 12.5.3
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v12.1.0...v12.5.3)

---
updated-dependencies:
- dependency-name: cacheable-request
  dependency-type: indirect
- dependency-name: got
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-12 14:27:25 +00:00
Ajay Ramachandran
f4d80d8843 Merge pull request #1671 from ajayyy/ci/oss_attribution
Update OSS Attribution
2023-02-07 17:51:34 -05:00
Ajay
0cdfd68239 bump version 2023-02-07 17:42:38 -05:00
Ajay
bbb234e498 Make invidious instances work on safari 2023-02-07 17:42:22 -05:00
Ajay Ramachandran
3716c8aa80 chrome limitation gone 2023-02-07 02:54:06 -05:00
github-actions[bot]
57fe4d7d65 Update OSS Attribution 2023-02-07 02:23:30 +00:00
Ajay
92e156834b Use pollyfill for invidious registration
Fix #798
2023-02-06 21:22:34 -05:00
dependabot[bot]
4e6246a710 Bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-04 06:11:03 +00:00
Ajay
b2e6e4f076 Fix tests 2023-02-01 19:55:01 -05:00
Ajay
6348bdccde bump version 2023-02-01 19:51:50 -05:00
Ajay
c3213eb040 Add invidious instances by default for safari
https://github.com/ajayyy/SponsorBlock/issues/798
2023-02-01 19:48:24 -05:00
Ajay
78a006544a Fix icon not square 2023-01-31 01:07:00 -05:00
Ajay
3ab2361f45 bump version 2023-01-31 00:58:40 -05:00
Ajay
6068276644 Fix icon on firefox being wrong 2023-01-31 00:58:31 -05:00
Ajay
e3bedbf5f2 Fix chapter importing and lock fetching after 404 2023-01-29 17:53:37 -05:00
Ajay Ramachandran
c9fc22e51e Merge pull request #1654 from mchangrh/fix-large-img
load shared.css on third party sites
2023-01-28 16:42:52 -05:00
Michael C
146c1fc889 load shared.css on third party sites 2023-01-26 03:07:43 -05:00
Ajay
63a5b6fb6f Store fonts locally 2023-01-23 01:05:33 -05:00
Ajay
254261b83a Don't hide chevron if segments are null 2023-01-21 17:37:12 -05:00
Ajay
9301a0914d Add info that piped is supported 2023-01-21 17:26:43 -05:00
Ajay Ramachandran
8e3bae6396 bump version 2023-01-21 17:24:55 -05:00
Ajay Ramachandran
1a4d48503a Merge pull request #1560 from mchangrh/piped-support
add selector for piped
2023-01-21 17:23:45 -05:00
Ajay Ramachandran
508d51d582 New Crowdin updates (#1619) 2023-01-21 17:23:10 -05:00
Ajay
8f91b83195 Remove next chapter from youtube hotkeys warning 2023-01-21 17:17:05 -05:00
Ajay
6adac26a3d Fix keybinds from popup 2023-01-21 17:13:48 -05:00
Ajay
140e816979 Change next chapter keybind to be same as YouTube and disable YouTube's one
Fix #1508
2023-01-21 17:11:08 -05:00
Ajay
f89682c2d6 give more time for chapters to load 2023-01-21 16:59:36 -05:00
Ajay
35e0f7ede9 Fix warnings 2023-01-21 16:20:18 -05:00
Ajay
8383699a68 Fix chapter name sometimes disappearing 2023-01-21 16:18:25 -05:00
dependabot[bot]
76aa472745 Bump json5 from 2.2.1 to 2.2.3 (#1640)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-08 15:41:36 -05:00
Michael C
6959bdbee1 Add piped support
- add playerInit listener
- made popup container generic for possible piped support
- explicitly add css files to web_accessible_resources
2023-01-03 17:10:51 -05:00
Michael C
c3d4914f57 add selector for piped 2023-01-02 18:28:37 -05:00
github-actions[bot]
55b6b74590 Update Invidious List (#1631)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-01 19:44:34 -05:00
Ajay
4a4b281495 Remove log 2022-12-30 23:13:39 -05:00
Ajay Ramachandran
b9b43513b4 Merge pull request #1627 from mchangrh/partialRequredSegment
highlight partial required segments
2022-12-27 12:42:06 -05:00
Michael C
f68429487e add brackets for operator precedence 2022-12-27 00:24:46 -05:00
Michael C
c5178b4c99 highlight partial required segments 2022-12-26 20:18:51 -05:00
Ajay
27f3ced338 Remove lookbehind because safari
Resolves https://github.com/ajayyy/SponsorBlock/issues/1626
2022-12-26 16:28:17 -05:00
Ajay
06a112a030 Fix category pill disappearing on mobile 2022-12-25 00:38:49 -05:00
github-actions[bot]
89b210ffd5 Update OSS Attribution (#1624)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-24 00:56:55 -05:00
Ajay
7dd2c9eb3e Move some generic functions to a new package 2022-12-24 00:54:56 -05:00
Ajay
7bf17e1746 bump version 2022-12-22 02:20:32 -05:00
Ajay
3f7f671a3b Fix early skips on firefox when seeking while playing 2022-12-22 02:20:19 -05:00
Ajay
f764869cc8 Add another test case 2022-12-19 16:19:01 -05:00
Ajay
2ba5fa6954 bump version 2022-12-19 16:14:41 -05:00
Ajay
35b8a34162 Don't remove trailing end bracket when not starting with bracket 2022-12-19 16:12:51 -05:00
Ajay Ramachandran
3379189ea8 remove serious part of warning message 2022-12-19 13:13:38 -05:00
Ajay Ramachandran
e6be13b583 make warning message nicer 2022-12-19 13:11:03 -05:00
Ajay Ramachandran
ab87afc82b New Crowdin updates (#1580) 2022-12-11 16:59:21 -05:00
Ajay
8798dd29b8 bump version 2022-12-11 16:59:01 -05:00
Ajay
3e3059d79a Fix bar being too long due to time to decimal changing while remaking bar not true 2022-12-11 16:58:40 -05:00
Ajay
16581d39a4 Reverse fast interval to decimal
It doesn't work when there are imported chapters closely or identical to existing chapters. Causes bar to extend too far.
2022-12-11 16:24:53 -05:00
Ajay
3b776991a6 Don't run some chapter init code when not necessary 2022-12-11 15:46:29 -05:00
Ajay
7eb6b3a79d Don't regenerate groups if not needed 2022-12-11 15:20:05 -05:00
Ajay
a5d91c9b57 clarify comment 2022-12-11 14:25:34 -05:00
Ajay
f59665cccb Fix smallest segment cache 2022-12-11 14:21:25 -05:00
Ajay
cf0e91c4ff Use fast time to decimal for non display calculations 2022-12-11 14:10:09 -05:00
Ajay
41a25720d0 Caching for get smallest segment
Hover previews
2022-12-11 13:19:37 -05:00
Ajay
283ec50388 Hide original chapter if similar in name 2022-12-11 12:51:36 -05:00
Ajay
e5794e6685 Fix hover text alignment issue 2022-12-11 12:04:31 -05:00
Ajay
bd3cdb98ac Fix lots of chapters freezing the browser 2022-12-11 11:58:10 -05:00
Ajay
f66d7a9547 Call whitelist check if not still waiting for channel id in window listener 2022-12-09 22:11:57 -05:00
Ajay
7be7b12d52 Generated chapters can now start after 0 seconds, so allow importing them 2022-12-04 21:55:46 -05:00
Ajay Ramachandran
b17cfa4ec2 Merge pull request #1348 from mchangrh/configDiffPlugin
config diff plugin
2022-12-04 15:10:31 -05:00
Ajay Ramachandran
8c185d4b5e Add another key to config diff whitelist 2022-12-04 15:06:16 -05:00
Ajay Ramachandran
ec86d6f99d Merge pull request #1514 from mchangrh/fv-livestream-2
Allow full video labels on livestreams
2022-12-04 15:04:15 -05:00
github-actions[bot]
ffc566c3bc Update Invidious List 2022-11-30 21:46:54 -05:00
Ajay Ramachandran
e7451eca27 Merge pull request #1595 from caneleex/patch/time-mutes
Don't include mutes in time without skips
2022-11-29 18:48:13 -05:00
Ajay Ramachandran
53713cd2e7 Merge pull request #1578 from caneleex/patch/disable-scrolling
Add option to disable scrolling to edit
2022-11-29 16:03:35 -05:00
Ajay
5925d45f74 Add new workaround for improving skipping precision on Firefox 2022-11-26 03:38:48 -05:00
Ajay
43c30bb03d bump version 2022-11-23 23:42:17 -05:00
Ajay
eac2caadce Fix document script sending events when video id not changed 2022-11-23 23:42:06 -05:00
Ajay
8d0a4ec2e6 Fix race condition causing double fetch 2022-11-23 23:37:52 -05:00
Ajay
8b6fb98b3d Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-11-23 23:24:59 -05:00
Ajay
8f13c5b8a5 Disable refetch 2022-11-23 23:24:57 -05:00
Ajay Ramachandran
ec12c1d324 bump version 2022-11-22 17:29:46 -05:00
caneleex
b696902124 why 2022-11-18 20:51:11 +01:00
caneleex
87d1522c41 Don't include mutes in time without skips 2022-11-18 20:50:05 +01:00
Ajay
4447ff3142 Fix issues with mutes ending when highlights start 2022-11-09 12:45:11 -05:00
Ajay
00ef3856ca Fix race condition causing full video label not to display 2022-11-08 13:50:56 -05:00
Ajay
cd7d74fb33 Fix category pill text on new YouTube layout 2022-11-08 13:38:19 -05:00
Ajay
ce3f77ed20 Better key moments check by not importing when no 0 second chapter 2022-11-07 21:15:04 -05:00
Ajay Ramachandran
d347f4e575 bump version 2022-11-06 13:19:56 -05:00
Ajay Ramachandran
1c5802a5e2 New Crowdin updates (#1574) 2022-11-06 13:19:35 -05:00
Ajay Ramachandran
4bc7ce7cd0 Merge pull request #1577 from caneleex/patch/outro-end-time
Don't overwrite endcards time upon submitting
2022-11-06 13:18:14 -05:00
caneleex
3c6989f67d Don't overwrite endcards time upon submitting 2022-11-06 19:15:59 +01:00
caneleex
a1e00b44d5 Add option to disable scrolling to edit 2022-11-06 18:48:42 +01:00
Ajay Ramachandran
b40749717f Merge pull request #1550 from mchangrh/stricter-ts
add noFallThrough, inplicitReturn, update packages
2022-11-04 17:06:36 -04:00
Ajay
4596f3ab0d bump version 2022-11-04 17:04:35 -04:00
mini-bomba
89e87cd74d Don't update the whole segment list on time update (#1569)
Update segment element classes instead.
This probably is more efficient than what we're doing currently.
Also, this seems to fix a bug where the vote confirmation/error msg is removed immediately
2022-11-04 17:02:54 -04:00
Ajay Ramachandran
311c4caf2b New Crowdin updates (#1544) 2022-11-04 17:02:16 -04:00
Ajay
0e0ae9165e Fix segments really close to eachother not skipping
Also combine segments that are closer than skip buffer

Fix #1510
2022-11-04 17:01:23 -04:00
Ajay
ff2cec699f adjust skip to highlight button behavior to attempt to fix issues 2022-11-04 16:18:15 -04:00
Ajay
1775835392 Add hiding skip to highlight
Fix #1530
2022-11-04 16:05:09 -04:00
Ajay
2c5db670a4 Safety on getChapterButton
Fix #1573
2022-11-04 15:44:14 -04:00
Ajay Ramachandran
4b4743f1f7 Merge pull request #1531 from mchangrh/music-progressbar
add YT Music progress bar selector
2022-11-04 15:41:51 -04:00
Ajay Ramachandran
7719ca7eca Merge pull request #1561 from mchangrh/gha-update
bump actions to node 16
2022-11-04 15:40:05 -04:00
Ajay Ramachandran
f4f7df9f2b Merge pull request #1564 from mini-bomba/userinfo-publicID
Use publicID instead of privateID for /userInfo calls
2022-11-04 15:39:44 -04:00
Ajay
95551de09a Fix precise seeking notice offset with hover preview 2022-11-01 14:41:43 -04:00
Ajay Ramachandran
8653059b13 bump version 2022-10-30 22:00:35 -04:00
Ajay
b3afd0403e Add configuration for segment failed to fetch warning 2022-10-30 20:38:48 -04:00
Ajay
6db498ccb1 Fix key moments check not working when multiple videos present 2022-10-30 20:36:05 -04:00
Ajay
ef8c5f58c5 Fix scrubbing bar missing when chapter bar using % widths 2022-10-30 14:49:19 -04:00
Ajay
71998831ee bump version 2022-10-30 13:23:12 -04:00
Ajay
8f19d3e83c Fix segment failed to fetch warning appearing for 404 2022-10-30 13:23:02 -04:00
mini-bomba
ea73a92fb7 Use publicID instead of privateID for /userInfo calls
This should reduce the load on the server a bit, as it will no longer have to compute the publicID for each sponsorblock user.
This also reduces the list of actions that leak the privateID to the server.
2022-10-29 13:20:51 +02:00
Ajay
d68c3659be bump version 2022-10-27 21:47:00 -04:00
Ajay
715bcb6bd3 Added error when segments haven't loaded and improved popup message
Resolves #1553
2022-10-27 21:46:47 -04:00
Ajay
fea8a9a37e Disable virtual time in firefox again 2022-10-27 21:39:06 -04:00
Michael C
01eeb28b60 bump actions to node 16 2022-10-27 03:26:08 -04:00
Michael C
44d4dd54aa return undefined instead of resolving void 2022-10-21 02:41:01 -04:00
Michael C
27bb6045bc make tab open listeners non-async 2022-10-21 02:37:48 -04:00
Michael M. Chang
0610eea53d Update src/popup.ts
Co-authored-by: Ajay Ramachandran <dev@ajay.app>
2022-10-21 01:01:25 -04:00
Michael C
1fcfea9fd5 add noFallThrough, inplicitReturn, update packages 2022-10-20 22:13:51 -04:00
Ajay
aec5845bce Show import button for errors 2022-10-17 09:25:11 -04:00
Ajay
5209c0ea04 Import chapters as chooseACategory if chapters is disabled 2022-10-17 09:23:59 -04:00
Ajay
b52132e311 Open submission men after importing 2022-10-17 08:52:55 -04:00
Ajay
c2e731ef89 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-10-17 08:50:56 -04:00
Ajay
a48269f254 Import short category names too 2022-10-17 08:50:55 -04:00
Ajay Ramachandran
562adb9d55 bump version 2022-10-16 22:41:46 -04:00
Ajay Ramachandran
851ceb553d New translations messages.json (Korean) (#1529) 2022-10-16 22:41:31 -04:00
Ajay
4bd7e9ab34 Fix progress bar with 0px chapters 2022-10-14 18:23:40 -04:00
Michael C
784c1db0c1 add YT Music progress bar selector 2022-10-13 00:55:55 -04:00
Ajay
97fc8174b9 Add flag to disable virtual time 2022-10-12 23:48:20 -04:00
Ajay
9849c34ed3 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-10-12 23:46:02 -04:00
Ajay
56be762686 Add back virtual time to firefox and fix it with playback speed 2022-10-12 23:46:00 -04:00
Ajay Ramachandran
1648e104e1 bump version 2022-10-11 20:57:54 -04:00
Ajay Ramachandran
c4d7c4511e New Crowdin updates (#1511) 2022-10-11 20:57:36 -04:00
Ajay Ramachandran
cd78c46ef8 Merge pull request #1521 from mini-bomba/popup
Update popup on segment updates + some code cleanup
2022-10-11 20:57:21 -04:00
Ajay
758b6f18db update buttons when single time segment is edited 2022-10-11 18:30:53 -04:00
Ajay
6d05b2a849 Set endtime by default for outro 2022-10-11 18:24:52 -04:00
Ajay
4729268083 Reimport chapters if they are found to have changed 2022-10-11 17:59:46 -04:00
mini-bomba
b7a574fc16 Clear segment list & show loading animation in popup on video change
also removed the creatingSegment variable - results in "Start/End Segment Now" correctly updating when using buttons on the controls panel instead
also the "refreshSegments" message no longer sends a response, as we send an update manually now
2022-10-11 18:38:00 +02:00
mini-bomba
c8cbd893f7 Don't hide the popup on video change
also hide the info button if the popup was open when setting up buttons
2022-10-11 16:08:07 +02:00
mini-bomba
11b01fd3dd revert reordering of imports 2022-10-11 15:41:19 +02:00
Ajay
85e3d3bc18 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-10-11 00:08:16 -04:00
Ajay
47ea8cd017 Fix unused import 2022-10-11 00:08:14 -04:00
Ajay Ramachandran
61e78eb668 Merge pull request #1524 from caneleex/patch/full-type-skip
don't append skip button for full video labels
2022-10-11 00:07:38 -04:00
Ajay
5ebd44c0c7 update category pill for react 18 2022-10-11 00:04:02 -04:00
Ajay
9888dcc323 Fix chapter import not working with 0 time 2022-10-10 23:37:48 -04:00
Ajay
49a166a6b2 Fix key moments importing as chapters 2022-10-10 23:34:34 -04:00
caneleex
2bd1271575 don't append skip button for full video labels 2022-10-10 21:21:57 +02:00
Ajay
5d62b11a6d Enable chapters if not enabled after redeem successful 2022-10-10 00:38:09 -04:00
Ajay
f4cac58322 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-10-09 16:44:55 -04:00
Ajay
4a532e751c Add class for other extensions when displaying non chapter title 2022-10-09 16:44:53 -04:00
mini-bomba
4a3b33cb85 Dedupe & clean up popup -> content script communication code 2022-10-08 19:07:58 +02:00
mini-bomba
78e9f41854 Update popup when new segments are fetched 2022-10-08 18:34:20 +02:00
mini-bomba
48cfee57b7 Return null on fails in getYouTubeVideoID and add type annotations to videoIDChange 2022-10-08 16:40:48 +02:00
Ajay Ramachandran
b2ef9e5d6e Merge pull request #1518 from mchangrh/interface-delimiter
Interface delimiter
2022-10-08 10:07:58 -04:00
Ajay Ramachandran
c42ebce6e3 Merge pull request #1520 from mini-bomba/fix/empty-unsubmitted-video
Remove the unsubmittedSegments entry when removing the last segment
2022-10-08 10:07:14 -04:00
mini-bomba
bc1d6006eb Remove the unsubmittedSegments entry when removing the last segment 2022-10-08 13:10:25 +02:00
Ajay Ramachandran
727d925879 Merge pull request #1519 from ajayyy/ci/oss_attribution
Update OSS Attribution
2022-10-07 22:56:46 -04:00
github-actions[bot]
5d48d9ac74 Update OSS Attribution 2022-10-08 02:55:47 +00:00
Ajay Ramachandran
83ea183f58 Merge pull request #1517 from mchangrh/react-18
React 18
2022-10-07 22:54:51 -04:00
Michael C
a098858035 force delimiters to follow semi 2022-10-07 20:51:58 -04:00
Michael C
81e85c19ae fix typings and revert spacing 2022-10-07 20:06:03 -04:00
Michael C
fda4a03541 fix more components 2022-10-07 19:51:05 -04:00
Michael C
55c84662c0 add some changes that are rendering properly 2022-10-07 19:28:29 -04:00
Ajay Ramachandran
5c9e06468e Merge pull request #1515 from mchangrh/dependency-update
update dependencies (skips react (again))
2022-10-07 17:24:58 -04:00
Ajay
a3d38c57d7 Fix chapter icon with ytp big mode 2022-10-07 17:20:19 -04:00
Michael C
7ec09dd385 update dependencies (skips react) 2022-10-07 17:19:36 -04:00
Michael C
bf8003891c add configDiffPlugin 2022-10-07 17:12:16 -04:00
Michael C
adb8c4c5f9 only allow full video labels on livestreams 2022-10-07 16:37:10 -04:00
Ajay
bb7f069254 Only check import duplicates against unsubmitted segments 2022-10-07 12:22:39 -04:00
Ajay
61fc1d2ed3 Fix zero start time breaking 2022-10-07 12:19:42 -04:00
Ajay
dabc63af73 Deletew all custom chapter bars we don't know about when clearing preview bar 2022-10-07 12:02:14 -04:00
Ajay
08181c1d5f Clear bote buttons when clearing preview bar 2022-10-07 11:59:56 -04:00
Ajay
03cd1b535b Count skips for chapters when viewed 2022-10-05 15:39:51 -04:00
Ajay
8cc3843ada Run chapters clear when preview bar cleared 2022-10-05 02:19:32 -04:00
Ajay
c4701092f4 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-10-05 02:15:32 -04:00
Ajay
63ef9b44c7 Make sure chapters are invalid if regex fails 2022-10-05 02:15:31 -04:00
Ajay Ramachandran
d564742339 bump version 2022-10-05 01:42:04 -04:00
Ajay Ramachandran
6477e4c1f8 New Crowdin updates (#1495) 2022-10-05 01:41:15 -04:00
Ajay Ramachandran
eb8a0ae307 Merge pull request #1498 from mchangrh/1496-fix
fix #1496
2022-10-05 01:02:37 -04:00
Ajay
5296c437cc Make the clip ignore less sketchy 2022-10-05 00:55:19 -04:00
Ajay
36efe139ba Fix wait for element not working on embed, causing segments not to load
Fix #1497
2022-10-04 22:08:19 -04:00
Ajay
eaabd3149e Fixing stacking timeout issue 2022-10-04 17:50:23 -04:00
Ajay
6166ab3006 Fix spamming user info on options page and improve popup values 2022-10-03 16:59:49 -04:00
Ajay
f1498d51fa Disable show info message if chapter enabled 2022-10-02 21:45:00 -04:00
Ajay
3aabc0d051 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-09-30 21:00:46 -04:00
Ajay
28904935da Remove chance from chapter tooltip 2022-09-30 21:00:45 -04:00
Ajay Ramachandran
35d83d257c bump version 2022-09-30 14:51:43 -04:00
Ajay Ramachandran
92e078b87c Merge pull request #1501 from mchangrh/fix-vip-lockcategories
fix VIP LockCategories
2022-09-29 00:01:15 -04:00
Michael C
75accad06e locked colour is important 2022-09-28 18:49:45 -04:00
Ajay
a99823d487 Fix import menu hidden with no segments
Fix #1499
2022-09-28 15:17:05 -04:00
Ajay
1ba1595d0e Swap inspect and preview back 2022-09-27 14:47:11 -04:00
Michael C
8f7408d815 fix #1496
- force return bad videoID on clip
- don't createbuttons on video ready, updateVisibility with more checks
- don't switch to falsy videoIDs if already available
2022-09-27 00:59:24 -04:00
Ajay
3337fa04b9 bump version 2022-09-24 22:48:08 -04:00
Ajay Ramachandran
1a0dd19cf0 Merge pull request #1450 from AlecRust/refine-popup
Tidy/simplify popup
2022-09-24 22:46:40 -04:00
Ajay
b45434b374 i18n 2022-09-24 22:46:10 -04:00
Ajay Ramachandran
a214fd416e Merge pull request #1483 from mchangrh/x-overflow
wrap popup in #secondary-inner
2022-09-24 22:42:34 -04:00
Ajay Ramachandran
38266be174 New Crowdin updates (#1489) 2022-09-24 22:41:08 -04:00
FlorianZahn
f96419d14c popup votebuttons disappear fix (#1493)
Co-authored-by: Ajay <dev@ajay.app>
2022-09-24 22:40:56 -04:00
Ajay
280127c9af Add tooltip to skip segment button 2022-09-24 22:33:12 -04:00
Ajay
da35e889f2 Add option to disable segment names beside timestamp in video player 2022-09-24 22:29:07 -04:00
Ajay
bb8975e93a Swap preview and inspect 2022-09-24 21:17:57 -04:00
Ajay
36e8300427 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-09-24 00:39:30 -04:00
Ajay
fc160e1d09 Fix chapter suggestions disappearing on click 2022-09-24 00:39:28 -04:00
Ajay Ramachandran
1ace5ea50c fix broken funding file 2022-09-23 17:13:28 -04:00
Ajay Ramachandran
911ff9b784 update links 2022-09-23 17:11:56 -04:00
Ajay
e1688c3f58 reset custom chapters bar to null when deleting 2022-09-23 11:04:55 -04:00
Ajay
e11a320c3f Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-09-23 11:01:03 -04:00
Ajay
0d6a40b9fc Fix custom chapter bar sometimes sticking around 2022-09-23 11:01:01 -04:00
Alec Rust
bbab712a79 Revert 50/50 columns, improve width when editing username 2022-09-23 09:32:49 +01:00
Alec Rust
d9f03a62ee Tidy/simplify popup 2022-09-23 09:32:49 +01:00
Ajay Ramachandran
577994cc95 Merge pull request #1490 from mchangrh/private-userid
update UserID to be Private UserID
2022-09-23 01:57:28 -04:00
Michael C
d573dabf15 update UserID to be Private UserID 2022-09-23 01:42:00 -04:00
Ajay
4c903456ff Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-09-23 01:24:28 -04:00
Ajay
6d1a29019b Default to chapters tab if no normal segments 2022-09-23 01:24:27 -04:00
Ajay Ramachandran
a91025ac23 Merge pull request #1454 from AlecRust/start-stop-segment-copy
Improve copy of start/end segment button
2022-09-23 01:17:50 -04:00
Ajay
ca931f18f6 Warning on filler description 2022-09-23 01:13:12 -04:00
Ajay
55bd10087d bump version 2022-09-23 01:01:51 -04:00
Ajay Ramachandran
97450f5936 New Crowdin updates (#1484) 2022-09-23 00:54:00 -04:00
Ajay
6b37287e08 Fix chapter chevron sometimes not appearing 2022-09-23 00:53:08 -04:00
Ajay
757d7e0a1e Only hide chapter name selector when focus lost 2022-09-22 23:30:04 -04:00
Ajay
664d75e653 Add notice about chapters for free users 2022-09-22 23:27:10 -04:00
Ajay
dffc70cc19 Hide import button when no video found 2022-09-22 22:03:28 -04:00
Ajay
d294398f28 Add export to unsubmitted segments 2022-09-22 21:58:03 -04:00
Ajay
c17cf74389 Fix preview bar on mobile 2022-09-22 16:34:17 -04:00
Ajay
b96cdbe40a Change next keybind button for better compatibility 2022-09-20 00:16:01 -04:00
Ajay
7b86a93661 Fix wrong css property name 2022-09-19 10:40:32 -04:00
Michael C
1d2122c2df wrap popup in #secondary-inner 2022-09-19 02:18:56 -04:00
Ajay
65e40e4d9c Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-09-18 23:44:15 -04:00
Ajay
25cd5a346b Fix popup layout on safari 2022-09-18 23:44:14 -04:00
Ajay Ramachandran
5684d790c4 New Crowdin updates (#1404) 2022-09-18 21:59:10 -04:00
Ajay
13cde493ec bump version 2022-09-18 21:55:26 -04:00
Ajay
052860c5a3 Fix styling of empty category name suggestions menu 2022-09-18 21:54:07 -04:00
Ajay
c66de4fdb1 Make submission menu ui more consistent 2022-09-18 21:47:04 -04:00
Ajay
edf0295cdf Fix normal chapter text sometimes disappearing 2022-09-18 21:34:45 -04:00
Ajay
d044944946 Fix type error 2022-09-18 16:58:53 -04:00
Ajay
7bbf2f1ce2 Shrink chapter vote buttons 2022-09-18 16:47:02 -04:00
Ajay
2369fcc92d Fix unnecesary failure condition for chapter bar creation 2022-09-18 16:41:01 -04:00
Ajay
0b5c692c65 Fix hover text offset when video a different aspect ratio 2022-09-18 16:31:54 -04:00
Ajay
4970d33169 Don't show unsubmitted segments in description box 2022-09-18 16:02:52 -04:00
Ajay
614d6a722a don't show update notice when disabled 2022-09-18 03:24:09 -04:00
Ajay
6d757857cb Add tooltip about chapters feature 2022-09-18 03:15:20 -04:00
Ajay
4804c7f439 Add option to show categories you don't have permission to submit 2022-09-16 22:41:39 -04:00
Ajay
47f685bcdd Clarify chapter submission unrelated to license 2022-09-16 21:47:23 -04:00
Ajay
e5d9b16235 unhide chapter bar in fallback case 2022-09-16 20:46:27 -04:00
Ajay
54a2d97f70 Change opacity for disabled options 2022-09-16 18:20:34 -04:00
Ajay
b7d85ca3c7 Add action type to preview bar test 2022-09-16 02:02:48 -04:00
Ajay
56611598b2 Fix filtered chapter group generation 2022-09-16 01:49:50 -04:00
Ajay
23e0666569 Improved behavior of next chapter keybind with overlap 2022-09-16 01:38:37 -04:00
Ajay
6571bba218 bump version 2022-09-16 01:00:53 -04:00
Ajay
51fc6fde22 Improve next chapter and previous chapter keybind 2022-09-16 00:57:43 -04:00
Ajay
b8d6d4a0b3 Handle preview bar hover without js 2022-09-15 23:37:11 -04:00
Ajay
6381f36a90 Fix hover for first chapter 2022-09-15 23:33:48 -04:00
Ajay
b9ef35dbbe Fix left over from merge conflict causing some skips to be ignored 2022-09-15 23:28:04 -04:00
Ajay
b43e3dab71 Fix doubling up segments in multi segment skip notice 2022-09-15 21:54:03 -04:00
Ajay
901dbb1ecf Fix info button animation 2022-09-15 15:35:38 -04:00
Ajay
68e01fbcc0 Add more checks to prevent double seek bar or no seek bar 2022-09-15 12:46:19 -04:00
Ajay
43d4b7ef18 Fix segments not available when hover preview -> click on same video 2022-09-15 12:10:39 -04:00
Ajay
4a00f3398e Fix last imported chapter not displaying sometimes 2022-09-14 03:40:24 -04:00
Ajay
8054e3d8f2 Fix chapters getting offset when small chapters filtered out 2022-09-14 03:18:41 -04:00
Ajay
b0e1d5e7fa Fix seek bar sometimes becoming empty when one seek section is completely filled 2022-09-14 02:58:22 -04:00
Ajay
d9e723b265 Sync official chapter margin 2022-09-14 02:27:51 -04:00
Ajay
9bb8a0986f Fix preview bar size offset with big mode 2022-09-13 23:59:00 -04:00
Ajay
6418d09039 Fix last preview bar being off 2022-09-13 23:40:16 -04:00
Ajay
afab681a60 Fix too many hover text tooltips 2022-09-13 11:56:23 -04:00
Ajay
8db077887d import segments instead of chapters 2022-09-13 11:52:09 -04:00
Ajay
c06b7857f8 Move to controls to make info button visible in selenium test 2022-09-05 00:32:04 -04:00
Ajay
e798cfdfe3 clarify what needs to be translated 2022-09-05 00:18:28 -04:00
Ajay
0e76342b04 fix typo 2022-09-05 00:17:44 -04:00
Ajay
d91e38fec9 bump version 2022-09-05 00:16:37 -04:00
Ajay
3316072f5d Fix votes appearing for unsubmitted segments 2022-09-05 00:14:23 -04:00
Ajay
4c568212ac Hide custom chapter bar while generating 2022-09-05 00:03:57 -04:00
Ajay
eaa119f152 Make sure original chapter bar that is used is always the right one 2022-09-05 00:01:11 -04:00
Ajay
e7deabe8d9 Properly handle hover previews for chapters and clear old unused ones 2022-09-04 23:57:10 -04:00
Ajay
6d47700ebd Safer document script 2022-09-04 23:14:15 -04:00
Ajay
93c616de23 Prevent some event bubbling issues 2022-09-04 22:04:48 -04:00
Ajay
ee25b41d7e Don't carry over incorrect/harmful vote menu between videos 2022-09-04 21:58:56 -04:00
Ajay
00f134029a Prevent creating multiple chapter vote containers 2022-09-04 21:52:14 -04:00
Ajay
00d625013b Add option to manual skip when a full video segment exists 2022-09-03 23:16:18 -04:00
Ajay
e81ff66dd3 Fix chapter -> full -> chapter not saving times 2022-09-03 21:28:02 -04:00
Ajay
97af12416e Fix copy tooltip 2022-09-03 01:58:22 -04:00
Ajay
bf191dab92 fix react errors about using inherit 2022-09-03 01:09:16 -04:00
Ajay
f8c61b7848 Don't use video before it is set 2022-09-03 00:36:28 -04:00
Ajay
5b136f2da8 Fix crashes on invidious 2022-09-03 00:32:20 -04:00
Ajay
8b80b33810 Don't show empty chapter bar for youtube chapters in popup 2022-09-03 00:27:18 -04:00
Ajay
e3c36ae6e2 Fix the freezing on firefox due to hover preview text 2022-09-03 00:22:03 -04:00
Ajay
533b15f44b Add support for hours in import segments 2022-09-02 21:42:36 -04:00
Ajay Ramachandran
4f0f8655f4 Merge pull request #1425 from mchangrh/contentScriptRebase
rebase document script out of videoInfo
2022-09-02 15:20:40 -04:00
Ajay Ramachandran
668f6856d1 bump version 2022-09-02 15:20:25 -04:00
Ajay
c8e2bb0c13 Auto update hidden categories when redeemed 2022-09-02 14:38:49 -04:00
Ajay
39ed7ea83c Fix license code box 2022-09-02 14:26:41 -04:00
Ajay
f1b2ff801a Fix redirect uri 2022-09-02 13:50:29 -04:00
Ajay Ramachandran
1d9c3a8b80 fix typo 2022-09-02 04:55:17 -04:00
Ajay
29c6151fe3 Ensure channel id is defined before declaring it found 2022-09-02 01:30:13 -04:00
Ajay
1377be9915 Use events for channel id and fallback to current system
Also fix formatting
2022-09-02 01:30:12 -04:00
Michael C
c479a601cd rebase document script out of videoInfo #1312 2022-09-02 01:30:09 -04:00
Ajay Ramachandran
f66a4d25bf Merge pull request #1446 from mini-bomba/clearUnsubmittedSegments
Add a section in options for unsubmitted segments
2022-09-02 00:17:57 -04:00
Ajay
9c7d153f15 Move segment export to backup page and improve margins 2022-09-02 00:15:05 -04:00
mini-bomba
bbea534781 Add "Export segments as URL" option the unsubmitted videos section 2022-09-01 23:03:25 -04:00
mini-bomba
df2586e76d Load segment description from hashparams 2022-09-01 23:03:25 -04:00
mini-bomba
59093cdf21 Move new react components to components/options/, following latest changes 2022-09-01 23:03:25 -04:00
mini-bomba
5f6307041a Add an Export Segments button to the unsubmitted segments list 2022-09-01 23:03:25 -04:00
mini-bomba
26f2143247 Don't force-sync unsubmitted segments when clear confirm prompt is cancelled 2022-09-01 23:03:25 -04:00
mini-bomba
bd292ff886 Split unsubmittedSegmentCounts string into many to account for singular/plural forms of nouns
hopefully with enough context for translators to properly translate...
2022-09-01 23:03:25 -04:00
mini-bomba
9915d46ad4 Add a section in options for unsubmitted segments 2022-09-01 23:03:25 -04:00
Ajay
2b5a02e068 Make required segments thicker in preview bar 2022-09-01 21:35:58 -04:00
Ajay
1f68f512fa Fix linting error 2022-09-01 20:04:53 -04:00
Ajay
d18f7c6195 Make limited width option better 2022-09-01 17:10:01 -04:00
Ajay
015ac7d46e Fix test breaking due to chrome.* api 2022-09-01 16:52:10 -04:00
Ajay
6631dfdea3 Also check license status for submitting chapter 2022-09-01 16:44:02 -04:00
Ajay
212fbb83fe Add tooltip to sort segments 2022-09-01 16:33:34 -04:00
Ajay
9e08d6012c Fix export/import not appearing without segments and without chapter enabled 2022-09-01 16:32:23 -04:00
Ajay
69c0fe1caf Make importer import non chapters too 2022-09-01 16:25:43 -04:00
Ajay
fcecd1163d Improve locked category display 2022-09-01 16:10:57 -04:00
Ajay
29ea112b4f Move hyphen so it is not treated as a range 2022-09-01 16:07:29 -04:00
Ajay Ramachandran
2b96fd5f57 Merge pull request #1001 from ajayyy/chapters
Chapters
2022-09-01 15:24:35 -04:00
Ajay
3e40745621 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-09-01 15:21:23 -04:00
Ajay
c6e30236e9 Add license requirement 2022-09-01 15:15:30 -04:00
Ajay
34c4ecf940 Don't include chapters in time without skips 2022-08-28 23:47:27 -04:00
Ajay
3550c168e2 Fix active segment sometimes disapearing 2022-08-28 23:45:02 -04:00
Ajay
901d6e6c92 Add voting for chapters 2022-08-28 23:38:40 -04:00
Ajay Ramachandran
f05d081cd6 Merge pull request #1459 from mchangrh/no-html-error
catch all html in error messages
2022-08-22 23:21:39 -04:00
Michael C
aadc1be56c catch all html in error messages 2022-08-22 20:44:23 -04:00
Alec Rust
5b080874f2 Improve copy of start/end segment button 2022-08-22 10:51:02 +01:00
Ajay Ramachandran
19e230ea6a Merge pull request #1453 from AlecRust/fix-width-when-embedded
Fix popup width when embedded in page
2022-08-21 22:23:52 -04:00
Alec Rust
bc1263c341 Fix popup width when embedded in page 2022-08-21 11:56:31 +01:00
Ajay
42d76cf257 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-08-19 23:16:45 -04:00
Ajay
d06b7411dc Move options associated with specific categories into their div 2022-08-19 01:26:45 -04:00
Ajay
b14d766ffb Don't show hidden segments in active segment box 2022-08-18 02:44:49 -04:00
Ajay
32ff8db241 Fix buffering sometimes not rendering all the way 2022-08-18 02:39:56 -04:00
Ajay
ea87c8ca24 Fix seek bar progress offsets with custom chapter sections 2022-08-18 02:24:54 -04:00
Michael M. Chang
780ea4a9d0 update wording of Preview to be inline with wiki (#1441)
Co-authored-by: Ajay Ramachandran <dev@ajay.app>
2022-08-17 23:20:16 -04:00
Ajay
6ce4797772 Fix preview bar when video duration innacurate 2022-08-17 01:28:19 -04:00
Ajay
8e738a6097 Fix preview bars rendering incorrectly when native chapters are displayed 2022-08-17 01:21:06 -04:00
Ajay
7d3f86ded1 Fix skipping after paused at zero sometimes not working
Affects some autoplay blocking

Resolves #1437
2022-08-16 16:42:47 -04:00
Ajay
faeb5dede0 Add page for refreshing invidious permissions if it was revoked
Fixes #1354
2022-08-16 16:00:34 -04:00
Ajay Ramachandran
eae8485713 Merge pull request #1422 from mchangrh/localDisableMute
allow disabling mute segments locally
2022-08-14 00:23:29 -04:00
Ajay Ramachandran
87ca0a8a50 Merge pull request #1427 from mini-bomba/theming_fixes
Fix issues with DR & Invidious themes
2022-08-14 00:18:48 -04:00
Ajay
99c5375c6a Handle permission userinfo using new logic 2022-08-14 00:14:59 -04:00
mini-bomba
a62f6ca696 Fix issues with DR & Invidious themes 2022-07-30 00:35:55 +02:00
Michael C
6eb1d5d954 allow disabling mute segments locally 2022-07-29 00:37:02 -04:00
Ajay Ramachandran
81b01ac5cc Merge pull request #1417 from mchangrh/update-dependencies
Update dependencies
2022-07-25 17:18:13 -04:00
Michael C
6f47b66837 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into update-dependencies 2022-07-25 16:11:30 -04:00
Michael C
cf43e04d47 update dependnecies 2022-07-25 16:10:10 -04:00
Ajay
cda57e2d2b Make title link selector more specific
Co-authored-by: Michael C <michael@mchang.name>
2022-07-25 16:03:08 -04:00
Ajay
a9186a35e5 Fix hover previews on load and channel trailers 2022-07-25 02:40:48 -04:00
Ajay
1a6e6279c8 Fix autoskipping when skips load before video 2022-07-24 21:45:25 -04:00
Ajay Ramachandran
522a04eecb bump version 2022-07-21 23:40:26 -04:00
Ajay
d8dfbef1a7 Fix issue with navigator triggering events before document.url updates 2022-07-21 15:14:57 -04:00
Ajay
60ea7190f9 Pin github actions 2022-07-21 00:13:32 -04:00
Ajay
804870f18a Fix new warning ui 2022-07-20 21:07:57 -04:00
Ajay Ramachandran
7c302af207 bump version 2022-07-20 21:03:20 -04:00
Ajay
2cc1dcc6fd Add better UI for warnings allowing you to accept without chatting 2022-07-20 18:48:53 -04:00
Ajay
31cc4b4960 Fix running dev broken 2022-07-20 16:49:23 -04:00
Ajay
af86534992 Fix categories not being able to be disabled 2022-07-19 23:37:42 -04:00
Ajay
0f9122aa1c Fix skipping two segments at the same time for auto skip on music videos 2022-07-19 23:27:32 -04:00
Ajay
d0e35032a5 Include overlap when unmuting if about to autoskip 2022-07-14 17:39:08 -04:00
Ajay Ramachandran
acf26d3127 Merge pull request #1400 from mchangrh/update-deps
update dependencies
2022-07-13 12:25:37 -04:00
Ajay
d352c6efb4 bump version 2022-07-13 12:16:11 -04:00
Ajay
5ff9b10f21 Fix double skip issue 2022-07-13 12:15:56 -04:00
Michael C
80c67d8340 update dependencies 2022-07-12 23:47:22 -04:00
Ajay Ramachandran
3ee2e2517a bump version 2022-07-12 11:43:58 -04:00
Ajay Ramachandran
dd7f227305 Merge pull request #1388 from mchangrh/revert-module-fix-ci
Revert module & fix ci
2022-07-12 11:43:32 -04:00
Ajay Ramachandran
c1d3c7d680 New Crowdin updates (#1393) 2022-07-12 11:42:09 -04:00
Ajay
fae6d0d0cf Add comments 2022-07-12 01:03:28 -04:00
Ajay
60d106fc52 Fix cases with multiple segments starting at the exact same time 2022-07-12 00:59:13 -04:00
Ajay
a4df2eab8f Retry for errors again 2022-07-11 15:00:48 -04:00
Ajay
fdbcf47149 make skip to next chapter go to next endpoint and fix reskip stackoverflow 2022-07-10 21:51:56 -04:00
Ajay
b1ef8a5d47 Don't draw chapters bar when no custom segments 2022-07-10 02:06:26 -04:00
Ajay
4cb6baaff0 Fix chapter import for no segments 2022-07-10 02:02:12 -04:00
Ajay
6cb4fac041 Add hotkeys for skipping to next and previous chapter 2022-07-10 01:58:39 -04:00
Ajay
d7176a9c97 Import chapters with no segments as well 2022-07-10 01:13:53 -04:00
Ajay
2eb0a34858 Always import chapters when segments 2022-07-10 00:56:31 -04:00
Ajay
cf86e91988 Added guideline reminders for 2022-07-09 23:42:52 -04:00
Ajay
058c41dd7e Rename chapter option to show chapter 2022-07-07 17:05:27 -04:00
Ajay
7a50167222 Remove first event check 2022-07-05 16:02:05 -04:00
Ajay
969b303c59 Limit chapter in UI to those who can submit 2022-07-05 13:34:30 -04:00
Ajay
8114e0dcf7 Fix some chapter and mute not skipping from popup 2022-07-04 01:21:36 -04:00
Ajay
561b3a2263 Fix double click skip in popup 2022-07-04 01:21:11 -04:00
Ajay
e0edb63501 Put chapter option higher up 2022-07-04 01:10:41 -04:00
Ajay
70ef867ec5 Don't count skip time for chapter 2022-07-04 01:05:14 -04:00
Ajay
23336fa65b Don't send message if tab not found 2022-07-04 00:49:32 -04:00
Ajay
fea90d024e Made render segments as chapters only affect non chapter segments 2022-07-04 00:43:55 -04:00
Ajay
de85d93602 Hide chapter chevron when it won't do anything 2022-07-03 23:50:18 -04:00
Ajay
e48d956577 Fix segments disapearing when changing skip options 2022-07-03 22:44:32 -04:00
Ajay Ramachandran
efec6a113f bump version 2022-07-03 19:24:24 -04:00
Ajay Ramachandran
0121a2aebd New translations messages.json (German) (#1391) 2022-07-03 19:24:02 -04:00
Ajay
7badfd9b32 Fix existing chapters opening skip notice when chapters disabled 2022-07-03 18:33:32 -04:00
Ajay
d0497d60e8 Add indicator where current player is for segments in popup 2022-07-03 17:53:40 -04:00
Ajay
e223d12520 Fix scrubbing on mobile 2022-07-03 16:42:45 -04:00
Ajay Ramachandran
27e8e83c59 Merge pull request #1389 from mchangrh/export-timestamp
append timestamp to export filename
2022-07-03 00:27:40 -04:00
Ajay Ramachandran
c7f254db70 Use templates 2022-07-03 00:24:28 -04:00
Ajay
85c3cd4a81 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-07-03 00:22:58 -04:00
Ajay
8d9042aeeb Only ignore play event when buffering 2022-07-03 00:22:56 -04:00
Michael C
373edf883d append timestamp to export filename 2022-07-01 02:07:54 -04:00
Michael C
7ed01a181e sort invidiousList for consistency, update from failed CI 2022-06-30 21:47:54 -04:00
Michael C
4119fd8433 revert module conversion 2022-06-30 21:39:28 -04:00
Ajay Ramachandran
cc7d7c0a0c New Crowdin updates (#1368) 2022-06-30 19:54:08 -04:00
Ajay Ramachandran
61b39a99db bump version 2022-06-30 19:53:26 -04:00
Ajay Ramachandran
98f776fa3a Merge pull request #1387 from mchangrh/await-embed
fix embeds not being detected correctly
2022-06-30 17:39:34 -04:00
Michael C
75f426f456 fix embeds not being detected correctly
- add awaiter for key element
- refresh ID with segments if videoID is invalid
2022-06-30 16:38:11 -04:00
Ajay Ramachandran
67b510e628 Merge pull request #1370 from mchangrh/popup-connection-error
Show connectionError string if status is not 404
2022-06-24 17:22:33 -04:00
Michael C
7cc0847db1 store response status 200 2022-06-24 10:49:57 -04:00
Michael C
b92132bf47 implement #1364
show connectionError string if status is not 404
2022-06-24 01:21:19 -04:00
Ajay
cfecb9f94a Better import deduplication 2022-06-23 00:14:21 -04:00
Ajay
fc81e02026 Fix exporter test 2022-06-22 18:58:49 -04:00
Ajay
e12d5ff10a Better category name detection 2022-06-22 18:40:36 -04:00
Ajay
355572ba04 Add warning when chapter name similar to category 2022-06-22 18:10:07 -04:00
Ajay
70731e42a5 Only show import when chapter enabled 2022-06-22 14:03:58 -04:00
Ajay
023b875b0f Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-06-22 13:34:15 -04:00
Ajay
82b027159e Add UI for importing segments 2022-06-22 13:21:44 -04:00
Ajay
6b4da25847 Create source maps in dev 2022-06-22 13:21:15 -04:00
Ajay
529db4d6ca Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-06-22 13:18:49 -04:00
Ajay
d132342ffe Fix popup being out of date and auto closing
Fixes #1359
2022-06-22 13:18:48 -04:00
Ajay
c6405fc0c1 Fix rendering chapters in specific overlapping cases 2022-06-22 13:02:04 -04:00
Ajay
1f6b8f6c53 Add end button for chapters 2022-06-19 15:47:08 -04:00
Ajay Ramachandran
6bdac234b0 bump version 2022-06-19 15:22:48 -04:00
Ajay Ramachandran
337e9680b9 New Crowdin updates (#1346) 2022-06-19 15:22:30 -04:00
Ajay
986630d0a1 Save file on test failure
Fixes #1366
2022-06-18 11:54:52 -04:00
Ajay
ae23bfffe1 Fix whitelist test 2022-06-18 11:34:37 -04:00
Ajay
619683e842 Add test for whitelist 2022-06-17 19:30:53 -04:00
Ajay
1b5ba96bd9 Add full video test 2022-06-17 17:35:50 -04:00
Ajay Ramachandran
bbc5b436e0 Merge pull request #1365 from ajayyy/auto-selenium
Run Selenium tests in GitHub actions
2022-06-17 17:12:05 -04:00
Ajay
91311787df Run headless 2022-06-17 17:06:41 -04:00
Ajay
74e9a98afd Fix selenium tests 2022-06-17 16:42:59 -04:00
Ajay Ramachandran
b369dcc117 Merge pull request #1363 from mchangrh/fix-ci
Fix npm ci failing
2022-06-16 18:01:51 -04:00
Michael C
5a05e01b7d bump package-lock with npm 8.12 2022-06-16 17:48:39 -04:00
Ajay Ramachandran
8097eff9bb Merge pull request #1355 from Argn0/branch3
display "Voted!" message only momentarily
2022-06-15 13:08:02 -04:00
Ajay
c61c97ccad Fix segments with small gaps 2022-06-15 13:05:44 -04:00
Ajay
9a7baa7325 Fix typo 2022-06-15 13:02:53 -04:00
Ajay
5ac577c99b update oss attributions 2022-06-13 14:50:42 -04:00
Ajay
3f421a2fb0 Update node version in workflow 2022-06-13 13:34:39 -04:00
Ajay
e94ce0ffef Fix edit username box too big 2022-06-13 13:28:16 -04:00
Ajay
2dfcf2141f minimum width for username box 2022-06-13 13:26:33 -04:00
Ajay
47220e0abc Fix some popup buttons 2022-06-13 13:16:47 -04:00
Argn0
05eed6ee20 display "Voted!" message only momentarily 2022-06-10 06:13:57 +02:00
Ajay
9eec62d59f Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-06-09 14:02:25 -04:00
Ajay
25c04a49c1 Fix help page not closing from keybind 2022-06-09 14:02:23 -04:00
Ajay Ramachandran
efe6b0483c remove pointer cursor from your work 2022-06-07 22:47:59 -04:00
Ajay
caafba5f53 remove extra line from export 2022-06-06 22:32:02 -04:00
Ajay
32052c17f1 Add notice showing that copy happened 2022-06-06 20:41:15 -04:00
Ajay
32a3cb2cfe Forward key presses from popup 2022-06-06 17:09:34 -04:00
Ajay
d9970bf110 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-06-06 13:18:21 -04:00
Ajay
6514b41418 Fix only bracket wrapping 2022-06-06 13:18:20 -04:00
Ajay Ramachandran
e480e032f2 bump version 2022-06-05 00:09:21 -04:00
Ajay Ramachandran
995001bd91 New Crowdin updates (#1342) 2022-06-05 00:09:14 -04:00
Ajay
5545a516be Added export button 2022-06-04 02:01:12 -04:00
Ajay
0fb2d8df79 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-06-04 01:57:27 -04:00
Ajay
466152ed42 Fix popup copy to clipboard 2022-06-04 01:56:00 -04:00
Ajay
e4855f7427 Fix messed up margin on popup 2022-06-04 01:50:19 -04:00
Ajay
b28d881a1b Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-06-03 15:12:42 -04:00
Ajay
258abd5deb Fix jest errors not displaying in console 2022-06-03 15:12:35 -04:00
Ajay
b8cbdb55d5 Fix test error 2022-06-03 15:12:14 -04:00
Ajay Ramachandran
4e7975a9de bump version 2022-06-03 13:36:40 -04:00
Ajay Ramachandran
ec8d5d88e9 New translations messages.json (Chinese Traditional) (#1341) 2022-06-03 13:35:41 -04:00
Ajay
94fa649a17 Fix lint error 2022-06-03 13:34:41 -04:00
Ajay Ramachandran
71653572aa New Crowdin updates (#1332) 2022-06-03 02:21:18 -04:00
Ajay
c3cb450e92 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-06-03 02:20:30 -04:00
Ajay Ramachandran
a18f431e06 Merge pull request #1300 from PickleNik/master
Popup Styling Upgrades
2022-06-03 01:59:56 -04:00
Ajay
56f7b40585 Fix code formatting 2022-06-03 01:57:55 -04:00
Ajay
a5f263dc12 Make logo in same line in popup 2022-06-03 01:53:29 -04:00
Ajay
3415dafb02 Revert changes to options button and close button 2022-06-03 01:45:47 -04:00
Ajay
9664bbea73 Change alignment of some popup elements 2022-06-03 01:38:32 -04:00
Ajay
c7b07ba958 Fix localize function not working for title of direct children 2022-06-02 22:00:06 -04:00
Ajay
20b95887af Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into pr/PickleNik/1300 2022-06-02 21:48:05 -04:00
Ajay Ramachandran
47d4812b92 Merge pull request #1322 from NDevTK/master
Move popup to iframe and restrict embeds
2022-06-02 21:42:19 -04:00
Ajay
6202a4d0a3 Only show close button on in page popup 2022-06-02 21:38:27 -04:00
Ajay
6b584f2111 Faster popup loading on firefox 2022-06-02 21:38:26 -04:00
Ajay
3d9221eb8d improve display while popup loads 2022-06-02 21:38:26 -04:00
Ajay
96173dd901 Fix popup communication on Firefox 2022-06-02 21:38:21 -04:00
Ajay
5820758563 Fix close button layout issues 2022-06-02 21:37:32 -04:00
NDevTK
bfadb1373a Add comment 2022-06-02 21:37:21 -04:00
NDevTK
a7956aacf9 Remove unused sendRequestToCustomServer 2022-06-02 21:37:21 -04:00
NDevTK
afee681575 Removed runThePopup 2022-06-02 21:37:14 -04:00
NDevTK
b5482b6527 Move popup to iframe 2022-06-02 21:36:54 -04:00
Ajay Ramachandran
ff87a42147 Merge pull request #1330 from bershanskiy/history
Use Navigation API when available
2022-06-02 02:30:57 -04:00
Ajay
7e5130c49a Don't wait to add listener 2022-06-02 01:43:31 -04:00
Ajay
a7b18bca87 Fix grammar 2022-05-31 18:29:46 -04:00
Ajay Ramachandran
a2ead6bcc4 Merge pull request #1333 from Argn0/debouncecolor
Debounce setting bar color
2022-05-31 13:40:07 -04:00
Ajay Ramachandran
4a2614349d Merge pull request #1338 from ajayyy/guidelines
Add initial sponsor help page
2022-05-31 13:38:27 -04:00
Ajay
67c63a09fe Delete items if exceeding storage 2022-05-31 13:31:18 -04:00
Ajay
97aea1c268 Fix icon sizes 2022-05-31 13:12:01 -04:00
Ajay
b70f50e1a0 Fix skip notice width limiting 2022-05-31 03:06:48 -04:00
Ajay
4880227320 Fix blank skip notice title when unskipping 2022-05-31 02:58:36 -04:00
Ajay
dfa21068f4 Fix buttons being offset on guidelines notice 2022-05-31 02:55:44 -04:00
Ajay
fd75a33e50 Use full details instead of learn more 2022-05-31 02:55:32 -04:00
Ajay
1409c563e2 Add guidelines for all categories 2022-05-31 02:37:29 -04:00
Ajay
588c42d579 Add initial sponsor help page 2022-05-31 00:50:32 -04:00
Ajay
d7ff6aa6a2 Add user to channel id regex 2022-05-26 22:25:16 -04:00
Ajay
44266e508b Another fix for firefox addon icon 2022-05-26 15:56:21 -04:00
Anton Bershanskiy
9b9ea39260 Use History API when available 2022-05-26 15:38:18 +03:00
Argn0
31b10f9a41 change timeout to 50ms 2022-05-25 20:27:27 +02:00
Ajay
c0f8f5e1d0 bump version 2022-05-25 14:16:45 -04:00
Argn0
0261d36a47 debounce setting bar color 2022-05-25 15:09:40 +02:00
Ajay Ramachandran
e948e1e569 Merge pull request #1331 from mchangrh/updateDependencies
update dependencies & bump minimum node version
2022-05-25 00:01:10 -04:00
Ajay
5289e62d43 Use virtual time for determining whether to skip and increase skip buffer
Potentially fix recent issue with skips not triggering
2022-05-24 23:54:05 -04:00
Ajay
eda7aac5ef Add time to log messages 2022-05-24 23:31:43 -04:00
Michael C
d9f4ab0d04 specify jest as cjs, change eslintrc to .json 2022-05-24 21:23:05 -04:00
Michael C
2665327729 update dependencies & bump minimum node version (#1329)
- bump all dependences
- add github-actions reporter to jest
- convert (most) webpack configs to ESM
  - manifest.cjs cannot be converted since there is no native .json import until node 17
2022-05-24 21:14:36 -04:00
Ajay
4738c1897f bump version 2022-05-24 14:05:13 -04:00
Ajay
cfbb194a61 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-05-24 14:04:54 -04:00
Ajay
9ad21e8ea1 Fix channel id regex 2022-05-24 14:04:53 -04:00
Ajay Ramachandran
941fc2985d Merge pull request #1238 from AlecRust/fix-unused-vars-lint
Fix @typescript-eslint/no-unused-vars lint warnings
2022-05-24 13:17:27 -04:00
Ajay Ramachandran
e2da071761 bump version 2022-05-24 13:16:04 -04:00
Ajay Ramachandran
c20c9ac64a Merge pull request #1220 from tadwohlrapp/patch-1
Fix minor typos and inconsistencies
2022-05-24 13:12:20 -04:00
Ajay Ramachandran
2d59f3825c New translations messages.json (Swedish) (#1326) 2022-05-24 13:09:34 -04:00
Ajay Ramachandran
fb8b7a7d19 Merge pull request #1327 from Argn0/branch1
Add reset settings option
2022-05-24 12:56:50 -04:00
Ajay
d992cc7a3c Don't reset everything 2022-05-24 12:55:17 -04:00
Ajay
f8fecf5174 Remove redundant explanation 2022-05-24 12:50:39 -04:00
Argn0
3007cddce9 add reset settings option 2022-05-24 10:04:56 +02:00
Ajay
2b3c812f8a Some more debug logs 2022-05-23 21:41:35 -04:00
Ajay
61535fac95 Add more logging for catching skip issues 2022-05-23 01:14:46 -04:00
Ajay
4182595436 Don't stop skipping if channel id fetch fails 2022-05-21 16:54:02 -04:00
Ajay
97e30e4001 bump version 2022-05-20 04:19:20 -04:00
Ajay
6763fd3b4b Allow more channel IDs
Help with #753
2022-05-20 04:01:50 -04:00
Ajay
a39ec76340 Fix skip to highlight option on mobile 2022-05-19 19:28:26 -04:00
Ajay
f68282decc Add more verbose logging to hidden variable 2022-05-19 19:22:59 -04:00
Ajay
160de56a71 Fix icon on android firefox 2022-05-19 13:07:44 -04:00
Ajay
bd4fbcc93d bump version 2022-05-18 15:44:08 -04:00
Ajay
f1839eef94 Added another warning related to buffering 2022-05-18 15:43:51 -04:00
Ajay
3e3abf36e5 Fix unsafe navigation 2022-05-17 22:39:49 -04:00
Ajay
621e28c7e7 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-05-17 14:44:54 -04:00
Ajay
393861dcd3 bump version 2022-05-17 14:16:19 -04:00
Ajay Ramachandran
b5d6b2d3fd New Crowdin updates (#1309) 2022-05-17 14:16:04 -04:00
Ajay Ramachandran
a0c82dc734 Merge pull request #1315 from mchangrh/invidiousProgressBar
shortcut creating preview bar on invidious
2022-05-17 14:15:44 -04:00
Ajay
e4be99c3d7 Clean up isVisible shortcut 2022-05-17 14:11:07 -04:00
Michael C
3da6a57e42 shorcut creating preview bar on invidious 2022-05-17 14:10:57 -04:00
Ajay Ramachandran
7ce9442153 Merge pull request #1314 from mchangrh/mobileChapters
add selector for mobile YT chapters
2022-05-17 14:02:19 -04:00
Ajay
773da185ee Fix visual issues on mobile preview bar 2022-05-17 13:55:39 -04:00
Ajay
bf3dcd97b8 Fix time without skips 2022-05-17 13:50:30 -04:00
Ajay
793c16a21b Add warning messages to catch weird not skipping bug 2022-05-17 13:33:26 -04:00
Ajay
52dc697635 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-05-16 14:33:02 -04:00
Ajay
36689ed886 Don't use hide buttons for auto hiding skipt to highlight
Fixes #1318
2022-05-16 14:32:59 -04:00
Michael C
4d4689a190 add selector for mobile YT chapters #1287 2022-05-10 20:51:32 -04:00
Florian Wendelborn
78aaffb8d8 Add iOS info (#1307) 2022-05-07 01:08:25 -04:00
Ajay
b82e43bb93 bump version 2022-05-06 14:14:48 -04:00
Ajay
8eef3a3ce5 Revert "Refresh segments when submitting"
Fixes #1295
2022-05-06 14:11:11 -04:00
Ajay
063845d513 bump version 2022-05-05 09:03:55 -04:00
Ajay
7353a2ac0d Fix extra requests being made 2022-05-05 09:03:37 -04:00
Nikita Krupin
50aaea0dd2 Merge branch 'master' into master 2022-05-04 18:56:32 -04:00
Ajay Ramachandran
5e733fddad Merge pull request #1293 from AlecRust/consistent-vote-buttons
Fix vote button hover inconsistency
2022-05-03 20:03:02 -04:00
Ajay Ramachandran
5d48e87e0b New Crowdin updates (#1292) 2022-05-03 20:02:35 -04:00
Ajay Ramachandran
e86f5a1a59 bump version 2022-05-03 20:02:27 -04:00
Ajay
2d2bd36abb Add note about misleading name 2022-05-03 15:14:57 -04:00
Ajay
e72f3b1a12 Fix button not appearing when starting at a channel trailer 2022-05-03 14:53:26 -04:00
Ajay
fd260f4caa Fix old video ids potentially being fetched 2022-05-03 14:28:05 -04:00
Nikita Krupin
ccc1f4cad1 popup.css organization in topological order 2022-05-03 00:05:04 -04:00
Nikita Krupin
42511cb667 popup.html code cleanup & simplification 2022-05-02 22:26:51 -04:00
Nikita Krupin
123d7af5eb mainControls better spacing 2022-05-02 21:32:54 -04:00
Nikita Krupin
44f2de42db tooltip spacing unit fixes 2022-05-02 21:28:22 -04:00
Nikita Krupin
e4dd0f1ac6 popup styling requested adjustments 2022-05-02 21:22:25 -04:00
Nikita Krupin
9fdce8e814 popup link transition fix 2022-05-01 23:07:03 -04:00
Nikita Krupin
813b2df1ac popup styling tweaks 2022-05-01 22:50:58 -04:00
github-actions[bot]
95696e23fe Update Invidious List (#1299)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-30 23:16:28 -04:00
Alec Rust
463ce258bf Fix @typescript-eslint/no-unused-vars lint warnings 2022-04-23 15:44:21 +01:00
Alec Rust
0bf8368686 Fix up vote button CSS 2022-04-23 14:51:52 +01:00
Ajay
0c216792cf Don't show duplicate skip notices 2022-04-23 00:10:46 -04:00
Ajay
dd447297f9 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2022-04-22 22:17:27 -04:00
Ajay
1a908b5038 Add tooltips to vote buttons in popup 2022-04-22 22:17:25 -04:00
Ajay Ramachandran
ba629e9c9e bump version 2022-04-22 15:43:20 -04:00
Ajay Ramachandran
fb11242dd5 New Crowdin updates (#1233) 2022-04-22 15:26:56 -04:00
Ajay Ramachandran
aa88ab1985 Merge pull request #1237 from AlecRust/refine-popup
Improve popup alert and fix Firefox issues
2022-04-22 15:26:30 -04:00
Ajay
b075116502 Make it show skip right away instead of unskip on mute segments
Fixes #1075
2022-04-22 15:18:58 -04:00
Ajay
9e02e35c4d Keep skip notice open for full duration of mute segments 2022-04-22 02:41:27 -04:00
Ajay
d7e67fb397 Add skip button to mute segment notices
Fixes #1075
2022-04-22 02:33:07 -04:00
Ajay
f2172bb2ad Don't show never show when already hidden 2022-04-21 21:33:22 -04:00
Ajay
c773b4ecd1 Enter unskip with skip notice hidden 2022-04-21 21:28:25 -04:00
Ajay
9f02bf4ce2 Show both chapter names when small chapter in big chapter 2022-04-21 14:54:57 -04:00
Ajay Ramachandran
9bad5ed324 Merge pull request #1291 from mchangrh/userInfo-isVip
remove lastIsVipUpdate from config
2022-04-19 18:48:49 -04:00
Michael C
93bb016b4f remove lastIsVipUpdate from config 2022-04-19 18:45:48 -04:00
Ajay Ramachandran
8c901d5bad Merge pull request #1290 from mchangrh/userInfo-isVip
reuse userinfo for isVip and remove lastIsVipUpdate
2022-04-19 18:45:36 -04:00
Michael C
ac533c612c reuse userinfo for isVip and remove lastIsVipUpdate 2022-04-19 18:41:06 -04:00
Ajay Ramachandran
21e9dd870d Merge pull request #1284 from mini-bomba/segmentEditPreview-patch1
Start playback of edited segment at it's end when it starts 0:00
2022-04-19 13:42:58 -04:00
mini-bomba
e3f6242e5f Start playback of edited segment at it's end when it starts 0:00 2022-04-15 22:31:46 +02:00
Alec Rust
a47fa20652 Integrate new "beta server alert" into popup CSS 2022-04-15 16:20:48 +01:00
Alec Rust
fa0c890633 Disable popup max height when displayed in-page 2022-04-15 16:12:16 +01:00
Alec Rust
d7d12e1618 Set max height on popup
#778
2022-04-15 16:12:16 +01:00
Alec Rust
82bdc28305 Fix popup width issues in Firefox
fixes #778
2022-04-15 16:12:16 +01:00
Alec Rust
7c4f649016 Fix gutter when popup is very narrow 2022-04-15 16:12:15 +01:00
Alec Rust
d937a2ae59 Remove unnecessary flexbox usage 2022-04-15 16:12:15 +01:00
Alec Rust
d19fcd2a4c Fix spacing regression
closes #1235
2022-04-15 16:12:15 +01:00
Alec Rust
9b4c4afa35 Hide "consider force channel check" alert when removed from whitelist 2022-04-15 16:12:15 +01:00
Alec Rust
c5b00f67a1 Refine "consider force channel check" alert 2022-04-15 16:12:15 +01:00
Alec Rust
6f79e986ba Reduce "cursor: pointer" repetition and tidy 2022-04-15 16:12:15 +01:00
Ajay
8aa10605c5 Refresh segments when submitting 2022-04-12 10:35:25 -04:00
Ajay
44421c4b5d Refresh segments on config change 2022-04-12 10:29:44 -04:00
Ajay Ramachandran
fbbd6de0ff Merge pull request #1259 from mchangrh/bumpDependencies
bump dependencies
2022-04-11 01:31:06 -04:00
Ajay Ramachandran
c6e3d11071 Merge pull request #1276 from MRuy/beta-server-warning
Add beta server warning to popup
2022-04-11 01:28:52 -04:00
Ajay
6325d3539c Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-04-11 01:26:39 -04:00
Ajay Ramachandran
ae7f1f228f fix toggle to always remove 2022-04-09 11:56:56 -04:00
Nanobyte
d353f3b677 Add beta server warning to popup
#1275
2022-04-09 16:22:39 +02:00
Ajay Ramachandran
42eceb3efd Merge pull request #1274 from ajayyy/dependabot/npm_and_yarn/moment-2.29.2
Bump moment from 2.29.1 to 2.29.2
2022-04-09 01:29:35 -04:00
dependabot[bot]
6f5586d656 Bump moment from 2.29.1 to 2.29.2
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-09 04:42:15 +00:00
Ajay Ramachandran
9bea04dfc2 Merge pull request #1273 from mchangrh/miscFixes
Misc fixes
2022-04-08 23:39:34 -04:00
Michael C
0d34e643c7 fix #1236 2022-04-08 22:36:44 -04:00
Michael C
88f60c0e84 close #1265 2022-04-08 22:03:00 -04:00
Michael C
964a277331 adjust lint to ignore children props 2022-04-01 00:26:27 -04:00
Michael C
057c7792df bump dependencies + reduce build time by 1/3
- drop webpack to 5.64 to fix 1 security issue, the rest depend on web-ext
2022-03-31 23:02:55 -04:00
github-actions[bot]
bd6372d944 Update Invidious List 2022-03-31 20:32:07 -04:00
Ajay Ramachandran
0d31b8276c Merge pull request #1250 from zedseven/channel-id-lookup-optimisations
Improve the channel ID lookup.
2022-03-28 15:43:59 -04:00
Ajay
b15a8db651 Fix close skips not overlapping 2022-03-28 15:33:15 -04:00
Zacchary Dempsey-Plante
9f1f9f84d4 Improve the channel ID lookup. 2022-03-26 23:09:24 -04:00
Ajay Ramachandran
9477ad425c Merge branch 'master' into chapters 2022-03-12 16:56:53 -05:00
Tad Wohlrapp
a64deb2e18 Fix minor typos and inconsistencies 2022-03-08 19:57:09 +01:00
Ajay
f81cfbecfe Add functions for importing/exporting segments 2022-02-26 01:07:29 -05:00
Ajay
eb35f5c543 Don't display existing chapters twice 2022-02-24 21:53:45 -05:00
Ajay
7d8188d575 Add importing chapters for cases with unsubmitted segments 2022-02-24 02:21:22 -05:00
Ajay
00ab317a3e Fix active segments when no real segments 2022-02-24 02:06:00 -05:00
Ajay
0536d419e5 Hide YouTube chapters from popup 2022-02-23 01:39:53 -05:00
Ajay
4d5c9005ae Fix stackoverflow 2022-02-23 01:37:19 -05:00
Ajay
0513a36a9a Fix chapters getting imported multiple times 2022-02-23 01:30:07 -05:00
Ajay
1ec184048c Fix chapter sorting 2022-02-23 01:24:15 -05:00
Ajay
2b811c5ab4 Include unsubmitted in active segment label 2022-02-23 01:12:19 -05:00
Ajay
ea91701430 Improve chapter generation performance by reusing elements
Also ensure large segments don't break chapter bar
2022-02-23 01:06:08 -05:00
Ajay
9654fabc3c remove old todo 2022-02-22 21:34:27 -05:00
Ajay
2ebc5489cd Load existing chapters 2022-02-22 21:22:30 -05:00
Ajay
cf3b3c5c48 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-02-22 01:34:12 -05:00
Ajay
930bc113fe Add sort segments button 2022-02-21 11:17:58 -05:00
Ajay
7aaa28b5c2 Fix transition issue 2022-02-21 01:02:23 -05:00
Ajay
bd3976e4c6 Add option to not render as chapters 2022-02-21 00:29:13 -05:00
Ajay
4e5a883d2e Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-02-20 18:37:18 -05:00
Ajay
e1de84dce3 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-01-21 20:20:27 -05:00
Ajay
9ce714fd36 Merge branch 'chapters' of https://github.com/ajayyy/SponsorBlock into chapters 2022-01-21 20:18:43 -05:00
Ajay
46983bec24 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-01-21 20:18:42 -05:00
Ajay
9d65df84be Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-01-21 20:17:34 -05:00
Ajay
e2d56d32fe Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2022-01-16 15:58:09 -05:00
Ajay
7895b9d2c1 Fix crash from preview bar not being defined yet 2022-01-02 22:44:15 -05:00
Ajay
63f6702f86 Fix chapter bar breaking when adding new unsubmitted segments 2021-12-30 01:08:54 -05:00
Ajay
02bc554b0e Fix progress not starting at full 2021-12-30 01:05:59 -05:00
Ajay
c3933a4eee reduce returned variables 2021-12-30 00:39:03 -05:00
Ajay
68c1f780d5 Fix sometimes not rendering chapters when no existing chapters 2021-12-30 00:35:39 -05:00
Ajay
496ef87a28 Reduce issues in rendering over existing chapters by replacing walking method with direct loop 2021-12-30 00:22:13 -05:00
Ajay
22e85f715d Add initial code to support drawing when there are existing chapters 2021-12-29 02:16:49 -05:00
Ajay
1a6a07744e Don't break chapter bar when existing chapters are there 2021-12-26 01:18:55 -05:00
Ajay
4a19fececf Always set segment source 2021-12-26 00:17:49 -05:00
Ajay
322a1483df Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2021-12-25 22:14:34 -05:00
Ajay
ab1520c560 Show both categories and chapter names in hover text 2021-12-25 01:09:34 -05:00
Ajay
e4f4a10965 Fix seek bar chapter name not updating and schedule end times 2021-12-24 21:52:33 -05:00
Ajay
05153a152d Add skip button to popup for segments and chapters 2021-12-24 20:35:36 -05:00
Ajay
798fd8b3f3 Add tabs for chapters and other segments 2021-12-24 02:13:25 -05:00
Ajay Ramachandran
c38cc07e0a Fix stack overflow issue with unfinished preview segments 2021-11-07 16:09:01 -05:00
Ajay Ramachandran
af547ce745 Show category description in popup 2021-11-07 15:38:41 -05:00
Ajay Ramachandran
0d0459a3a3 Make tests have config.json 2021-11-07 15:31:08 -05:00
Ajay Ramachandran
7dfee81188 Add chapter sorting method to show small chapters in the middle of large ones 2021-11-07 15:26:00 -05:00
Ajay Ramachandran
3a2d9c0e0e Update options page for chapters 2021-11-07 01:12:01 -05:00
Ajay Ramachandran
8e022bfb28 Fix offset on popup for chapters 2021-11-07 01:06:34 -05:00
Ajay Ramachandran
a69c19581d Fix chapter bar showing as empty sometimes 2021-11-07 01:28:23 -04:00
Ajay Ramachandran
a3e67b6cde Add chapter name autocomplete 2021-11-07 01:05:32 -04:00
Ajay Ramachandran
9e6e3b023d Fix small time differences between segments causing issues 2021-11-06 21:20:36 -04:00
Ajay Ramachandran
33cfe3f5d3 Show description in hover bar 2021-11-06 19:57:46 -04:00
Ajay Ramachandran
4a2ebe4b03 Fix undefined error when making segment 2021-11-04 00:34:21 -04:00
Ajay Ramachandran
374f0992ff Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2021-11-04 00:31:29 -04:00
Ajay Ramachandran
7814493974 Fix preview bar width and remove chapter refresh check 2021-11-04 00:25:58 -04:00
Ajay Ramachandran
f5fa758ac1 Don't shrink preview bar if segment not a chapter 2021-11-02 23:33:19 -04:00
Ajay Ramachandran
517e53a2e3 Fix small segments breaking chapters 2021-11-01 21:44:39 -04:00
Ajay Ramachandran
fb3635cdf8 Fix animation when chapter bar is recreated 2021-11-01 21:18:03 -04:00
Ajay Ramachandran
a804da06f5 Update chapter bar progress right after clone 2021-11-01 21:10:43 -04:00
Ajay Ramachandran
9ed9f9b873 Only create one chapter bar, support videos with no segments and preview segments 2021-11-01 20:59:04 -04:00
Ajay Ramachandran
b4a2f31520 Render preview bar behind scrubber 2021-10-30 21:48:52 -04:00
Ajay Ramachandran
c7acb902a4 Fix issues with hover failing after hovering scrubber 2021-10-30 21:32:54 -04:00
Ajay Ramachandran
37ac5c8cbd Listen for class changes for ytp-hover-progress-light and fix left 2021-10-30 15:11:22 -04:00
Ajay Ramachandran
bf4eb8fafc Fix z-index not applying 2021-10-29 00:02:46 -04:00
Ajay Ramachandran
7c4a0628b7 Add growing chapter on hover 2021-10-28 23:57:53 -04:00
Ajay Ramachandran
2d3e293d83 Support left style changes for chapters bar and fix negative size 2021-10-28 00:38:46 -04:00
Ajay Ramachandran
6dee56dc95 Add mutation listener to update progress indicators 2021-10-27 23:21:22 -04:00
Ajay Ramachandran
4c9548b303 Add basic chapter rendering for segments 2021-10-26 20:18:08 -04:00
Ajay Ramachandran
fd69e91880 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2021-10-17 19:25:16 -04:00
Ajay Ramachandran
0f4eeb4fe9 Add chapter name option when submitting 2021-10-16 01:36:44 -04:00
Ajay Ramachandran
9a24b906f9 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2021-10-15 19:57:18 -04:00
Ajay Ramachandran
496528be65 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into chapters 2021-10-14 21:58:37 -04:00
Ajay Ramachandran
f2c1ee4894 Use default action type from config 2021-10-14 00:03:48 -04:00
Ajay Ramachandran
acd2720372 Add messages for chapter 2021-10-13 23:50:17 -04:00
Ajay Ramachandran
e20b60979c Add initial chapter name rendering 2021-10-12 23:33:41 -04:00
134 changed files with 17301 additions and 13394 deletions

View File

@@ -1,33 +0,0 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jest: true,
jasmine: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
rules: {
// TODO: Remove warn rules when not needed anymore
"no-self-assign": "off",
"@typescript-eslint/no-empty-interface": "off",
},
settings: {
react: {
version: "detect",
},
},
};

34
.eslintrc.json Normal file
View File

@@ -0,0 +1,34 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"no-self-assign": "off",
"@typescript-eslint/no-empty-interface": "off",
"react/prop-types": [2, { "ignore": ["children"] }],
"@typescript-eslint/member-delimiter-style": "warn"
},
"settings": {
"react": {
"version": "detect"
}
}
}

View File

@@ -10,10 +10,12 @@ jobs:
steps:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
node-version: '16'
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- name: Copy configuration
run: cp config.json.example config.json
@@ -25,44 +27,44 @@ jobs:
# Create Chrome artifacts
- name: Create Chrome artifacts
run: npm run build:chrome
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ChromeExtension
path: dist
- run: mkdir ./builds
- uses: montudor/action-zip@v1
- uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28
with:
args: zip -qq -r ./builds/ChromeExtension.zip ./dist
# Create Firefox artifacts
- name: Create Firefox artifacts
run: npm run build:firefox
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: FirefoxExtension
path: dist
- uses: montudor/action-zip@v1
- uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28
with:
args: zip -qq -r ./builds/FirefoxExtension.zip ./dist
# Create Beta artifacts (Builds with the name changed to beta)
- name: Create Chrome Beta artifacts
run: npm run build:chrome -- --env stream=beta
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ChromeExtensionBeta
path: dist
- uses: montudor/action-zip@v1
- uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28
with:
args: zip -qq -r ./builds/ChromeExtensionBeta.zip ./dist
- name: Create Firefox Beta artifacts
run: npm run build:firefox -- --env stream=beta
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: FirefoxExtensionBeta
path: dist
- uses: montudor/action-zip@v1
- uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28
with:
args: zip -qq -r ./builds/FirefoxExtensionBeta.zip ./dist

View File

@@ -12,98 +12,93 @@ jobs:
steps:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
node-version: '16'
- run: npm ci
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Copy configuration
run: cp config.json.example config.json
# Create source artifact with submodule
- name: Create directory
run: cd ..; mkdir ./builds
- name: Zip Source code
run: zip -r ../builds/SourceCodeUseThisOne.zip *
- name: Upload Source to release
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: ../builds/SourceCodeUseThisOne.zip
name: SourceCodeUseThisOne.zip
path: ../builds/SourceCodeUseThisOne.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: npm ci
# Create Chrome artifacts
- name: Create Chrome artifacts
run: npm run build:chrome
- uses: actions/upload-artifact@v2
with:
name: ChromeExtension
path: dist
- run: mkdir ./builds
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/ChromeExtension.zip *
# Create Firefox artifacts
- name: Create Firefox artifacts
run: npm run build:firefox
- uses: actions/upload-artifact@v2
with:
name: FirefoxExtension
path: dist
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/FirefoxExtension.zip *
# Create Beta artifacts (Builds with the name changed to beta)
- name: Create Chrome Beta artifacts
run: npm run build:chrome -- --env stream=beta
- uses: actions/upload-artifact@v2
with:
name: ChromeExtensionBeta
path: dist
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/ChromeExtensionBeta.zip *
# Create Safari artifacts
- name: Create Safari artifacts
run: npm run build:safari
- uses: actions/upload-artifact@v2
with:
name: SafariExtension
path: dist
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/SafariExtension.zip *
# Create Edge artifacts
- name: Clear dist for Edge
run: rm -rf ./dist
- name: Create Edge artifacts
run: npm run build:edge
- uses: actions/upload-artifact@v2
with:
name: EdgeExtension
path: dist
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/EdgeExtension.zip *
# Upload each release asset
- name: Upload ChromeExtension to release
uses: Shopify/upload-to-release@master
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: builds/ChromeExtension.zip
name: ChromeExtension.zip
path: ./builds/ChromeExtension.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ChromeExtensionBeta to release
uses: Shopify/upload-to-release@master
with:
args: builds/ChromeExtensionBeta.zip
name: ChromeExtensionBeta.zip
path: ./builds/ChromeExtensionBeta.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Create Firefox artifacts
- name: Create Firefox artifacts
run: npm run build:firefox
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/FirefoxExtension.zip *
- name: Upload FirefoxExtension to release
uses: Shopify/upload-to-release@master
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: builds/FirefoxExtension.zip
name: FirefoxExtension.zip
path: ./builds/FirefoxExtension.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Create Beta artifacts (Builds with the name changed to beta)
- name: Create Chrome Beta artifacts
run: npm run build:chrome -- --env stream=beta
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/ChromeExtensionBeta.zip *
- name: Upload ChromeExtensionBeta to release
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: builds/ChromeExtensionBeta.zip
name: ChromeExtensionBeta.zip
path: ./builds/ChromeExtensionBeta.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Create Safari artifacts
- name: Create Safari artifacts
run: npm run build:safari
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/SafariExtension.zip *
- name: Upload SafariExtension to release
uses: Shopify/upload-to-release@master
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: builds/SafariExtension.zip
name: SafariExtension.zip
path: ./builds/SafariExtension.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Create Edge artifacts
- name: Clear dist for Edge
run: rm -rf ./dist
- name: Create Edge artifacts
run: npm run build:edge
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/EdgeExtension.zip *
- name: Upload EdgeExtension to release
uses: Shopify/upload-to-release@master
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: builds/EdgeExtension.zip
name: EdgeExtension.zip
@@ -113,7 +108,7 @@ jobs:
# Firefox Beta
- name: Create Firefox Beta artifacts
run: npm run build:firefox -- --env stream=beta
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: FirefoxExtensionBeta
path: dist
@@ -130,13 +125,13 @@ jobs:
run: sudo apt-get install rename
- name: Rename signed file
run: cd ./web-ext-artifacts ; rename 's/.*/FirefoxSignedInstaller.xpi/' *
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: FirefoxExtensionSigned.xpi
path: ./web-ext-artifacts/FirefoxSignedInstaller.xpi
- name: Upload FirefoxSignedInstaller.xpi to release
uses: Shopify/upload-to-release@master
uses: Shopify/upload-to-release@07611424e04f1475ddf550e1c0dd650b867d5467
with:
args: web-ext-artifacts/FirefoxSignedInstaller.xpi
name: FirefoxSignedInstaller.xpi

View File

@@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: take the issue
uses: bdougie/take-action@main
uses: bdougie/take-action@28b86cd8d25593f037406ecbf96082db2836e928
env:
GITHUB_TOKEN: ${{ github.token }}

View File

@@ -3,18 +3,29 @@ name: Tests
on: [push, pull_request]
jobs:
build:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
node-version: '16'
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: sudo apt-get install chromium-chromedriver
- name: Copy configuration
run: cp config.json.example config.json
- name: Run tests
run: npm run test-without-building
run: npm run test
- name: Upload results on fail
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: Test Results
path: ./test-results

View File

@@ -12,20 +12,25 @@ jobs:
update-oss:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
node-version: '16'
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install and generate attribution
run: |
npm ci
npm i -g oss-attribution-generator
generate-attribution
mv ./oss-attribution/attribution.txt ./public/oss-attribution/attribution.txt
- name: Prettify attributions
run: |
cd ci && npx ts-node prettify.ts
- name: Create pull request to update list
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
# v4.2.3
with:
commit-message: Update OSS Attribution
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

View File

@@ -8,8 +8,9 @@ jobs:
check-list:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Download instance list
run: |
wget https://api.invidious.io/instances.json -O ci/data.json
@@ -19,7 +20,8 @@ jobs:
run: npm run ci:invidious
- name: Create pull request to update list
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
# v4.2.3
with:
commit-message: Update Invidious List
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

3
.gitignore vendored
View File

@@ -7,4 +7,5 @@ web-ext-artifacts
dist/
tmp/
.DS_Store
ci/data.json
ci/data.json
test-results

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "public/_locales"]
path = public/_locales
url = https://github.com/ajayyy/ExtensionTranslations

View File

@@ -5,7 +5,7 @@
<sub>Logo by <a href="https://github.com/munadikieh">@munadikieh</a></sub>
</p>
<h1 align="center">SponsorLock</h1>
<h1 align="center">SponsorBlock</h1>
<p align="center">
<b>Download:</b>
@@ -13,7 +13,7 @@
<a href="https://addons.mozilla.org/addon/sponsorblock/?src=external-github">Firefox</a> |
<a href="https://github.com/ajayyy/SponsorBlock/wiki/Android">Android</a> |
<a href="https://github.com/ajayyy/SponsorBlock/wiki/Edge">Edge</a> |
<a href="https://github.com/ajayyy/SponsorBlock/wiki/Safari">Safari for MacOS</a> |
<a href="https://github.com/ajayyy/SponsorBlock/wiki/Safari">Safari for MacOS and iOS</a> |
<a href="https://sponsor.ajay.app">Website</a> |
<a href="https://sponsor.ajay.app/stats">Stats</a>
</p>
@@ -36,7 +36,7 @@
SponsorLock is an open-source crowdsourced browser extension to isolate sponsor segments in YouTube videos. Users submit when a sponsor happens from the extension, and the extension only shows you sponsor segments.
SponsorBlock is an open-source crowdsourced browser extension to skip sponsor segments in YouTube videos. Users submit when a sponsor happens from the extension, and the extension automatically skips sponsors it knows about. It also supports skipping other categories, such as intros, outros and reminders to subscribe.
It also supports Invidio.us.
@@ -62,17 +62,29 @@ You can read the API docs [here](https://wiki.sponsor.ajay.app/index.php/API_Doc
You must have [Node.js 16](https://nodejs.org/) and npm installed.
1. Copy the file `config.json.example` to `config.json` and adjust configuration as desired.
1. Clone with submodules
```bash
git clone https://github.com/ajayyy/SponsorBlock --recurse-submodules=yes
```
Or if you already cloned it, pull submodules with
```bash
git submodule update --init --recursive
```
2. Copy the file `config.json.example` to `config.json` and adjust configuration as desired.
- You will need to repeat this step in the future if you get build errors related to `CompileConfig`. This can happen for example when a new category is added.
2. Run `npm install` in the repository to install dependencies.
3. Run `npm install` in the repository to install dependencies.
3. Run `npm run build:dev` (for Chrome) or `npm run build:dev:firefox` (for Firefox) to generate a development version of the extension with source maps.
4. Run `npm run build:dev` (for Chrome) or `npm run build:dev:firefox` (for Firefox) to generate a development version of the extension with source maps.
- You can also run `npm run build` (for Chrome) or `npm run build:firefox` (for Firefox) to generate a production build.
4. The built extension is now in `dist/`. You can load this folder directly in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/#manifest), or convert it to a zip file to load it as a [temporary extension](https://developer.mozilla.org/en-US/docs/Tools/about:debugging#loading_a_temporary_extension) in Firefox.
5. The built extension is now in `dist/`. You can load this folder directly in Chrome as an [unpacked extension](https://developer.chrome.com/docs/extensions/mv3/getstarted/#manifest), or convert it to a zip file to load it as a [temporary extension](https://developer.mozilla.org/en-US/docs/Tools/about:debugging#loading_a_temporary_extension) in Firefox.
### Developing with a clean profile and hot reloading

View File

@@ -16,10 +16,10 @@ if (!existsSync(join(__dirname, "data.json"))) {
import * as data from "../ci/data.json";
type instanceMap = {
name: string,
url: string,
dailyRatios: {ratio: string, label: string }[],
thirtyDayUptime: string
name: string;
url: string;
dailyRatios: {ratio: string; label: string }[];
thirtyDayUptime: string;
}[]
// only https servers
@@ -49,7 +49,7 @@ const reliableCheck = mapped
.filter(instance => instance.url.includes(instance.name))
// finally map to array
const result: string[] = reliableCheck.map(instance => instance.name)
const result: string[] = reliableCheck.map(instance => instance.name).sort()
writeFile(join(__dirname, "./invidiouslist.json"), JSON.stringify(result), (err) => {
if (err) return console.log(err);
})

View File

@@ -1 +1 @@
["yewtu.be","invidious.snopyta.org","vid.puffyan.us","invidious.kavin.rocks","invidio.xamh.de","inv.riverside.rocks","invidious-us.kavin.rocks","invidious.osi.kr","tube.cthd.icu","yt.artemislena.eu","youtube.076.ne.jp","invidious.namazso.eu"]
["inv.bp.projectsegfau.lt","inv.odyssey346.dev","inv.riverside.rocks","inv.vern.cc","invidious.baczek.me","invidious.epicsite.xyz","invidious.esmailelbob.xyz","invidious.flokinet.to","invidious.lidarshield.cloud","invidious.nerdvpn.de","invidious.privacydev.net","invidious.snopyta.org","invidious.tiekoetter.com","invidious.weblibre.org","iv.melmac.space","vid.puffyan.us","watch.thekitty.zone","y.com.sb","yewtu.be","yt.artemislena.eu","yt.funami.tech","yt.oelrichsgarcia.de"]

6
ci/prettify.ts Normal file
View File

@@ -0,0 +1,6 @@
import { writeFile } from 'fs';
import * as license from "../oss-attribution/licenseInfos.json";
const result = JSON.stringify(license, null, 2);
writeFile("../oss-attribution/licenseInfos.json", result, err => { if (err) return console.log(err) } );

View File

@@ -2,7 +2,7 @@
"serverAddress": "https://sponsor.ajay.app",
"testingServerAddress": "https://sponsor.ajay.app/test",
"serverAddressComment": "This specifies the default SponsorBlock server to connect to",
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "filler", "music_offtopic"],
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "filler", "chapter", "music_offtopic"],
"categorySupport": {
"sponsor": ["skip", "mute", "full"],
"selfpromo": ["skip", "mute", "full"],
@@ -13,7 +13,8 @@
"preview": ["skip", "mute"],
"filler": ["skip", "mute"],
"music_offtopic": ["skip"],
"poi_highlight": ["poi"]
"poi_highlight": ["poi"],
"chapter": ["chapter"]
},
"wikiLinks": {
"sponsor": "https://wiki.sponsor.ajay.app/w/Sponsor",
@@ -27,6 +28,13 @@
"music_offtopic": "https://wiki.sponsor.ajay.app/w/Music:_Non-Music_Section",
"poi_highlight": "https://wiki.sponsor.ajay.app/w/Highlight",
"guidelines": "https://wiki.sponsor.ajay.app/w/Guidelines",
"mute": "https://wiki.sponsor.ajay.app/w/Mute_Segment"
}
"mute": "https://wiki.sponsor.ajay.app/w/Mute_Segment",
"chapter": "https://wiki.sponsor.ajay.app/w/Chapter"
},
"extensionCommunicationAllowList": [
"enamippconapkdmgfgjchkhakpfinmaj",
"deArrow@ajay.app",
"deArrowBETA@ajay.app",
"app.ajay.dearrow.extension"
]
}

View File

@@ -5,4 +5,5 @@ module.exports = {
"transform": {
"^.+\\.ts$": "ts-jest"
},
"reporters": ["default", "github-actions"]
};

View File

@@ -1,2 +1,8 @@
{
"optional_permissions": [
"declarativeContent"
],
"background": {
"persistent": false
}
}

View File

@@ -1,7 +1,7 @@
{
"browser_specific_settings": {
"gecko": {
"id": "sponsorLockAprilFools@ajay.app"
"id": "sponsorBlocker@ajay.app"
}
}
}

View File

@@ -1,9 +1,9 @@
{
"name": "SponsorLock - Give Back Control!",
"short_name": "SponsorLock",
"version": "4.2.3",
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "5.4.8",
"default_locale": "en",
"description": "SponsorLock only shows you promotion, and skips all useful informaton.",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
"content_scripts": [{
"run_at": "document_start",
@@ -17,71 +17,124 @@
],
"css": [
"content.css",
"shared.css",
"./libs/Source+Sans+Pro.css",
"popup.css"
]
}],
"web_accessible_resources": [{
"resources": [
"icons/LogoSponsorBlocker256px.png",
"icons/IconSponsorBlocker256px.png",
"icons/PlayerStartIconSponsorBlocker.svg",
"icons/PlayerStopIconSponsorBlocker.svg",
"icons/PlayerUploadIconSponsorBlocker.svg",
"icons/PlayerUploadFailedIconSponsorBlocker.svg",
"icons/PlayerCancelSegmentIconSponsorBlocker.svg",
"icons/clipboard.svg",
"icons/settings.svg",
"icons/pencil.svg",
"icons/check.svg",
"icons/upvote.png",
"icons/downvote.png",
"icons/thumbs_down.svg",
"icons/thumbs_down_locked.svg",
"icons/thumbs_up.svg",
"icons/help.svg",
"icons/report.png",
"icons/close.png",
"icons/skipIcon.svg",
"icons/refresh.svg",
"icons/beep.ogg",
"icons/pause.svg",
"icons/stop.svg",
"icons/heart.svg",
"icons/visible.svg",
"icons/not_visible.svg",
"icons/PlayerInfoIconSponsorBlocker.svg",
"icons/PlayerDeleteIconSponsorBlocker.svg",
"popup.html",
"content.css"
],
"matches": ["<all_urls>"]
}],
"permissions": [
"storage"
"web_accessible_resources": [
"icons/LogoSponsorBlocker256px.png",
"icons/IconSponsorBlocker256px.png",
"icons/PlayerStartIconSponsorBlocker.svg",
"icons/PlayerStopIconSponsorBlocker.svg",
"icons/PlayerUploadIconSponsorBlocker.svg",
"icons/PlayerUploadFailedIconSponsorBlocker.svg",
"icons/PlayerCancelSegmentIconSponsorBlocker.svg",
"icons/clipboard.svg",
"icons/settings.svg",
"icons/pencil.svg",
"icons/check.svg",
"icons/check-smaller.svg",
"icons/upvote.png",
"icons/downvote.png",
"icons/thumbs_down.svg",
"icons/thumbs_down_locked.svg",
"icons/thumbs_up.svg",
"icons/help.svg",
"icons/report.png",
"icons/close.png",
"icons/skipIcon.svg",
"icons/refresh.svg",
"icons/beep.ogg",
"icons/pause.svg",
"icons/stop.svg",
"icons/skip.svg",
"icons/heart.svg",
"icons/visible.svg",
"icons/not_visible.svg",
"icons/sort.svg",
"icons/money.svg",
"icons/segway.png",
"icons/close-smaller.svg",
"icons/right-arrow.svg",
"icons/campaign.svg",
"icons/star.svg",
"icons/lightbulb.svg",
"icons/bolt.svg",
"icons/stopwatch.svg",
"icons/music-note.svg",
"icons/import.svg",
"icons/export.svg",
"icons/PlayerInfoIconSponsorBlocker.svg",
"icons/PlayerDeleteIconSponsorBlocker.svg",
"popup.html",
"popup.css",
"content.css",
"shared.css",
"js/document.js",
"libs/Source+Sans+Pro.css",
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2",
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2",
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2",
"libs/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2"
],
"host_permissions": [
"permissions": [
"storage",
"https://sponsor.ajay.app/*"
],
"action": {
"optional_permissions": [
"*://*/*",
"webNavigation"
],
"browser_action": {
"default_title": "SponsorBlock",
"default_popup": "popup.html"
"default_popup": "popup.html",
"default_icon": {
"16": "icons/IconSponsorBlocker16px.png",
"32": "icons/IconSponsorBlocker32px.png",
"64": "icons/IconSponsorBlocker64px.png",
"128": "icons/IconSponsorBlocker128px.png"
},
"theme_icons": [
{
"light": "icons/IconSponsorBlocker16px.png",
"dark": "icons/IconSponsorBlocker16px.png",
"size": 16
},
{
"light": "icons/IconSponsorBlocker32px.png",
"dark": "icons/IconSponsorBlocker32px.png",
"size": 32
},
{
"light": "icons/IconSponsorBlocker64px.png",
"dark": "icons/IconSponsorBlocker64px.png",
"size": 64
},
{
"light": "icons/IconSponsorBlocker128px.png",
"dark": "icons/IconSponsorBlocker128px.png",
"size": 128
}
]
},
"background": {
"service_worker": "./js/background.js"
"scripts":[
"./js/background.js"
]
},
"icons": {
"16": "icons/LogoSponsorBlocker64px.png",
"32": "icons/LogoSponsorBlocker64px.png",
"64": "icons/LogoSponsorBlocker64px.png",
"128": "icons/LogoSponsorBlocker128px.png",
"256": "icons/LogoSponsorBlocker256px.png",
"512": "icons/LogoSponsorBlocker512px.png",
"1024": "icons/LogoSponsorBlocker1024px.png"
"16": "icons/IconSponsorBlocker16px.png",
"32": "icons/IconSponsorBlocker32px.png",
"64": "icons/IconSponsorBlocker64px.png",
"128": "icons/IconSponsorBlocker128px.png",
"256": "icons/IconSponsorBlocker256px.png",
"512": "icons/IconSponsorBlocker512px.png",
"1024": "icons/IconSponsorBlocker1024px.png"
},
"options_ui": {
"page": "options/lock-options.html",
"page": "options/options.html",
"open_in_tab": true
},
"manifest_version": 3
"manifest_version": 2
}

File diff suppressed because one or more lines are too long

16837
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,36 +4,40 @@
"description": "",
"main": "background.js",
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@ajayyy/maze-utils": "1.1.29",
"content-scripts-register-polyfill": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/chrome": "^0.0.178",
"@types/firefox-webext-browser": "^94.0.1",
"@types/jest": "^27.4.0",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/selenium-webdriver": "^4.0.17",
"@types/wicg-mediasession": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2",
"chromedriver": "^97.0.4",
"concurrently": "^7.0.0",
"copy-webpack-plugin": "^10.2.4",
"eslint": "^8.8.0",
"eslint-plugin-react": "^7.28.0",
"jest": "^27.5.0",
"rimraf": "^3.0.2",
"@types/chrome": "^0.0.220",
"@types/firefox-webext-browser": "^111.0.0",
"@types/jest": "^29.4.0",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@types/selenium-webdriver": "^4.1.13",
"@types/wicg-mediasession": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"chromedriver": "^110.0.0",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.35.0",
"eslint-plugin-react": "^7.32.2",
"fork-ts-checker-webpack-plugin": "^7.3.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"rimraf": "^4.3.1",
"schema-utils": "^4.0.0",
"selenium-webdriver": "^4.1.1",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.6",
"ts-node": "^10.4.0",
"typescript": "4.5",
"web-ext": "^6.6.0",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-merge": "^4.2.2"
"selenium-webdriver": "^4.8.1",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "4.9",
"web-ext": "^7.6.2",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-merge": "^5.8.0"
},
"scripts": {
"web-run": "npm run web-run:chrome",
@@ -63,12 +67,12 @@
"lint:fix": "eslint src --fix"
},
"engines": {
"node": ">=12.20.0"
"node": ">=16"
},
"funding": [
{
"type": "individual",
"url": "hhttps://sponsor.ajay.app/donate"
"url": "https://sponsor.ajay.app/donate"
},
{
"type": "github",

1
public/_locales Submodule

Submodule public/_locales added at 306f1deff3

View File

@@ -1,933 +0,0 @@
{
"fullName": {
"message": "SponsorBlock for YouTube - Skip Sponsorships",
"description": "Name of the extension."
},
"Description": {
"message": "Skip sponsorships, subscription begging and more on YouTube videos. Report sponsors on videos you watch to save others' time.",
"description": "Description of the extension."
},
"400": {
"message": "Server said this request was invalid"
},
"429": {
"message": "You have submitted too many sponsor times for this one video, are you sure there are this many?"
},
"409": {
"message": "This has already been submitted before"
},
"channelWhitelisted": {
"message": "Channel Whitelisted!"
},
"Segment": {
"message": "segment"
},
"Segments": {
"message": "segments"
},
"upvoteButtonInfo": {
"message": "Upvote this submission"
},
"reportButtonTitle": {
"message": "Report"
},
"reportButtonInfo": {
"message": "Report this submission as incorrect."
},
"Dismiss": {
"message": "Dismiss"
},
"Loading": {
"message": "Loading..."
},
"Hide": {
"message": "Never Show"
},
"hitGoBack": {
"message": "Hit unskip to get to where you came from."
},
"unskip": {
"message": "Unskip"
},
"reskip": {
"message": "Reskip"
},
"unmute": {
"message": "Unmute"
},
"paused": {
"message": "Paused"
},
"manualPaused": {
"message": "Timer Stopped"
},
"confirmMSG": {
"message": "To edit or delete individual values, click the info button or open the extension popup by clicking the extension icon in the top right corner."
},
"clearThis": {
"message": "Are you sure you want to clear this?\n\n"
},
"Unknown": {
"message": "There was an error submitting your sponsor times, please try again later."
},
"sponsorFound": {
"message": "This video has segments in the database!"
},
"sponsor404": {
"message": "No segments found"
},
"sponsorStart": {
"message": "Segment Starts Now"
},
"sponsorEnd": {
"message": "Segment Ends Now"
},
"sponsorCancel": {
"message": "Cancel Creating Segment"
},
"noVideoID": {
"message": "No YouTube video found.\nIf this is incorrect, refresh the tab."
},
"refreshSegments": {
"message": "Refresh segments"
},
"success": {
"message": "Success!"
},
"voted": {
"message": "Voted!"
},
"serverDown": {
"message": "It seems the server is down. Contact the dev immediately."
},
"connectionError": {
"message": "A connection error has occured. Error code: "
},
"clearTimes": {
"message": "Clear Segments"
},
"openPopup": {
"message": "Open SponsorBlock Popup"
},
"closePopup": {
"message": "Close Popup"
},
"SubmitTimes": {
"message": "Submit Segments"
},
"submitCheck": {
"message": "Are you sure you want to submit this?"
},
"whitelistChannel": {
"message": "Whitelist channel"
},
"removeFromWhitelist": {
"message": "Remove channel from whitelist"
},
"voteOnTime": {
"message": "Vote On A Segment"
},
"Submissions": {
"message": "Submissions"
},
"savedPeopleFrom": {
"message": "You've saved people from "
},
"viewLeaderboard": {
"message": "Leaderboard"
},
"recordTimesDescription": {
"message": "Submit"
},
"submissionEditHint": {
"message": "Section editing will appear after you click submit",
"description": "Appears in the popup to inform them that editing has been moved to the video player."
},
"popupHint": {
"message": "Hint: You can setup keybinds for submitting in the options"
},
"clearTimesButton": {
"message": "Clear Times"
},
"submitTimesButton": {
"message": "Submit Times"
},
"publicStats": {
"message": "This is used on the public stats page to show off how much you've contributed. See it"
},
"Username": {
"message": "Username"
},
"setUsername": {
"message": "Set Username"
},
"copyPublicID": {
"message": "Copy Public UserID"
},
"discordAdvert": {
"message": "Come join the official discord server to give suggestions and feedback!"
},
"hideThis": {
"message": "Hide this"
},
"Options": {
"message": "Options"
},
"showButtons": {
"message": "Show Buttons On YouTube Player"
},
"hideButtons": {
"message": "Hide Buttons On YouTube Player"
},
"hideButtonsDescription": {
"message": "This hides the buttons that appear on the YouTube player to submit skip segments."
},
"showSkipButton": {
"message": "Keep Skip To Highlight Button On Player"
},
"showInfoButton": {
"message": "Show Info Button On YouTube Player"
},
"hideInfoButton": {
"message": "Hide Info Button On YouTube Player"
},
"autoHideInfoButton": {
"message": "Auto-hide Info Button"
},
"hideDeleteButton": {
"message": "Hide Delete Button On YouTube Player"
},
"showDeleteButton": {
"message": "Show Delete Button On YouTube Player"
},
"enableViewTracking": {
"message": "Enable Skip Count Tracking"
},
"whatViewTracking": {
"message": "This feature tracks which segments you have skipped to let users know how much their submission has helped others and used as a metric along with upvotes to ensure that spam doesn't get into the database. The extension sends a message to the server each time you skip a segment. Hopefully most people don't change this setting so that the view numbers are accurate. :)"
},
"enableViewTrackingInPrivate": {
"message": "Enable Skip Count Tracking In Private/Incognito tabs"
},
"enableTrackDownvotes": {
"message": "Store segment downvotes"
},
"whatTrackDownvotes": {
"message": "Any segments you downvote will remain hidden even after refreshing"
},
"trackDownvotesWarning": {
"message": "Warning: Disabling this will delete all previously stored downvotes"
},
"enableQueryByHashPrefix": {
"message": "Query By Hash Prefix"
},
"whatQueryByHashPrefix": {
"message": "Instead of requesting segments from the server using the videoID, the first 4 characters of the hash of the videoID are sent. This server will send back data for all videos with similar hashes."
},
"enableRefetchWhenNotFound": {
"message": "Refetch Segments On New Videos"
},
"whatRefetchWhenNotFound": {
"message": "If the video is new, and there are no segments found, it will keep refetching every few minutes while you watch."
},
"showNotice": {
"message": "Show Notice Again"
},
"showSkipNotice": {
"message": "Show Notice After A Segment Is Skipped"
},
"noticeVisibilityMode0": {
"message": "Full Size Skip Notices"
},
"noticeVisibilityMode1": {
"message": "Small Skip Notices for Auto Skip"
},
"noticeVisibilityMode2": {
"message": "All Small Skip Notices"
},
"noticeVisibilityMode3": {
"message": "Faded Skip Notices for Auto Skip"
},
"noticeVisibilityMode4": {
"message": "All Faded Skip Notices"
},
"longDescription": {
"message": "SponsorBlock lets you skip over sponsors, intros, outros, subscription reminders, and other annoying parts of YouTube videos. SponsorBlock is a crowdsourced browser extension that lets anyone submit the start and end times of sponsored segments and other segments of YouTube videos. Once one person submits this information, everyone else with this extension will skip right over the sponsored segment. You can also skip over non music sections of music videos.",
"description": "Full description of the extension on the store pages."
},
"website": {
"message": "Website",
"description": "Used on Firefox Store Page"
},
"sourceCode": {
"message": "Source Code",
"description": "Used on Firefox Store Page"
},
"noticeUpdate": {
"message": "The notice has been upgraded!",
"description": "The first line of the message displayed after the notice was upgraded."
},
"noticeUpdate2": {
"message": "If you still don't like it, hit the never show button.",
"description": "The second line of the message displayed after the notice was upgraded."
},
"setSkipShortcut": {
"message": "Skip segment",
"description": "Keybind label"
},
"setStartSponsorShortcut": {
"message": "Start/stop segment",
"description": "Keybind label"
},
"setSubmitKeybind": {
"message": "Submit segments",
"description": "Keybind label"
},
"keybindDescription": {
"message": "Select a key by typing it and choose any modifier keys you wish to use."
},
"0": {
"message": "Connection Timeout. Check your internet connection. If your internet is working, the server is probably overloaded or down."
},
"disableSkipping": {
"message": "Skipping is enabled"
},
"enableSkipping": {
"message": "Skipping is disabled"
},
"yourWork": {
"message": "Your Work",
"description": "Used to describe the section that will show you the statistics from your submissions."
},
"502": {
"message": "The server seems to be overloaded. Try again in a few seconds."
},
"errorCode": {
"message": "Error Code: "
},
"skip": {
"message": "Skip"
},
"mute": {
"message": "Mute"
},
"full": {
"message": "Full Video",
"description": "Used for the name of the option to label an entire video as sponsor or self promotion."
},
"skip_category": {
"message": "Skip {0}?"
},
"mute_category": {
"message": "Mute {0}?"
},
"skip_to_category": {
"message": "Skip to {0}?",
"description": "Used for skipping to things (Skip to Highlight)"
},
"skipped": {
"message": "{0} Skipped",
"description": "Example: Sponsor Skipped"
},
"muted": {
"message": "{0} Muted",
"description": "Example: Sponsor Muted"
},
"skipped_to_category": {
"message": "Skipped to {0}",
"description": "Used for skipping to things (Skipped to Highlight)"
},
"disableAutoSkip": {
"message": "Disable Auto Skip"
},
"enableAutoSkip": {
"message": "Enable Auto Skip"
},
"audioNotification": {
"message": "Audio Notification On Skip"
},
"audioNotificationDescription": {
"message": "Audio notification on skip will play a sound whenever a segment is skipped. If disabled (or auto skip is disabled), no sound will be played."
},
"showTimeWithSkips": {
"message": "Show Time With Skips Removed"
},
"showTimeWithSkipsDescription": {
"message": "This time appears in brackets next to the current time on below the seekbar. This shows the total video duration minus any segments. This includes segments marked as only \"Show In Seekbar\"."
},
"youHaveSkipped": {
"message": "You've skipped "
},
"minLower": {
"message": "minute"
},
"minsLower": {
"message": "minutes"
},
"hourLower": {
"message": "hour"
},
"hoursLower": {
"message": "hours"
},
"youHaveSavedTime": {
"message": "You've saved people",
"description": "You've saved people from 887,362 segments (236d 15h 5.3 minutes of their lives)."
},
"youHaveSavedTimeEnd": {
"message": " of their lives",
"description": "You've saved people from 887,362 segments (236d 15h 5.3 minutes of their lives)."
},
"statusReminder": {
"message": "Check status.sponsor.ajay.app for server status."
},
"changeUserID": {
"message": "Import/Export Your UserID"
},
"whatChangeUserID": {
"message": "This should be kept private. This is like a password and should not be shared with anyone. If someone has this, they can impersonate you. If you are looking for your public userID, click the clipboard icon in the popup."
},
"setUserID": {
"message": "Set UserID"
},
"userIDChangeWarning": {
"message": "Warning: Changing the UserID is permanent. Are you sure you would like to do this? Make sure to backup your old one just in case."
},
"createdBy": {
"message": "Created By"
},
"supportOtherSites": {
"message": "Support 3rd Party YouTube-Sites"
},
"supportOtherSitesDescription": {
"message": "Support third party YouTube clients. To enable support, you must accept the extra permissions. This does NOT work in incognito on Chrome and other Chromium variants.",
"description": "This replaces the 'supports Invidious' option because it now works on other YouTube sites such as Cloudtube"
},
"supportedSites": {
"message": "Supported Sites: "
},
"optionsInfo": {
"message": "Enable Invidious support, disable autoskip, hide buttons and more."
},
"addInvidiousInstance": {
"message": "Add 3rd-Party Client Instance"
},
"addInvidiousInstanceDescription": {
"message": "Add a custom instance. This must be formatted with JUST the domain. Example: invidious.ajay.app"
},
"add": {
"message": "Add"
},
"addInvidiousInstanceError": {
"message": "This is an invalid domain. This should JUST include the domain part. Example: invidious.ajay.app"
},
"resetInvidiousInstance": {
"message": "Reset Invidious Instance List"
},
"resetInvidiousInstanceAlert": {
"message": "You are about to reset the Invidious instance list"
},
"currentInstances": {
"message": "Current Instances:"
},
"minDuration": {
"message": "Minimum duration (seconds):"
},
"minDurationDescription": {
"message": "Segments shorter than the set value will not be skipped or show in the player."
},
"skipNoticeDuration": {
"message": "Skip notice duration (seconds):"
},
"skipNoticeDurationDescription": {
"message": "The skip notice will stay on screen for at least this many seconds. For manual skipping, it may be visible for longer."
},
"shortCheck": {
"message": "The following submission is shorter than your minimum duration option. This could mean that this is already submitted, and just being ignored due to this option. Are you sure you would like to submit?"
},
"liveOrPremiere": {
"message": "Submitting on an active livestream or premiere is not allowed. Please wait until it finishes, then refresh the page and verify that the segments are still valid."
},
"showUploadButton": {
"message": "Show Upload Button"
},
"customServerAddress": {
"message": "SponsorBlock Server Address"
},
"customServerAddressDescription": {
"message": "The address SponsorBlock uses to make calls to the server.\nUnless you have your own server instance, this should not be changed."
},
"save": {
"message": "Save"
},
"reset": {
"message": "Reset"
},
"customAddressError": {
"message": "This address is not in the right form. Make sure you have http:// or https:// at the beginning and no trailing slashes."
},
"areYouSureReset": {
"message": "Are you sure you would like to reset this?"
},
"mobileUpdateInfo": {
"message": "m.youtube.com is now supported"
},
"exportOptions": {
"message": "Import/Export All Options"
},
"exportOptionsCopy": {
"message": "Edit/copy"
},
"exportOptionsDownload": {
"message": "Save to file"
},
"exportOptionsUpload": {
"message": "Load from file"
},
"whatExportOptions": {
"message": "This is your entire configuration in JSON. This includes your userID, so be sure to share this wisely."
},
"setOptions": {
"message": "Set Options"
},
"exportOptionsWarning": {
"message": "Warning: Changing the options is permanent and can break your install. Are you sure you would like to do this? Make sure to backup your old one just in case."
},
"incorrectlyFormattedOptions": {
"message": "This JSON is not formatted correctly. Your options have not been changed."
},
"confirmNoticeTitle" : {
"message": "Submit Segment"
},
"submit": {
"message": "Submit"
},
"cancel": {
"message": "Cancel"
},
"delete": {
"message": "Delete"
},
"preview": {
"message": "Preview"
},
"unsubmitted": {
"message": "Unsubmitted"
},
"inspect": {
"message": "Inspect"
},
"edit": {
"message": "Edit"
},
"copyDebugInformation": {
"message": "Copy Debug Information To Clipboard"
},
"copyDebugInformationFailed": {
"message": "Failed to write to clipboard"
},
"copyDebugInformationOptions": {
"message": "Copies information to the clipboard to be provided to a developer when raising a bug / when a developer requests it. Sensitive information such as your user ID, whitelisted channels, and custom server address have been removed. However it does contain information such as your useragent, browser, operating system, and extension version number. "
},
"copyDebugInformationComplete": {
"message": "The debug information has been copied to the clip board. Feel free to remove any information you would rather not share. Save this in a text file or paste into the bug report."
},
"keyAlreadyUsed": {
"message": "This shortcut is bound to another action. Please select a different one."
},
"to": {
"message": "to",
"description": "Used between segments. Example: 1:20 to 1:30"
},
"category_sponsor": {
"message": "Useful Content"
},
"category_sponsor_description": {
"message": "Paid promotion, paid referrals and direct advertisements. Not for self-promotion or free shoutouts to causes/creators/websites/products they like."
},
"category_selfpromo": {
"message": "Unpaid/Self Promotion"
},
"category_selfpromo_description": {
"message": "Similar to \"sponsor\" except for unpaid or self promotion. This includes sections about merchandise, donations, or information about who they collaborated with."
},
"category_exclusive_access": {
"message": "Exclusive Access"
},
"category_exclusive_access_description": {
"message": "Only for labeling entire videos. Used when a video showcases a product, service or location that they've received free or subsidized access to."
},
"category_exclusive_access_pill": {
"message": "This video showcases a product, service or location that they've received free or subsidized access to",
"description": "Short description for this category"
},
"category_interaction": {
"message": "Interaction Reminder (Subscribe)"
},
"category_interaction_description": {
"message": "When there is a short reminder to like, subscribe or follow them in the middle of content. If it is long or about something specific, it should be under self promotion instead."
},
"category_interaction_short": {
"message": "Interaction Reminder"
},
"category_intro": {
"message": "Intermission/Intro Animation"
},
"category_intro_description": {
"message": "An interval without actual content. Could be a pause, static frame, repeating animation. This should not be used for transitions containing information."
},
"category_intro_short": {
"message": "Intermission"
},
"category_outro": {
"message": "Endcards/Credits"
},
"category_outro_description": {
"message": "Credits or when the YouTube endcards appear. Not for conclusions with information."
},
"category_preview": {
"message": "Preview/Recap"
},
"category_preview_description": {
"message": "Quick recap of previous episodes, or a preview of what's coming up later in the current video. Meant for edited together clips, not for spoken summaries."
},
"category_filler": {
"message": "Filler Tangent/Jokes"
},
"category_filler_description": {
"message": "Tangential scenes added only for filler or humor that are not required to understand the main content of the video. This should not include segments providing context or background details."
},
"category_filler_short": {
"message": "Filler"
},
"category_music_offtopic": {
"message": "Music: Non-Music Section"
},
"category_music_offtopic_description": {
"message": "Only for use in music videos. This only should be used for sections of music videos that aren't already covered by another category."
},
"category_music_offtopic_short": {
"message": "Non-Music"
},
"category_poi_highlight": {
"message": "Highlight"
},
"category_poi_highlight_description": {
"message": "The part of the video that most people are looking for. Similar to \"Video starts at x\" comments."
},
"category_livestream_messages": {
"message": "Livestream: Donation/Message Readings"
},
"category_livestream_messages_short": {
"message": "Message Reading"
},
"autoSkip": {
"message": "Auto Skip"
},
"manualSkip": {
"message": "Manual Skip"
},
"showOverlay": {
"message": "Show In Seek Bar"
},
"disable": {
"message": "Disable"
},
"autoSkip_POI": {
"message": "Auto skip to the start"
},
"manualSkip_POI": {
"message": "Ask when video loads"
},
"showOverlay_POI": {
"message": "Show In Seek Bar"
},
"showOverlay_full": {
"message": "Show Label"
},
"autoSkipOnMusicVideos": {
"message": "Auto skip all segments when there is a non-music segment"
},
"muteSegments": {
"message": "Allow segments that mute audio instead of skip"
},
"fullVideoSegments": {
"message": "Show an icon when a video is entirely an advertisement",
"description": "Referring to the category pill that is now shown on videos that are entirely sponsor or entirely selfpromo"
},
"previewColor": {
"message": "Unsubmitted Color",
"description": "Referring to submissions that have not been sent to the server yet."
},
"seekBarColor": {
"message": "Seek Bar Color"
},
"category": {
"message": "Category"
},
"skipOption": {
"message": "Skip Option",
"description": "Used on the options page to describe the ways to skip the segment (auto skip, manual, etc.)"
},
"enableTestingServer": {
"message": "Enable Beta Testing Server"
},
"whatEnableTestingServer": {
"message": "Your submissions and votes WILL NOT COUNT towards the main server. Only use this for testing."
},
"testingServerWarning": {
"message": "All submissions and votes WILL NOT COUNT towards the main server while connecting to the test server. Make sure to disable this when you want to make real submissions."
},
"bracketNow": {
"message": "(Now)"
},
"moreCategories": {
"message": "More Categories"
},
"chooseACategory": {
"message": "Choose a Category"
},
"enableThisCategoryFirst": {
"message": "To submit segments with the category of \"{0}\", you must enable it in the options. You will be redirected to the options now.",
"description": "Used when submitting segments to only let them select a certain category if they have it enabled in the options."
},
"poiOnlyOneSegment": {
"message": "Warning: This type of segment can have a maximum of one active at a time. Submitting multiple will cause a random one to be shown."
},
"youMustSelectACategory": {
"message": "You must select a category for all segments you are submitting!"
},
"bracketEnd": {
"message": "(End)"
},
"hiddenDueToDownvote": {
"message": "hidden: downvote"
},
"hiddenDueToDuration": {
"message": "hidden: too short"
},
"manuallyHidden": {
"message": "manually hidden"
},
"channelDataNotFound": {
"description": "This error appears in an alert when they try to whitelist a channel and the extension is unable to determine what channel they are looking at.",
"message": "Channel ID is not loaded yet. If you are using an embedded video, try using the YouTube homepage instead. This could also be caused by changes in the YouTube layout, if you think so, make a comment here:"
},
"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."
},
"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"
},
"forceChannelCheck": {
"message": "Force Channel Check Before Skipping"
},
"whatForceChannelCheck": {
"message": "By default, it will skip segments right away before it even knows what the channel is. By default, some segments at the start of the video might be skipped on whitelisted channels. Enabling this option will prevent this but making all skipping have a slight delay as getting the channelID can take some time. This delay might be unnoticeable if you have fast internet."
},
"forceChannelCheckPopup": {
"message": "Consider Enabling \"Force Channel Check Before Skipping\""
},
"downvoteDescription": {
"message": "Incorrect/Wrong Timing"
},
"incorrectCategory": {
"message": "Change Category"
},
"nonMusicCategoryOnMusic": {
"message": "This video is categorized as music. Are you sure this has a sponsor? If this is actually a \"Non-Music segment\", open up the extension options and enable this category. Then, you can submit this segment as \"Non-Music\" instead of sponsor. Please read the guidelines if you are confused."
},
"multipleSegments": {
"message": "Multiple Segments"
},
"guidelines": {
"message": "Guidelines"
},
"readTheGuidelines": {
"message": "Read The Guidelines!!",
"description": "Show the first time they submit or if they are \"high risk\""
},
"categoryUpdate1": {
"message": "Categories are here!"
},
"categoryUpdate2": {
"message": "Open the options to skip intros, outros, merch, etc."
},
"help": {
"message": "Help"
},
"GotIt": {
"message": "Got it",
"description": "Used as the button to dismiss a tooltip"
},
"fullVideoTooltipWarning": {
"message": "This segment is large. If the whole video is about one topic, then change from \"Skip\" to \"Full Video\". See the guidelines for more information."
},
"categoryPillTitleText": {
"message": "This entire video is labeled as this category and is too tightly integrated to be able to separate"
},
"experiementOptOut": {
"message": "Opt-out of all future experiments",
"description": "This is used in a popup about a new experiment to get a list of unlisted videos to back up since all unlisted videos uploaded before 2017 will be set to private."
},
"hideForever": {
"message": "Hide forever"
},
"warningChatInfo": {
"message": "You got a warning and cannot submit segments temporarily. This means that we noticed you were making some common mistakes that are not malicious, please just confirm that you understand the rules and we will remove the warning. You can also join this chat using discord.gg/SponsorBlock or matrix.to/#/#sponsor:ajay.app"
},
"voteRejectedWarning": {
"message": "Vote rejected due to a warning. Click to open a chat to resolve it, or come back later when you have time.",
"description": "This is an integrated chat panel that will appearing allowing them to talk to the Discord/Matrix chat without leaving their browser."
},
"Donate": {
"message": "Donate"
},
"considerDonating": {
"message": "Help fund development"
},
"hideDonationLink": {
"message": "Hide Donation Link"
},
"darkModeOptionsPage": {
"message": "Dark Mode On Options Page"
},
"helpPageThanksForInstalling": {
"message": "Thanks for installing SponsorBlock."
},
"helpPageReviewOptions": {
"message": "Please review the options below"
},
"helpPageFeatureDisclaimer": {
"message": "Many features are disabled by default. If you want to skip intros, outros, use Invidious, etc., enable them below. You can also hide/show UI elements."
},
"helpPageHowSkippingWorks": {
"message": "How skipping works"
},
"helpPageHowSkippingWorks1": {
"message": "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."
},
"helpPageHowSkippingWorks2": {
"message": "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."
},
"Submitting": {
"message": "Submitting"
},
"helpPageSubmitting1": {
"message": "Submitting can either be done in the popup by hitting the \"Segment Starts Now\" button or in the video player with the buttons on the player."
},
"helpPageSubmitting2": {
"message": "Clicking the play button indicated the start of a segment and clicking the stop icon indicates the end. You can prepare multiple sponsors before hitting submit. Clicking the upload button will submit. Clicking the garbage can will delete."
},
"Editing": {
"message": "Editing"
},
"helpPageEditing1": {
"message": "If you messed up, you can edit or delete your segments after clicking the up arrow button."
},
"helpPageTooSlow": {
"message": "This is too slow"
},
"helpPageTooSlow1": {
"message": "There are hotkeys if you want 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."
},
"helpPageCopyOfDatabase": {
"message": "Can I get a copy of the Database? What happens if you disappear?"
},
"helpPageCopyOfDatabase1": {
"message": "The database is public and available at"
},
"helpPageCopyOfDatabase2": {
"message": "The source code is freely available. So, even if something happens to me, your submissions are not lost."
},
"helpPageNews": {
"message": "News and how it is made"
},
"helpPageSourceCode": {
"message": "Where can I get the source code?"
},
"Credits": {
"message": "Credits"
},
"LearnMore": {
"message": "Learn More"
},
"CopyDownvoteButtonInfo": {
"message": "Downvotes and creates a local copy for you to resubmit"
},
"OpenCategoryWikiPage": {
"message": "Open this category's wiki page."
},
"CopyAndDownvote": {
"message": "Copy and downvote"
},
"ContinueVoting": {
"message": "Continue Voting"
},
"ChangeCategoryTooltip": {
"message": "This will instantly apply to your segments"
},
"SponsorTimeEditScrollNewFeature": {
"message": "Use your mousewheel while hovering over the edit box to quickly adjust the time. Combinations of the ctrl or shift key can be used to fine tune the changes."
},
"categoryPillNewFeature": {
"message": "New! See when a video is entirely sponsored or self-promotion"
},
"dayAbbreviation": {
"message": "d",
"description": "100d"
},
"hourAbbreviation": {
"message": "h",
"description": "100h"
},
"optionsTabBehavior": {
"message": "Behavior",
"description": "Appears in Options as a tab header for options related to categories and skipping behavior. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)."
},
"optionsTabInterface": {
"message": "Interface",
"description": "Appears in Options as a tab header for options related to GUI and sounds. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)."
},
"optionsTabKeyBinds": {
"message": "Keyboard shortcuts",
"description": "Appears in Options as a tab header for keybinds. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)."
},
"optionsTabBackup": {
"message": "Backup/Restore",
"description": "Appears in Options as a tab header for options related to saving/restoring your settings. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)."
},
"optionsTabAdvanced": {
"message": "Miscellaneous",
"description": "Appears in Options as a tab header for advanced/niche options. To fit inside the button, it should not be longer than ~20-25 characters (depending on their width)."
},
"noticeVisibilityLabel": {
"message": "Skip notice appearance",
"description": "Option label"
},
"unbind": {
"message": "Unbind",
"description": "Unbind keyboard shortcut"
},
"notSet": {
"message": "Not set"
},
"change": {
"message": "Change"
},
"youtubeKeybindWarning": {
"message": "This is a built-in YouTube shortcut. Are you sure you want to use it?"
}
}

View File

@@ -1,3 +1,12 @@
:root {
--skip-notice-right: 10px;
--skip-notice-padding: 5px;
--skip-notice-margin: 5px;
--skip-notice-border-horizontal: 5px;
--skip-notice-border-vertical: 10px;
--sb-dark-red-outline: rgb(130,0,0,0.9);
}
.hidden {
display: none;
}
@@ -9,21 +18,38 @@
position: absolute;
width: 100%;
pointer-events: none;
height: 100%;
transform: scaleY(0.6) translateY(-30%) translateY(1.5px);
z-index: 40;
z-index: 42;
transition: transform .1s cubic-bezier(0,0,0.2,1);
}
#previewbar.hovered {
.ytp-big-mode #previewbar {
transform: scaleY(0.625) translateY(-30%) translateY(1.5px);
}
.ytp-big-mode .sponsorTwoTooltips .sponsorCategoryTooltip {
top: 75px !important;
}
.progress-bar-line > #previewbar {
height: 3px;
}
div:hover > #previewbar.sbNotInvidious {
transform: scaleY(1)
}
.previewbar {
display: inline-block;
height: 100%;
min-width: 1px;
}
.previewbar.requiredSegment {
transform: scaleY(3)
}
/* Make sure settings are upfront */
@@ -41,23 +67,58 @@
transform: translateY(-1em) !important;
}
/* Pull up for precise seeking */
.ytp-tooltip.sponsorCategoryTooltipVisible .ytp-tooltip-edu {
transform: translateY(-1em) !important;
}
.ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips {
transform: translateY(-2em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible {
transform: translateY(-2em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips {
transform: translateY(-4em) !important;
}
#movie_player:not(.ytp-big-mode) .ytp-tooltip.sponsorCategoryTooltipVisible > .ytp-tooltip-text-wrapper {
transform: translateY(1em) !important;
}
#movie_player:not(.ytp-big-mode) .ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips > .ytp-tooltip-text-wrapper {
transform: translateY(2em) !important;
}
/* Pull up for precise seeking */
.ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips .ytp-tooltip-edu {
transform: translateY(-2em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible > .ytp-tooltip-text-wrapper {
transform: translateY(0.5em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips > .ytp-tooltip-text-wrapper {
transform: translateY(1em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible > .ytp-tooltip-text-wrapper > .ytp-tooltip-text {
display: block !important;
transform: translateY(1em) !important;
}
.ytp-big-mode .ytp-tooltip.sponsorCategoryTooltipVisible.sponsorTwoTooltips > .ytp-tooltip-text-wrapper > .ytp-tooltip-text {
display: block !important;
transform: translateY(2em) !important;
}
div:hover > .sponsorBlockChapterBar {
z-index: 41 !important;
}
/* */
.popup {
@@ -84,6 +145,20 @@
vertical-align: top;
}
.playerButton.hidden:not(.autoHiding) {
display: none !important;
}
/* Removes auto width from being a ytp-player-button */
.sbPlayerDownvote {
width: auto !important;
}
/* Adds back the padding */
.sbPlayerDownvote svg {
padding-right: 3.6px;
}
.autoHiding {
overflow: visible !important;
}
@@ -108,9 +183,13 @@
.sponsorSkipObject {
font-family: Roboto, Arial, Helvetica, sans-serif;
margin-left: 2px;
margin-right: 2px;
margin-left: var(--skip-notice-margin);
margin-right: var(--skip-notice-margin);
}
.sponsorSkipObjectFirst {
margin-left: 0;
}
.sponsorSkipLogo {
@@ -141,7 +220,7 @@
position: absolute;
right: 5px;
bottom: 100px;
right: 10px;
right: var(--skip-notice-right);
}
.sponsorSkipNoticeParent {
@@ -152,9 +231,6 @@
}
.sponsorSkipNoticeParent, .sponsorSkipNotice {
min-width: 350px;
max-width: 50%;
border-spacing: 5px 10px;
padding-left: 5px;
padding-right: 5px;
@@ -162,18 +238,32 @@
border-collapse: unset;
}
.sponsorSkipNoticeParent {
min-width: 350px;
max-width: 50%;
}
.sponsorSkipNotice {
width: 100%;
}
.sponsorSkipNoticeTableContainer {
color: white;
background-color: rgba(28, 28, 28, 0.9);
border-radius: 5px;
min-width: 100%;
}
.exportCopiedNotice .sponsorSkipNoticeTableContainer {
background-color: transparent;
}
.sponsorSkipNotice {
transition: all 0.1s ease-out;
}
.sponsorSkipNoticeLimitWidth {
min-width: calc(100% - 50px);
max-width: calc(100% - 50px);
}
.sponsorSkipNotice .hidden {
@@ -189,6 +279,10 @@
animation: fadeIn 0.5s ease-out;
}
.exportCopiedNotice .sponsorSkipNoticeFadeIn {
animation: none;
}
.sponsorSkipNoticeFaded {
opacity: 0.5;
}
@@ -253,7 +347,7 @@
.sponsorSkipNoticeButton:hover {
background-color: rgba(235, 235, 235,0.2);
border-radius: 4px;
transition: background-color 0.4s;
}
@@ -288,7 +382,7 @@
height: 10px;
width: 10px;
box-sizing: unset;
padding: 2px 5px;
margin-left: 2px;
@@ -303,7 +397,7 @@
font-size: 14px;
font-weight: bold;
color: rgb(235, 235, 235);
margin-top: auto;
display: inline-block;
margin-right: 10px;
@@ -341,15 +435,23 @@
.sponsorTimesInfoMessage {
font-size: 13.3333px;
color: rgb(235, 235, 235);
overflow-wrap: anywhere;
}
.voteButton {
height: 24px;
width: 24px;
cursor: pointer;
.sb-guidelines-notice .sponsorTimesInfoMessage td {
padding-left: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: 15px;
display: flex;
align-items: center;
}
.voteButton:hover {
filter: brightness(80%);
.sponsorTimesInfoIcon {
width: 30px;
padding-right: 10px;
padding-left: 10px;
}
.segmentSummary {
@@ -369,7 +471,7 @@
padding:4px 15px;
text-decoration:none;
text-shadow:0px 0px 0px #662727;
margin-top: 5px;
margin-right: 15px;
}
@@ -405,7 +507,7 @@
padding:4px 15px;
text-decoration:none;
text-shadow:0px 0px 0px #662727;
margin-top: 5px;
margin-right: 15px;
}
@@ -467,7 +569,7 @@
margin-right: 20px;
font-size: 13px;
cursor: pointer;
}
@@ -488,10 +590,17 @@ input::-webkit-inner-spin-button {
font-size: 14px;
-moz-appearance: textfield;
appearance: textfield;
}
.sponsorTimeEditInput {
width: 90px;
border: 3px solid var(--sb-dark-red-outline);
}
.sponsorTimeEditInput.sponsorChapterNameInput {
width: auto;
padding: 3px;
}
.sponsorNowButton {
@@ -506,35 +615,68 @@ input::-webkit-inner-spin-button {
margin-bottom: 5px;
background-color: rgba(28, 28, 28, 0.9);
border-color: rgb(130,0,0,0.9);
border-color: var(--sb-dark-red-outline);
color: white;
border-width: 3px;
padding: 3px;
}
.sponsorTimeEditSelector > option {
background-color: rgba(28, 28, 28, 0.9);
color: white;
}
/* Start SelectorComponent */
.sbSelector {
position: absolute;
text-align: center;
width: calc(100% - var(--skip-notice-right) - var(--skip-notice-padding) * 2 - var(--skip-notice-margin) * 2 - var(--skip-notice-border-horizontal) * 2);
z-index: 1000;
}
.sbSelectorBackground {
text-align: center;
background-color: rgba(28, 28, 28, 0.9);
border-radius: 6px;
padding: 3px;
margin: auto;
width: 170px;
}
.sbSelectorOption {
cursor: pointer;
background-color: rgb(43, 43, 43);
padding: 5px;
margin: 5px;
color: white;
border-radius: 5px;
font-size: 14px;
margin-left: auto;
margin-right: auto;
}
.sbSelectorOption:hover {
background-color: #3a0000;
}
/* End SelectorComponent */
.helpButton {
height: 25px;
cursor: pointer;
padding: 5px;
margin: auto;
top: 0;
bottom: 0;
position: absolute;
}
.helpButton:hover {
filter: brightness(80%);
}
.sbChatNotice iframe {
height: 32px;
cursor: pointer;
height: 100%;
}
.sbChatClose {
height: 14px;
cursor: pointer;
opacity: 0.8;
}
.skipButtonControlBarContainer {
@@ -610,8 +752,13 @@ input::-webkit-inner-spin-button {
border-color: rgba(28, 28, 28, 0.7) transparent transparent transparent;
}
.sponsorBlockTooltip.sbTriangle.centeredSBTriangle::after {
left: 50%;
right: 50%;
}
.sponsorBlockLockedColor {
color: #ffc83d;
color: #ffc83d !important;
}
.sponsorBlockRectangleTooltip {
@@ -641,15 +788,68 @@ input::-webkit-inner-spin-button {
align-items: center;
}
.sponsorBlockCategoryPillTitle {
white-space: nowrap;
}
.categoryPillClose {
display: none;
height: 10px;
width: 10px;
box-sizing: unset;
margin: 0px 0px 0px 5px;
}
.sponsorBlockCategoryPill:hover .categoryPillClose {
display: inherit;
}
}
/* tweak for mobile duration */
#sponsorBlockDurationAfterSkips.ytm-time-display {
padding-left: 4px;
margin: 0px;
color: #fff;
opacity: .7;
}
/* full video labels on thumbnails */
.sponsorThumbnailLabel {
display: none;
position: absolute;
top: 0;
left: 0;
padding: 0.5em;
margin: 0.5em;
border-radius: 2em;
z-index: 1000;
background-color: var(--category-color, #000);
opacity: 0.7;
box-shadow: 0 0 8px 2px #333;
font-size: 10px;
}
.sponsorThumbnailLabel.sponsorThumbnailLabelVisible {
display: flex;
}
.sponsorThumbnailLabel svg {
height: 2em;
fill: var(--category-text-color, #fff);
}
.sponsorThumbnailLabel span {
display: none;
padding-left: 0.25em;
font-size: 1.5em;
color: var(--category-text-color, #fff);
}
.sponsorThumbnailLabel:hover {
border-radius: 0.25em;
opacity: 1;
}
.sponsorThumbnailLabel:hover span {
display: inline;
}

View File

@@ -4,7 +4,7 @@
<title> SponsorBlock </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="../icons/LogoSponsorBlocker64px.png" type="image/png">
<link rel="icon" href="../icons/IconSponsorBlocker32px.png" type="image/png">
<link href="styles.css" rel="stylesheet"/>
@@ -15,28 +15,97 @@
<div id="title">
<img src="../icons/LogoSponsorBlocker256px.png" height="80" class="profilepic"/>
SponsorLock
SponsorBlock
</div>
<div class="container sponsorBlockPageBody">
<p>
By using this extension, you agree to the <a href="https://gist.github.com/ajayyy/aa9f8ded2b573d4f73a3ffa0ef74f796">Privacy Policy</a> and <a href="https://gist.github.com/ajayyy/9e8100f069348e0bc062641f34d6af12">Terms of Use</a>.
<p class="createdBy">
<img src="https://ajay.app/newprofilepic.jpg" height="30" class="profilepiccircle"/>
Created By <a href="https://ajay.app">Ajay Ramachandran</a>
<a href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener" id="sbDonate">(Donate)</a>
</p>
<p>
<b>Please uninstall regular SponsorBlock before trying this out.</b> Good luck! This extension was created for April 1st 2022.
__MSG_helpPageThanksForInstalling__ By using this extension, you agree to the <a href="https://gist.github.com/ajayyy/aa9f8ded2b573d4f73a3ffa0ef74f796">Privacy Policy</a> and <a href="https://gist.github.com/ajayyy/9e8100f069348e0bc062641f34d6af12">Terms of Use</a>.
</p>
<p>
Come contribute, make some suggestions and help out on <a href="https://discord.gg/SponsorBlock">Discord</a> or on <a href="https://matrix.to/#/#sponsor:ajay.app?via=ajay.app&via=matrix.org&via=mozilla.org">Matrix</a>.
</p>
<p style="margin-bottom: 0; margin-top: 0" class="bigText center">__MSG_helpPageReviewOptions__</p>
<iframe class="optionsFrame" src="../options/lock-options.html#embed" style="border: none"></iframe>
<p class="smallText">
__MSG_helpPageFeatureDisclaimer__
</p>
<iframe class="optionsFrame" src="../options/options.html#embed" style="border: none"></iframe>
<h1>__MSG_helpPageHowSkippingWorks__</h1>
<p class="projectPreview">
<span class="projectPreviewImageLarge">
<img src="images/popup.png">
</span>
__MSG_helpPageHowSkippingWorks1__
<br/>
<br/>
__MSG_helpPageHowSkippingWorks2__
</p>
<div class="center"><img src="images/voting on notice.gif"></div>
<h1>__MSG_Submitting__</h1>
<p class="projectPreview">
<img class="projectPreviewImageLarge" src="https://i.imgur.com/A1ilk6x.gif">
__MSG_helpPageSubmitting1__
<br/>
<br/>
__MSG_helpPageSubmitting2__
</p>
<h1>__MSG_Editing__</h1>
<p class="projectPreview">
<span class="projectPreviewImageLarge">
<img src="https://wiki.sponsor.ajay.app/images/6/6a/Popup_only.png">
</span>
__MSG_helpPageEditing1__
</p>
<h1>__MSG_helpPageTooSlow__</h1>
<p>
__MSG_helpPageTooSlow1__
</p>
<h1>__MSG_helpPageCopyOfDatabase__</h1>
<p>
__MSG_helpPageCopyOfDatabase1__ <a href="https://sponsor.ajay.app/database">https://sponsor.ajay.app/database</a>. __MSG_helpPageCopyOfDatabase2__
</p>
<h1>__MSG_helpPageNews__</h1>
<p>
See <a href="https://sponsor.ajay.app/news">https://sponsor.ajay.app/news</a>.
</p>
<h1>__MSG_helpPageSourceCode__</h1>
<h4 style="display: inline">Client:</h4>
<!-- Github logo -->
<a href="https://github.com/ajayyy/SponsorBlock/tree/april-fools-2022"><svg aria-hidden="true" version="1.1" viewBox="0 0 16 16" height="58px" style="padding-left: 15px"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a>
<a href="https://github.com/ajayyy/SponsorBlock"><svg aria-hidden="true" version="1.1" viewBox="0 0 16 16" height="58px" style="padding-left: 15px"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg></a>
<h4 style="display: inline; padding-left: 20px">Server:</h4>
<!-- Github logo -->
@@ -44,6 +113,16 @@
<h1>__MSG_Credits__</h1>
<p>
Thanks to all <a href="https://github.com/ajayyy/SponsorBlock/graphs/contributors">SponsorBlock contributors</a>,
<a href="https://github.com/ajayyy/SponsorBlockServer/graphs/contributors">SponsorBlockServer contributors</a> and
<a href="https://github.com/ajayyy/SponsorBlockSite/graphs/contributors">SponsorBlockSite contributors</a> such
as <a href="https://github.com/NDevTK">NDev</a>, <a href="https://github.com/Joe-Dowd">Joe Dowd</a>,
<a href="https://mchang.name/">Michael Chang</a> and more.
</p>
<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="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="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,20 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 565.15 568"
version="1.1"
id="svg16"
sodipodi:docname="PlayerStartIconSponsorBlocker.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
inkscape:export-filename="/home/ajay/projects/sb-extension/public/icons/LogoSponsorBlocker1024px.png"
inkscape:export-xdpi="173.9155"
inkscape:export-ydpi="173.9155"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata20">
<rdf:RDF>
@@ -36,17 +33,16 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-height="1001"
id="namedview18"
showgrid="false"
inkscape:zoom="0.83098592"
inkscape:cx="444.69697"
inkscape:cy="271.26356"
inkscape:window-x="380"
inkscape:window-y="768"
inkscape:cx="-0.3618106"
inkscape:cy="322.44266"
inkscape:window-x="477"
inkscape:window-y="961"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1-2"
inkscape:pagecheckerboard="0" />
inkscape:current-layer="Layer_1-2" />
<defs
id="defs4">
<style
@@ -62,15 +58,14 @@
data-name="Layer 1"
style="fill:#ffffff">
<path
id="path953"
style="fill:none;stroke:#07a500;stroke-width:40"
d="M 279.39062,24.197266 C 179.21701,24.603169 98.318528,101.48391 98.605469,196.00391 c 0.159023,40.69515 15.666041,80.00792 43.744141,110.89843 V 147.87891 l 16.75935,97.00627 C 164.72335,211.06602 65.553309,180.55346 92.112522,170.56303 L 193.6089,410.46016 435.49163,328.41259 443.41016,147.87891 v 46.7539 l 18.32422,-0.0996 C 461.16135,100.01356 379.56507,23.790617 279.39062,24.197266 Z M 443.41016,195.51367 v 74.92188 c 12.04625,-23.34115 18.3128,-48.96032 18.32617,-74.92188 z"
sodipodi:nodetypes="cccccccccccccccc" />
class="cls-1"
d="M282.58,568a65,65,0,0,1-34.14-9.66C95.41,463.94,2.54,300.46,0,121A64.91,64.91,0,0,1,34,62.91a522.56,522.56,0,0,1,497.16,0,64.91,64.91,0,0,1,34,58.12c-2.53,179.43-95.4,342.91-248.42,437.3A65,65,0,0,1,282.58,568Zm0-548.31A502.24,502.24,0,0,0,43.4,80.22a45.27,45.27,0,0,0-23.7,40.53c2.44,172.67,91.81,330,239.07,420.83a46.19,46.19,0,0,0,47.61,0C453.64,450.73,543,293.42,545.45,120.75a45.26,45.26,0,0,0-23.7-40.54A502.26,502.26,0,0,0,282.58,19.69Z"
id="path8"
style="fill:#ffffff" />
<path
style="fill:#008000"
d="m 281.94584,119.65312 -239.275918,0.7668 c 0,0 -0.08983,-8.3148 0,0 2.4,169.84 93.000158,318.21985 228.160158,401.58985 7.20735,4.41633 16.28288,4.41633 23.49023,0 135.16,-83.37 225.76016,-231.74985 228.16016,-401.58985 v 0 z M 220.41016,145.74023 411.2793,255.93945 220.41016,366.14062 Z"
id="path10"
sodipodi:nodetypes="cccccccccccc" />
style="fill:#ffffff"
d="M 284.70508 42.693359 A 479.9 479.9 0 0 0 54.369141 100.41992 A 22.53 22.53 0 0 0 42.669922 120.41992 C 45.069922 290.25992 135.67008 438.63977 270.83008 522.00977 A 22.48 22.48 0 0 0 294.32031 522.00977 C 429.48031 438.63977 520.08047 290.25992 522.48047 120.41992 A 22.53 22.53 0 0 0 510.7793 100.41992 A 479.9 479.9 0 0 0 284.70508 42.693359 z M 220.41016 145.74023 L 411.2793 255.93945 L 220.41016 366.14062 L 220.41016 145.74023 z "
id="path10" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

37
public/icons/bolt.svg Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="bolt.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M19.95 42 22 27.9H14.7Q14.15 27.9 13.9 27.4Q13.65 26.9 13.9 26.45L26.15 6H28.2L26.15 20.05H33.35Q33.9 20.05 34.175 20.55Q34.45 21.05 34.2 21.5L22 42Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

37
public/icons/campaign.svg Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="campaign.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M36.5 25.5V22.5H44V25.5ZM39 40 32.95 35.5 34.75 33.1 40.8 37.6ZM34.9 14.85 33.1 12.45 39 8 40.8 10.4ZM10.5 38V30H7Q5.75 30 4.875 29.125Q4 28.25 4 27V21Q4 19.75 4.875 18.875Q5.75 18 7 18H16L26 12V36L16 30H13.5V38ZM28 30.7V17.3Q29.35 18.5 30.175 20.225Q31 21.95 31 24Q31 26.05 30.175 27.775Q29.35 29.5 28 30.7Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="24"
height="24"
version="1.1"
id="svg4"
sodipodi:docname="check-smaller.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="26.25"
inkscape:cx="12.038095"
inkscape:cy="12"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
fill="#ffffff"
d="M 17.69347,4.9833775 9.9421192,12.940517 6.3065298,9.5107153 3.7684768,12.048769 9.9421192,18.016623 20.231523,7.5214304 Z"
id="path2"
style="stroke-width:0.68596" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="close-smaller.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1366"
inkscape:window-height="731"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M12.45 37.65 10.35 35.55 21.9 24 10.35 12.45 12.45 10.35 24 21.9 35.55 10.35 37.65 12.45 26.1 24 37.65 35.55 35.55 37.65 24 26.1Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

124
public/icons/export.svg Normal file
View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 67.671 67.671"
style="enable-background:new 0 0 67.671 67.671;"
xml:space="preserve"
sodipodi:docname="export.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs41" /><sodipodi:namedview
id="namedview39"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="9.309749"
inkscape:cx="33.889206"
inkscape:cy="33.835499"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="0"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" />
<g
id="g6"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,6)">
<path
d="M 52.946,23.348 H 42.834 v 6 h 10.112 c 3.007,0 5.34,1.536 5.34,2.858 v 26.606 c 0,1.322 -2.333,2.858 -5.34,2.858 H 14.724 c -3.007,0 -5.34,-1.536 -5.34,-2.858 V 32.207 c 0,-1.322 2.333,-2.858 5.34,-2.858 h 10.11 v -6 h -10.11 c -6.359,0 -11.34,3.891 -11.34,8.858 v 26.606 c 0,4.968 4.981,8.858 11.34,8.858 h 38.223 c 6.358,0 11.34,-3.891 11.34,-8.858 V 32.207 C 64.286,27.239 59.305,23.348 52.946,23.348 Z"
id="path2"
style="fill:#ffffff" />
<path
d="m 24.957,14.955 c 0.768,0 1.535,-0.293 2.121,-0.879 l 3.756,-3.756 v 13.028 6 11.494 c 0,1.657 1.343,3 3,3 1.657,0 3,-1.343 3,-3 v -11.494 -6 -13.231 l 3.959,3.959 c 0.586,0.586 1.354,0.879 2.121,0.879 0.767,0 1.535,-0.293 2.121,-0.879 1.172,-1.171 1.172,-3.071 0,-4.242 L 36.078,0.877 C 35.492,0.291 34.725,0 33.958,0 33.95,0 33.943,0 33.935,0 33.927,0 33.92,0 33.912,0 33.145,0 32.378,0.291 31.792,0.877 l -8.957,8.957 c -1.172,1.171 -1.172,3.071 0,4.242 0.587,0.586 1.354,0.879 2.122,0.879 z"
id="path4"
style="fill:#ffffff" />
</g>
<g
id="g8"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g10"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g12"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g14"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g16"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g18"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g20"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g22"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g24"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g26"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g28"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g30"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g32"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g34"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
<g
id="g36"
style="fill:#ffffff"
transform="matrix(0.82363056,0,0,0.82363056,5.9675483,5.9675483)">
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

93
public/icons/import.svg Normal file
View File

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 67.671 67.671"
style="enable-background:new 0 0 67.671 67.671;"
xml:space="preserve"
sodipodi:docname="import.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs41" /><sodipodi:namedview
id="namedview39"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="9.309749"
inkscape:cx="33.889206"
inkscape:cy="33.835499"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="0"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="g6"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1" />
<g
id="g6">
<path
d="M 49.575492,25.197675 H 41.24694 v 4.941783 h 8.328552 c 2.476657,0 4.398187,1.265096 4.398187,2.353936 v 21.913515 c 0,1.088839 -1.92153,2.353936 -4.398187,2.353936 H 18.094685 c -2.476657,0 -4.398188,-1.265097 -4.398188,-2.353936 V 32.494218 c 0,-1.08884 1.921531,-2.353936 4.398188,-2.353936 h 8.326905 v -4.941784 h -8.326905 c -5.237467,0 -9.3399709,3.204747 -9.3399709,7.29572 v 21.913514 c 0,4.091797 4.1025039,7.29572 9.3399709,7.29572 h 31.48163 c 5.236643,0 9.339971,-3.204747 9.339971,-7.29572 V 32.494218 c -8.24e-4,-4.091797 -4.103328,-7.296543 -9.340794,-7.296543 z"
id="path2"
style="fill:#ffffff;stroke-width:0.823631" />
<path
d="m 41.312006,34.701548 c -0.632548,0 -1.128592,0.43489 -1.74692,0.723971 L 36.47153,38.519075 V 22.847033 17.90525 8.4384399 c 0,-1.3647558 -1.106136,-2.4708916 -2.470892,-2.4708916 -1.364756,0 -2.470892,1.1061358 -2.470892,2.4708916 v 9.4668101 9.883566 10.897456 l -3.260753,-3.260753 c -0.482648,-0.482648 -1.115196,-0.723971 -1.746921,-0.723971 -0.631724,0 -1.264272,0.241323 -1.74692,0.723971 -0.965295,0.964471 -0.965295,2.529369 0,3.493841 l 7.377259,7.377259 c 0.482647,0.482647 1.114372,0.722324 1.746097,0.722324 h 0.01894 0.01894 c 0.631724,0 1.263449,-0.239677 1.746097,-0.722324 L 43.05975,38.91936 c 0.965295,-0.964472 0.965295,-2.52937 0,-3.493841 -0.483471,-0.482648 -1.115195,-0.723971 -1.747744,-0.723971 z"
id="path4"
sodipodi:nodetypes="sscccssscccssccsscssccs"
style="fill:#ffffff;stroke-width:0.823631" />
</g>
<g
id="g8">
</g>
<g
id="g10">
</g>
<g
id="g12">
</g>
<g
id="g14">
</g>
<g
id="g16">
</g>
<g
id="g18">
</g>
<g
id="g20">
</g>
<g
id="g22">
</g>
<g
id="g24">
</g>
<g
id="g26">
</g>
<g
id="g28">
</g>
<g
id="g30">
</g>
<g
id="g32">
</g>
<g
id="g34">
</g>
<g
id="g36">
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="lightbulb.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M24 44Q22.3 44 21.125 42.825Q19.95 41.65 19.95 39.95H28.05Q28.05 41.65 26.875 42.825Q25.7 44 24 44ZM15.9 36.85V33.85H32.1V36.85ZM16.15 30.8Q12.85 28.65 10.925 25.425Q9 22.2 9 18.15Q9 12.05 13.45 7.6Q17.9 3.15 24 3.15Q30.1 3.15 34.55 7.6Q39 12.05 39 18.15Q39 22.2 37.1 25.425Q35.2 28.65 31.85 30.8Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

37
public/icons/money.svg Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="money.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="6.5625"
inkscape:cx="37.942857"
inkscape:cy="29.714286"
inkscape:window-width="1366"
inkscape:window-height="731"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M 22.070204,47.757552 V 42.214123 Q 18.308592,41.554191 15.89984,39.343419 13.491088,37.132647 12.435197,33.766994 l 3.695619,-1.517844 q 1.121884,3.167674 3.233667,4.718514 2.111782,1.55084 5.081476,1.55084 3.167674,0 5.213463,-1.583837 2.045789,-1.583837 2.045789,-4.355551 0,-2.903701 -1.814813,-4.487538 -1.814813,-1.583836 -6.830296,-3.233666 -4.75151,-1.517844 -7.094269,-4.025586 -2.342759,-2.507741 -2.342759,-6.269354 0,-3.629626 2.342759,-6.0713741 2.342759,-2.4417484 6.104371,-2.7717144 V 0.24244792 h 3.959592 V 5.7198835 q 2.969694,0.329966 5.114473,1.9467994 2.144779,1.6168335 3.266663,4.1245751 l -3.695619,1.583837 q -0.923905,-2.111783 -2.474745,-3.068684 -1.55084,-0.9569014 -4.058582,-0.9569014 -3.035687,0 -4.817503,1.3858574 -1.781817,1.385857 -1.781817,3.761612 0,2.507742 1.979796,4.058582 1.979796,1.55084 7.325246,3.20067 4.487537,1.385857 6.632316,3.992589 2.144779,2.606731 2.144779,6.566323 0,4.157572 -2.441748,6.69831 -2.441749,2.540738 -7.193259,3.266663 v 5.477436 z"
id="path2"
style="fill:#ffffff;stroke-width:1.31986" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="music-note.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M19.65 42Q16.5 42 14.325 39.825Q12.15 37.65 12.15 34.5Q12.15 31.35 14.325 29.175Q16.5 27 19.65 27Q21.05 27 22.175 27.4Q23.3 27.8 24.15 28.5V6H35.85V12.75H27.15V34.5Q27.15 37.65 24.975 39.825Q22.8 42 19.65 42Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="right-arrow.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24.07619"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M 17.039265,39.62264 14.838095,37.382164 28.320259,23.9 14.838095,10.417836 17.039265,8.1773601 32.761905,23.9 Z"
id="path2"
style="fill:#ffffff;stroke-width:0.786132" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
public/icons/segway.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

1
public/icons/skip.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z"/></svg>

After

Width:  |  Height:  |  Size: 196 B

1
public/icons/sort.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/></svg>

After

Width:  |  Height:  |  Size: 201 B

37
public/icons/star.svg Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="star.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M11.65 44 16.3 28.8 4 20H19.2L24 4L28.8 20H44L31.7 28.8L36.35 44L24 34.6Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="48"
width="48"
version="1.1"
id="svg4"
sodipodi:docname="stopwatch.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="13.125"
inkscape:cx="24"
inkscape:cy="24"
inkscape:window-width="1920"
inkscape:window-height="983"
inkscape:window-x="482"
inkscape:window-y="768"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M14.45 34Q16.3 35.95 18.8 36.975Q21.3 38 24 38Q29.85 38 33.925 33.925Q38 29.85 38 24Q38 18.15 33.925 14.075Q29.85 10 24 10V24ZM24 44Q19.75 44 16.1 42.475Q12.45 40.95 9.75 38.25Q7.05 35.55 5.525 31.9Q4 28.25 4 24Q4 19.8 5.525 16.15Q7.05 12.5 9.75 9.8Q12.45 7.1 16.1 5.55Q19.75 4 24 4Q28.2 4 31.85 5.55Q35.5 7.1 38.2 9.8Q40.9 12.5 42.45 16.15Q44 19.8 44 24Q44 28.25 42.45 31.9Q40.9 35.55 38.2 38.25Q35.5 40.95 31.85 42.475Q28.2 44 24 44Z"
id="path2"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

View File

@@ -3,7 +3,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lqDY.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@@ -11,7 +11,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lqDY.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@@ -19,7 +19,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lqDY.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@@ -27,7 +27,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lqDY.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@@ -35,7 +35,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lqDY.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@@ -43,7 +43,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lqDY.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@@ -51,7 +51,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2) format('woff2');
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url(6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7l.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@@ -59,7 +59,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmhduz8A.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@@ -67,7 +67,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwkxduz8A.woff2) format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@@ -75,7 +75,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmxduz8A.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@@ -83,7 +83,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlBduz8A.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* vietnamese */
@@ -91,7 +91,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmBduz8A.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@@ -99,7 +99,7 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwmRduz8A.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@@ -107,6 +107,6 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(https://fonts.gstatic.com/s/sourcesanspro/v13/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2) format('woff2');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdu.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
}

View File

@@ -1,40 +0,0 @@
<!DOCTYPE html>
<!-- Link to specific tabs by using their ID in the URL like: options.html#keybinds -->
<head>
<title>__MSG_Options__ - SponsorBlock</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="../icons/LogoSponsorBlocker64px.png" type="image/png">
<link href="options.css" rel="stylesheet"/>
<script src="../js/options.js"></script>
</head>
<body class="sponsorBlockPageBody">
<div id="options-container">
<div id="menubar" class="center">
<div id="title" class="titleBar">
<img src="../icons/LogoSponsorBlocker256px.png" class="profilepic" alt="SponsorBlock logo"/>
SponsorLock
<div id="version"></div>
</div>
</div>
</div>
<div id="options">
<div style="font-size: 75px;">
With SponsorLock, <b>we</b> decide for <b>you</b>!
</div>
Would you want it any other way?
</div>
</div>
</body>

View File

@@ -123,6 +123,14 @@ html, body {
border-image: linear-gradient(to right, var(--border-color), #00000000 80%) 1;
}
.categoryExtraOptions {
padding-bottom: 20px;
}
#music_offtopic_autoSkipOnMusicVideos {
padding-bottom: 0;
}
.option-group > div:last-child, .option-group > #keybind-dialog {
border-bottom: inherit;
}
@@ -309,6 +317,15 @@ input[type='number'] {
color: grey;
}
.sb-toggle-option.disabled .slider {
cursor: default;
}
/* To hide everything except upsell button */
.disabled td:not(.skipOption, .categoryExtraOptions), .disabled td.skipOption > :not(.upsellButton) {
opacity: 0.3;
}
#options {
height: 100vh;
flex-basis: 80%;
@@ -346,6 +363,10 @@ input[type='number'] {
padding: 4px;
}
.switch-label {
width: inherit;
}
.switch {
position: relative;
display: inline-block;
@@ -670,4 +691,14 @@ svg {
#options > div {
max-width: 100%;
}
}
.upsellButton {
cursor: pointer;
vertical-align: middle;
}
.no-bottom-border {
border: none !important;
padding: 20px 0px 0px 0px !important;
}

View File

@@ -5,7 +5,7 @@
<title>__MSG_Options__ - SponsorBlock</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="../icons/LogoSponsorBlocker64px.png" type="image/png">
<link rel="icon" href="../icons/IconSponsorBlocker32px.png" type="image/png">
<link href="options.css" rel="stylesheet"/>
@@ -65,18 +65,6 @@
</div>
<div data-type="toggle" data-sync="autoSkipOnMusicVideos">
<div class="switch-container">
<label class="switch">
<input id="autoSkipOnMusicVideos" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="autoSkipOnMusicVideos">
__MSG_autoSkipOnMusicVideos__
</label>
</div>
</div>
<div data-type="toggle" data-sync="muteSegments">
<div class="switch-container">
<label class="switch">
@@ -89,7 +77,7 @@
</div>
</div>
<div data-type="toggle" data-sync="fullVideoSegments">
<div data-type="toggle" data-sync="fullVideoSegments" class="no-bottom-border">
<div class="switch-container">
<label class="switch">
<input id="fullVideoSegments" type="checkbox" checked>
@@ -101,6 +89,19 @@
</div>
</div>
<div data-type="toggle" data-sync="fullVideoLabelsOnThumbnails"
data-dependent-on="fullVideoSegments">
<div class="switch-container">
<label class="switch">
<input id="fullVideoLabelsOnThumbnails" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="fullVideoLabelsOnThumbnails">
__MSG_fullVideoLabelsOnThumbnails__
</label>
</div>
</div>
<div data-type="number-change" data-sync="minDuration">
<label class="number-container">
<span class="optionLabel">__MSG_minDuration__</span>
@@ -109,6 +110,20 @@
<div class="small-description">__MSG_minDurationDescription__</div>
</div>
<div data-type="toggle" data-sync="manualSkipOnFullVideo">
<div class="switch-container">
<label class="switch">
<input id="manualSkipOnFullVideo" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="manualSkipOnFullVideo">
__MSG_enableManualSkipOnFullVideo__
</label>
</div>
<div class="small-description">__MSG_whatManualSkipOnFullVideo__</div>
</div>
<div data-type="toggle" data-sync="forceChannelCheck">
<div class="switch-container">
@@ -138,6 +153,20 @@
<div class="small-description">__MSG_whatRefetchWhenNotFound__</div>
</div>
<div data-type="toggle" data-sync="showCategoryWithoutPermission">
<div class="switch-container">
<label class="switch">
<input id="showCategoryWithoutPermission" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="showCategoryWithoutPermission">
__MSG_enableShowCategoryWithoutPermission__
</label>
</div>
<div class="small-description">__MSG_whatShowCategoryWithoutPermission__</div>
</div>
</div>
<div id="interface" class="option-group hidden">
@@ -174,6 +203,18 @@
<option value="4">__MSG_noticeVisibilityMode4__</option>
</select>
</div>
<div data-type="toggle" data-sync="showCategoryGuidelines">
<div class="switch-container">
<label class="switch">
<input id="showCategoryGuidelines" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="showCategoryGuidelines">
__MSG_showCategoryGuidelines__
</label>
</div>
</div>
<div data-type="toggle" data-toggle-type="reverse" data-sync="hideVideoPlayerControls">
<div class="switch-container">
@@ -248,6 +289,18 @@
</label>
</div>
</div>
<div data-type="toggle" data-sync="allowScrollingToEdit">
<div class="switch-container">
<label class="switch">
<input id="allowScrollingToEdit" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="allowScrollingToEdit">
__MSG_allowScrollingToEdit__
</label>
</div>
</div>
<div data-type="toggle" data-sync="audioNotificationOnSkip">
<div class="switch-container">
@@ -301,6 +354,18 @@
</div>
</div>
<div data-type="toggle" data-toggle-type="reverse" data-sync="showUpsells" data-no-safari="true">
<div class="switch-container">
<label class="switch">
<input id="showUpsell" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="showUpsells">
__MSG_hideUpsells__
</label>
</div>
</div>
</div>
<div id="keybinds" class="option-group hidden">
@@ -320,6 +385,16 @@
<div class="inline"></div>
</div>
<div data-type="keybind-change" data-sync="nextChapterKeybind">
<label class="optionLabel">__MSG_nextChapterKeybind__:</label>
<div class="inline"></div>
</div>
<div data-type="keybind-change" data-sync="previousChapterKeybind">
<label class="optionLabel">__MSG_previousChapterKeybind__:</label>
<div class="inline"></div>
</div>
</div>
<div id="import" class="option-group hidden">
@@ -339,6 +414,8 @@
</div>
</div>
</div>
<div data-type="react-UnsubmittedVideosComponent"></div>
<div data-type="private-text-change" data-sync="*" data-confirm-message="exportOptionsWarning">
<h2>__MSG_exportOptions__</h2>
@@ -367,11 +444,17 @@
</div>
</div>
<div data-type="button-press" data-sync="resetToDefault" data-confirm-message="confirmResetToDefault">
<div class="option-button trigger-button">
__MSG_resetToDefault__
</div>
</div>
</div>
<div id="advanced" class="option-group hidden">
<div id="support-invidious" data-type="toggle" data-sync="supportInvidious" data-no-safari="true">
<div id="support-invidious" data-type="toggle" data-sync="supportInvidious">
<div class="switch-container">
<label class="switch">
<input id="supportInvidious" type="checkbox">
@@ -382,11 +465,11 @@
</label>
</div>
<div class="small-description">(__MSG_supportedSites__ Invidious, CloudTube)</div>
<div class="small-description">(__MSG_supportedSites__ Invidious, CloudTube, Piped)</div>
<div class="small-description">__MSG_supportOtherSitesDescription__ </div>
</div>
<div data-type="private-text-change" data-sync="invidiousInstances" data-no-safari="true" data-dependent-on="supportInvidious">
<div data-type="private-text-change" data-sync="invidiousInstances" data-dependent-on="supportInvidious">
<div class="option-button trigger-button">
__MSG_addInvidiousInstance__
</div>
@@ -461,7 +544,7 @@
<div class="small-description">__MSG_copyDebugInformationOptions__</div>
</div>
<div data-type="toggle" data-sync="testingServer" data-confirm-message="testingServerWarning" data-no-safari="true">
<div class="switch-container">
<label class="switch">

View File

@@ -1,3 +1,204 @@
@ajayyy/maze-utils
1.1.7 <https://github.com/ajayyy/SponsorBlock>
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
******************************
content-scripts-register-polyfill
4.0.2 <https://github.com/fregante/content-scripts-register-polyfill>
MIT License
Copyright (c) Federico Brigante <me@fregante.com> (https://fregante.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************
escape-string-regexp
5.0.0 <https://github.com/sindresorhus/escape-string-regexp>
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************
js-tokens
4.0.0 <https://github.com/lydell/js-tokens>
The MIT License (MIT)
@@ -50,37 +251,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
******************************
object-assign
4.1.1 <https://github.com/sindresorhus/object-assign>
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
******************************
react
17.0.2 <https://github.com/facebook/react>
18.2.0 <https://github.com/facebook/react>
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
@@ -107,7 +281,7 @@ SOFTWARE.
******************************
react-dom
17.0.2 <https://github.com/facebook/react>
18.2.0 <https://github.com/facebook/react>
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
@@ -134,7 +308,7 @@ SOFTWARE.
******************************
scheduler
0.20.2 <https://github.com/facebook/react>
0.23.0 <https://github.com/facebook/react>
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
@@ -156,3 +330,48 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************
webext-content-scripts
2.5.2 <https://github.com/fregante/webext-content-scripts>
MIT License
Copyright (c) Federico Brigante <me@fregante.com> (https://fregante.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************
webext-patterns
1.3.0 <https://github.com/fregante/webext-patterns>
MIT License
Copyright (c) Federico Brigante <me@fregante.com> (https://fregante.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************
webext-polyfill-kinda
1.0.0 <https://github.com/fregante/webext-polyfill-kinda>
MIT License
Copyright (c) Federico Brigante <me@fregante.com> (https://fregante.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -18,6 +18,12 @@
<br/>
<div class="center">
__MSG_invidiousPermissionRefresh__
</div>
<br/>
<div class="center">
<div id="acceptPermissionButton" class="option-button inline">
__MSG_acceptPermission__

View File

@@ -1,41 +1,64 @@
:root {
--sb-main-font-family: "Source Sans Pro", sans-serif;
--sb-main-bg-color: #222626;
--sb-main-bg-color: #222;
--sb-main-fg-color: #fff;
--sb-grey-bg-color: #333;
--sb-grey-fg-color: #999;
--sb-red-bg-color: #cc1717;
}
/*
* Container when popup displayed in-page
* Generic utilities
*/
#sponsorBlockPopupContainer {
.grey-text {
color: var(--sb-grey-fg-color);
}
.white-text {
color: var(--sb-main-fg-color);
}
.sbHeader {
font-size: 20px;
font-weight: bold;
text-align: left;
margin: 0;
}
#sponsorBlockPopupBody .u-mZ {
margin: 0 !important;
position: relative;
margin-bottom: 16px;
}
#sponsorBlockPopupBody .hidden {
display: none !important;
}
/*
* Disable fixed popup width when displayed in-page
* <button> elements that have icons
*/
#sponsorBlockPopupContainer #sponsorBlockPopupBody {
width: auto;
}
#setUsernameButton,
#copyUserID,
#submitUsername {
color: var(--sb-main-fg-color);
background: transparent;
width: fit-content;
padding: 0;
border: none;
}
/*
* Main containers
*/
#sponsorBlockPopupHTML {
color-scheme: dark;
max-height: 600px;
overflow-y: auto;
}
#sponsorBlockPopupBody {
margin: 0;
width: 374px;
font-family: var(--sb-main-font-family);
max-width: 100%; /* NOTE: Ensures content doesn't exceed restricted popup widths in Firefox */
font-size: 14px;
font-family: var(--sb-main-font-family);
background-color: var(--sb-main-bg-color);
color: var(--sb-main-fg-color);
color-scheme: dark;
@@ -45,18 +68,59 @@
text-align: center;
}
#sponsorblockPopup a,
#sponsorblockPopup button {
cursor: pointer;
}
/*
* Disable transition on all elements until the extension has loaded
*/
.sb-preload * {
transition: none !important;
}
/*
* Close popup button when displayed in-page
* Alert indicating that Beta server is enabled
*/
#sbBetaServerWarning {
padding: 8px;
font-size: 1em;
font-weight: 700;
color: var(--sb-main-fg-color);
background-color: var(--sb-red-bg-color);
cursor: pointer;
}
/*
* Container when popup displayed in-page (content.ts)
*/
#sponsorBlockPopupContainer {
position: relative;
margin-bottom: 16px;
}
#sponsorBlockPopupContainer iframe {
width: 100%;
}
/*
* Disable popup max height when displayed in-page (content.ts)
*/
#sponsorBlockPopupContainer #sponsorBlockPopupHTML {
max-height: none;
}
/*
* Disable fixed popup width when displayed in-page (content.ts)
*/
#sponsorBlockPopupBody.is-embedded {
width: auto;
}
/*
* Close popup button when displayed in-page (top-right corner)
*/
.sbCloseButton {
background: transparent;
border: 0;
@@ -75,52 +139,70 @@
/*
* Header logo
*/
.sbPopupLogo {
display: flex;
align-items: center;
font-size: 32px;
font-weight: bold;
justify-content: center;
font-weight: bold;
user-select: none;
padding: 20px 0 10px;
padding: 10px 0px 0px;
font-size: 32px;
}
.sbPopupLogo img {
margin-right: 8px;
margin: 8px;
}
/*
* Refresh segments button
*/
#refreshSegmentsButton {
background: transparent;
border: 0;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
padding: 5px;
margin: 5px auto;
align-items: center;
}
#refreshSegmentsButton:hover {
#issueReporterImportExport {
position: relative;
}
#refreshSegmentsButton, #issueReporterImportExport button {
background: transparent;
border-radius: 50%;
border: none;
}
#refreshSegmentsButton:hover, #issueReporterImportExport button:hover {
background-color: var(--sb-grey-bg-color);
}
#issueReporterImportExport button {
padding: 5px;
margin-right: 15px;
margin-left: 15px;
}
#issueReporterImportExport img {
width: 24px;
display: block;
}
#importSegmentsText {
margin-top: 7px;
}
#importSegmentsMenu button {
padding: 10px;
}
/*
* <details> wrapper around each segment
*/
.votingButtons {
font-family: Arial, Helvetica, sans-serif;
border-radius: 8px;
margin: 4px 16px;
}
.votingButtons[open] {
padding-bottom: 5px;
}
.votingButtons:hover {
background-color: var(--sb-grey-bg-color);
}
@@ -128,44 +210,72 @@
/*
* Individual segments summaries (clickable <summary>)
*/
.segmentSummary {
cursor: pointer;
font-weight: bold;
padding: 7px;
list-style: none;
display: flex;
align-items: center;
justify-content: space-between;
white-space: nowrap;
font-weight: bold;
list-style: none;
cursor: pointer;
padding: 4px 8px;
}
.segmentSummary > div {
text-align: left;
}
.segmentSummary::-webkit-details-marker {
display: none !important;
}
.segmentActive {
color: #bdfffb;
}
.segmentPassed {
color: #adadad;
}
/*
* Category dot in segment
*/
.sponsorTimesCategoryColorCircle {
margin: 0 8px;
margin-right: 8px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
}
/*
* Category name in segment
*/
.summaryLabel {
overflow-wrap: break-word;
white-space: normal;
}
.sbVoteButtonsContainer {
text-align: right;
}
/*
* Buttons that appear under a segment on click
*/
.voteButton {
height: 20px;
padding: 0 5px;
cursor: pointer;
}
.voteButton:hover {
opacity: 0.8;
}
/*
* "Voted!" text that appears after voting on a segment
*/
.sponsorTimesThanksForVotingText {
font-size: large;
}
@@ -173,113 +283,44 @@
/*
* Main controls menu
*/
.sbControlsMenu {
margin: 16px;
margin-top: 6px;
border-radius: 8px;
background-color: var(--sb-grey-bg-color);
display: flex;
justify-content: space-evenly;
margin-top: 10px;
}
.sbControlsMenu-item {
background-color: var(--sb-grey-bg-color);
border: 0;
padding: 0;
cursor: pointer;
user-select: none;
padding: 10px 15px;
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.sbControlsMenu-item {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
background: transparent;
user-select: none;
cursor: pointer;
border: none;
flex: 1;
padding: 10px 15px;
transition: background-color 0.2s ease-in-out;
}
.sbControlsMenu-item:hover {
background-color: #444;
}
.sbControlsMenu-itemIcon {
margin-bottom: 6px;
}
/*
* "Skipping is enabled" toggle
*/
.toggleSwitchContainer {
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
}
.toggleSwitchContainer-switch {
display: flex;
margin-bottom: 6px;
}
.switchBg {
display: block;
width: 50px;
height: 23px;
border-radius: 18.5px;
}
.switchBg.shadow {
box-shadow: 0.75px 0.75px 10px 0px rgba(50, 50, 50, 0.5);
opacity: 1;
}
.switchBg.white {
position: absolute;
background-color: #ccc;
opacity: 1;
}
.switchBg.green {
position: absolute;
background-color: #00a205;
opacity: 0;
transition: opacity 0.2s ease-out;
}
.switchDot {
background-color: var(--sb-main-fg-color);
border-radius: 50%;
width: 15px;
height: 15px;
margin: 4px;
position: absolute;
box-shadow: 0.75px 0.75px 3.8px 0px rgba(50, 50, 50, 0.45);
transition: transform 0.2s ease-out;
}
#toggleSwitch:checked ~ .switchDot {
transform: translateX(27px);
}
#toggleSwitch:checked ~ .switchBg.green {
opacity: 1;
}
#toggleSwitch:checked ~ .switchBg.white {
opacity: 0;
transition: opacity 0.2s step-end;
}
/*
* Whitelist add/remove icon
*/
.SBWhitelistIcon > path {
fill: var(--sb-main-fg-color);
}
.SBWhitelistIcon.rotated {
transform: rotate(45deg);
}
@keyframes rotate {
from {
transform: rotate(0deg);
@@ -289,258 +330,304 @@
}
}
/*
* "Skipping is enabled" toggle
*/
.toggleSwitchContainer {
display: flex;
align-items: center;
flex-direction: column;
}
.toggleSwitchContainer-switch {
display: flex;
margin-bottom: 6px;
}
.switchBg {
width: 50px;
height: 23px;
display: block;
border-radius: 18.5px;
}
.switchBg.shadow {
box-shadow: 0.75px 0.75px 10px 0px rgba(50, 50, 50, 0.5);
opacity: 1;
}
.switchBg.white {
opacity: 1;
position: absolute;
background-color: #ccc;
}
.switchBg.green {
opacity: 0;
position: absolute;
background-color: #00a205;
transition: opacity 0.2s ease-out;
}
.switchDot {
width: 15px;
margin: 4px;
height: 15px;
border-radius: 50%;
position: absolute;
transition: transform 0.2s ease-out;
background-color: var(--sb-main-fg-color);
box-shadow: 0.75px 0.75px 3.8px 0px rgba(50, 50, 50, 0.45);
}
#toggleSwitch:checked ~ .switchDot {
transform: translateX(27px);
}
#toggleSwitch:checked ~ .switchBg.green {
opacity: 1;
}
#toggleSwitch:checked ~ .switchBg.white {
transition: opacity 0.2s step-end;
opacity: 0;
}
/*
* Notice that appears when whitelisting a channel, that recommends
* enabling the "Force Channel Check Before Skipping" option
*/
#whitelistForceCheck {
font-weight: bold;
text-decoration: underline;
font-size: large;
cursor: pointer;
padding: 10px 0;
background-color: #fff3cd;
padding: 10px 15px;
display: block;
color: #664d03;
}
#whitelistForceCheck:hover {
background-color: #f2e4b7;
}
/*
* Container around the "Segment Starts Now" and "Submit Times" buttons
* Submit box
*/
#mainControls {
flex-flow: column;
align-items: center;
margin-bottom: 12px;
margin: 16px;
padding: 8px 14px;
text-align: left;
border-radius: 8px;
border: 2px solid var(--sb-grey-bg-color);
}
.sponsorStartHint {
display: block;
text-align: left;
padding-top: 3px;
}
/*
* Generic buttons used for "Segment Starts Now" and "Submit Times"
* Generic red buttons used for "Start Segment Now", "Submit Times" etc.
*/
.sbMediumButton {
background-color: var(--sb-red-bg-color);
border: 0;
-moz-border-radius: 28px;
-webkit-border-radius: 28px;
border: none;
font-size: 16px;
padding: 8px 16px;
border-radius: 28px;
display: inline-block;
cursor: pointer;
-moz-border-radius: 28px;
-webkit-border-radius: 28px;
color: var(--sb-main-fg-color);
font-size: 16px;
padding: 8px 37px;
font-family: var(--sb-main-font-family);
transition: 0.01s background-color;
font-family: var(--sb-main-font-family);
background-color: var(--sb-red-bg-color);
}
.sbMediumButton:hover,
.sbMediumButton:focus {
outline: none;
background-color: #ec1c1c;
outline: none;
}
.sbMediumButton:active {
position: relative;
top: 1px;
}
/*
* "Submit Times" button
*/
#submitTimes {
margin-top: 12px;
}
/*
* Heading utility class
* Your Work box
*/
.sbHeader {
font-size: 20px;
font-weight: bold;
margin: 10px 0 5px;
.sbYourWorkBox {
margin: 16px;
margin-bottom: 8px;
border-radius: 8px;
border: 2px solid var(--sb-grey-bg-color);
}
/*
* Side-by-side section of "Your Work"
*/
.sbYourWorkCols {
display: flex;
margin: 0 20px 12px;
border-top: 2px solid var(--sb-grey-bg-color);
border-bottom: 2px solid var(--sb-grey-bg-color);
}
.sbYourWorkCols > div {
display: flex;
align-items: center;
width: 50%;
justify-content: center;
.sbStatsSentence {
padding: 6px 14px;
}
/*
* <button> elements that have icons
*/
#setUsernameButton,
#submitUsername,
#copyUserID {
background: transparent;
border: 0;
cursor: pointer;
padding: 0;
color: var(--sb-main-fg-color);
width: fit-content;
}
/*
* Prevent username from wrapping
*/
#setUsernameButton {
flex: 0 1;
margin-right: 5px;
}
/*
* Set username button
*/
#submitUsername {
padding-left: 7px;
.sbExtraInfo {
display: inline-block;
}
/*
* Increase font size of username input and display
*/
#usernameValue,
#usernameInput,
#sponsorTimesContributionsDisplay {
#usernameInput {
font-size: 16px;
flex: 1 0;
}
/*
* Left align "Username" and "Submissions" labels
#sponsorTimesContributionsDisplay {
font-size: 16px;
}
/*
* Improve alignment of username and submissions
*/
#usernameElement > div > p,
#usernameElement > p,
#sponsorTimesContributionsContainer {
text-align: start;
text-align: left;
}
/*
* Enable flexbox for buttons with SVG icon
* Username
*/
#usernameElement {
padding: 8px 14px;
min-width: 50%;
width: 100%;
}
#setUsernameContainer {
display: flex;
align-items: center;
width: fit-content;
}
#setUsernameContainer > button {
display: flex;
}
/*
* Improve position of "Copy User ID" button
*/
#setUsernameButton {
margin-right: 5px;
flex: 0 1;
}
#submitUsername {
padding-left: 16px;
}
#copyUserID {
width: 100%;
flex: 0 1;
}
/*
* Container around username display and edit
*/
#setUsernameContainer {
display: flex;
}
/*
* Improve alignment of username and submissions
*/
#usernameElement > div,
#sponsorTimesContributionsContainer > div {
display: flex;
flex-flow: column nowrap;
align-items: flex-start;
}
/*
* Truncate username display
*/
#usernameValue {
overflow: hidden;
text-overflow: ellipsis;
max-width: 130px;
margin-right: 8px;
white-space: nowrap;
overflow: hidden;
margin: 0 8px 0 0;
max-width: 165px;
}
/*
* Set username form container with "expanded" state
*/
#setUsername {
display: flex;
}
#setUsername.SBExpanded {
width: 200%;
text-align: left;
}
/*
* Set username input
*/
#usernameInput {
background: transparent;
padding: 2px;
border: var(--sb-main-fg-color) 1px solid;
color: var(--sb-main-fg-color);
width: calc(100% - 24px);
border: none;
padding: 4px 8px;
border-radius: 4px;
width: calc(100% - 68px);
text-overflow: ellipsis;
color: var(--sb-main-fg-color);
background-color: var(--sb-grey-bg-color);
}
/*
* Submissions
*/
#sponsorTimesContributionsContainer {
padding: 8px 14px;
border-left: 2px solid var(--sb-grey-bg-color);
}
/*
* Footer
*/
#sbFooter {
margin-top: 10px;
padding-bottom: 20px;
padding: 8px 0;
}
#sbFooter a {
transition: background 0.3s ease !important;
color: var(--sb-main-fg-color);
display: inline-block;
text-decoration: none;
border-radius: 4px;
background-color: #333;
padding: 4px 8px;
font-weight: 500;
margin: 2px 1px;
}
#sbFooter a:hover {
background-color: #444;
}
#sbFooter a {
#sponsorTimesDonateContainer a {
color: var(--sb-main-fg-color);
cursor: pointer;
text-decoration: none;
}
/*
* "Show Notice Again" button
*/
#showNoticeAgain {
background: transparent;
border: 1px solid #fff;
border-radius: 5px;
color: var(--sb-main-fg-color);
cursor: pointer;
margin-bottom: 20px;
padding: 5px;
}
/*
* Generic spacing classes
*/
.u-mZ {
#sponsorBlockPopupBody .u-mZ {
margin: 0 !important;
}
/*
* Generic hide utility classes
*/
#sponsorBlockPopupBody .hidden {
display: none !important;
}
#issueReporterTabs {
margin: 5px;
}
#issueReporterTabs > span {
padding: 2px 4px;
margin: 0 3px;
cursor: pointer;
background-color: #444848;
border-radius: 10px;
}
#issueReporterTabs > span > span {
position: relative;
padding: 0.2em 0;
}
#issueReporterTabs > span > span::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0.1em;
background-color: rgb(145, 0, 0);
transition: transform 300ms;
transform: scaleX(0);
transform-origin: center;
}
#issueReporterTabs > span.sbSelected > span::after {
transform: scaleX(0.8);
}

View File

@@ -6,32 +6,69 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link id="sponsorBlockPopupFont" href="/libs/Source+Sans+Pro.css" rel="stylesheet">
<link id="sponsorBlockStyleSheet" href="popup.css" rel="stylesheet">
<link id="sponsorBlockStyleSheet" href="shared.css" rel="stylesheet">
</head>
<body id="sponsorBlockPopupBody">
<body id="sponsorBlockPopupBody" style="visibility: hidden">
<div id="sponsorblockPopup" class="sponsorBlockPageBody sb-preload">
<button id="sbCloseButton" title="__MSG_closePopup__" class="sbCloseButton hidden">
<img src="icons/close.png" width="15" height="15" alt="Close icon">
</button>
<div id="sbBetaServerWarning" class="hidden" title="__MSG_openOptionsPage__">
__MSG_betaServerWarning__
</div>
<header class="sbPopupLogo">
<img src="icons/IconSponsorBlocker256px.png" alt="SponsorBlock" width="40" height="40" id="sponsorBlockPopupLogo">
<p class="u-mZ">SponsorLock</p>
<p class="u-mZ">SponsorBlock</p>
</header>
<div id="videoInfo">
<!-- Loading text -->
<p id="loadingIndicator" class="u-mZ">__MSG_noVideoID__</p>
<p id="loadingIndicator" class="u-mZ grey-text">__MSG_noVideoID__</p>
<!-- If the video was found in the database -->
<p id="videoFound" class="u-mZ"></p>
<p id="videoFound" class="u-mZ grey-text"></p>
<button id="refreshSegmentsButton" title="__MSG_refreshSegments__">
<img src="/icons/refresh.svg" alt="Refresh icon" id="refreshSegments" />
</button>
<!-- Video Segments -->
<div id="issueReporterContainer">
<div id="issueReporterTabs" class="hidden">
<span id="issueReporterTabSegments" class="sbSelected">
<span>__MSG_SegmentsCap__</span>
</span>
<span id="issueReporterTabChapters">
<span>__MSG_Chapters__</span>
</span>
</div>
<div id="issueReporterTimeButtons"></div>
<div id="issueReporterImportExport" class="hidden">
<div id="importExportButtons">
<button id="importSegmentsButton" title="__MSG_importSegments__">
<img src="/icons/import.svg" alt="Refresh icon" id="importSegments" />
</button>
<button id="exportSegmentsButton" class="hidden" title="__MSG_exportSegments__">
<img src="/icons/export.svg" alt="Export icon" id="exportSegments" />
</button>
</div>
<span id="importSegmentsMenu" class="hidden">
<textarea id="importSegmentsText" rows="5" style="width:80%"></textarea>
<button id="importSegmentsSubmit" title="__MSG_importSegments__">
__MSG_Import__
</button>
</span>
</div>
</div>
</div>
<!-- Toggle Box -->
<div class="sbControlsMenu">
<label style="display: none" id="whitelistButton" for="whitelistToggle" class="hidden sbControlsMenu-item" title="__MSG_forceChannelCheckPopup__">
<input type="checkbox" style="display:none;" id="whitelistToggle">
<label id="whitelistButton" for="whitelistToggle" class="hidden sbControlsMenu-item">
<input type="checkbox" style="display: none" id="whitelistToggle">
<svg viewBox="0 0 24 24" width="23" height="23" class="SBWhitelistIcon sbControlsMenu-itemIcon">
<path d="M24 10H14V0h-4v10H0v4h10v10h4V14h10z" />
</svg>
@@ -41,7 +78,7 @@
<!--github: mbledkowski/toggle-switch-->
<label id="disableExtension" for="toggleSwitch" class="toggleSwitchContainer sbControlsMenu-item">
<span class="toggleSwitchContainer-switch">
<input type="checkbox" style="display:none;" id="toggleSwitch" checked>
<input type="checkbox" style="display: none" id="toggleSwitch" checked>
<span class="switchBg shadow"></span>
<span class="switchBg white"></span>
<span class="switchBg green"></span>
@@ -56,31 +93,37 @@
</button>
</div>
<p id="whitelistForceCheck" class="u-mZ hidden">
<a id="whitelistForceCheck" class="hidden">
__MSG_forceChannelCheckPopup__
</p>
</a>
<!-- Submit box -->
<div id="mainControls" style="display: none">
<p class="sbHeader">
<h1 class="sbHeader">
__MSG_recordTimesDescription__
</p>
<sub style="margin-bottom: 12px;">__MSG_popupHint__</sub>
<div>
<button id="sponsorStart" class="sbMediumButton">__MSG_sponsorStart__</button>
</div>
<div id="submissionSection" style="display: none">
<b style="display: block; margin-top: 12px;">__MSG_submissionEditHint__</b>
<button id="submitTimes" class="sbMediumButton">__MSG_submitTimesButton__</button>
</h1>
<sub class="sponsorStartHint grey-text">__MSG_popupHint__</sub>
<div style="text-align: center; margin: 8px 0;">
<button id="sponsorStart" class="sbMediumButton" style="margin-right: 8px">__MSG_sponsorStart__</button>
<button id="submitTimes" class="sbMediumButton" style="display: none">__MSG_OpenSubmissionMenu__</button>
</div>
<span id="submissionHint" style="display: none">__MSG_submissionEditHint__</span>
</div>
<h1 class="recordingSubtitle sbHeader" style="display: none">__MSG_yourWork__</h1>
<div class="sbYourWorkCols" style="display: none">
<div id="usernameElement">
<div>
<p class="u-mZ">__MSG_Username__:</p>
<!-- Your Work box -->
<div class="sbYourWorkBox">
<h1 class="sbHeader" style="padding: 8px 15px;">
__MSG_yourWork__
</h1>
<div class="sbYourWorkCols">
<!-- Username -->
<div id="usernameElement">
<p class="u-mZ grey-text">__MSG_Username__:
<!-- loading/errors -->
<span id="setUsernameStatus" class="u-mZ white-text" style="display: none"></span>
</p>
<div id="setUsernameContainer">
<p id="usernameValue" class="u-mZ"></p>
<p id="usernameValue"></p>
<button id="setUsernameButton" title="__MSG_setUsername__">
<img src="/icons/pencil.svg" alt="__MSG_setUsername__" width="16" height="16" id="sbPopupIconEdit">
</button>
@@ -89,65 +132,70 @@
</button>
</div>
<div id="setUsername" style="display: none">
<div id="setUsernameStatusContainer" style="display: none">
<p id="setUsernameStatus" class="u-mZ"></p>
</div>
<input id="usernameInput" placeholder="Username">
<button id="submitUsername">
<img src="/icons/check.svg" alt="__MSG_setUsername__" width="16" height="16" id="sbPopupIconCheck">
</button>
</div>
</div>
</div>
<div id="sponsorTimesContributionsContainer" class="hidden">
<div>
<p class="u-mZ">__MSG_Submissions__:</p>
<span id="sponsorTimesContributionsDisplay">
0
</span>
<!-- Submissions -->
<div id="sponsorTimesContributionsContainer" class="hidden">
<p class="u-mZ grey-text">__MSG_Submissions__:</p>
<p id="sponsorTimesContributionsDisplay" class="u-mZ">0</p>
</div>
</div>
<p id="sponsorTimesViewsContainer" style="display: none" class="u-mZ sbStatsSentence">
__MSG_savedPeopleFrom__
<b>
<span id="sponsorTimesViewsDisplay">0</span>
</b>
<span id="sponsorTimesViewsDisplayEndWord">__MSG_Segments__</span>
<br />
<span class="sbExtraInfo">
(
<b>
<span id="sponsorTimesOthersTimeSavedDisplay">0</span>
<span id="sponsorTimesOthersTimeSavedEndWord">__MSG_minsLower__</span>
</b>
<span>__MSG_youHaveSavedTimeEnd__</span>
)
</span>
</p>
<p id="sponsorTimesSkipsDoneContainer" style="display: none" class="u-mZ sbStatsSentence">
__MSG_youHaveSkipped__
<b>
<span id="sponsorTimesSkipsDoneDisplay">0</span>
</b>
<span id="sponsorTimesSkipsDoneEndWord">__MSG_Segments__</span>
<span class="sbExtraInfo">
(
<b>
<span id="sponsorTimeSavedDisplay">0</span>
<span id="sponsorTimeSavedEndWord">__MSG_minsLower__</span>
</b>
)
</span>
</p>
</div>
<p id="sponsorTimesViewsContainer" style="display: none" class="u-mZ">
__MSG_savedPeopleFrom__
<b><span id="sponsorTimesViewsDisplay">
0
</span></b>
<span id="sponsorTimesViewsDisplayEndWord">__MSG_Segments__</span>
<br>
(<b><span id="sponsorTimesOthersTimeSavedDisplay">0</span>
<span id="sponsorTimesOthersTimeSavedEndWord">__MSG_minsLower__</span></b>
<span>__MSG_youHaveSavedTimeEnd__</span>).
</p>
<p id="sponsorTimesSkipsDoneContainer" style="display: none" class="u-mZ">
__MSG_youHaveSkipped__
<b><span id="sponsorTimesSkipsDoneDisplay">
0
</span></b>
<span id="sponsorTimesSkipsDoneEndWord">__MSG_Segments__</span>
(<b><span id="sponsorTimeSavedDisplay">
0
</span>
<span id="sponsorTimeSavedEndWord">__MSG_minsLower__</span></b>).
</p>
<div id="sponsorTimesDonateContainer" style="display: none; align-items: center; justify-content: center;">
<img class="sbHeart" src="/icons/heart.svg" alt="Heart icon" />
<a id="sbConsiderDonateLink" href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener">
__MSG_considerDonating__
</a>
<img id="sbCloseDonate" src="/icons/close.png" alt="__MSG_closeIcon__" height="8" style="padding-left: 5px; cursor: pointer;" />
</div>
<footer id="sbFooter" style="display: none">
<div id="sponsorTimesDonateContainer" style="display: none; align-items: center; justify-content: center;">
<img class="sbHeart" src="/icons/heart.svg" alt="Heart icon" />
<a id="sbConsiderDonateLink" href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener">
__MSG_considerDonating__
</a>
<img id="sbCloseDonate" src="/icons/close.png" alt="Close icon" height="8" style="padding-left: 5px; cursor: pointer;" />
</div>
<a href="https://sponsor.ajay.app" target="_blank" rel="noopener">__MSG_website__</a> |
<a href="https://sponsor.ajay.app/stats" target="_blank" rel="noopener">__MSG_viewLeaderboard__</a> |
<a href="https://github.com/ajayyy/SponsorBlock" target="_blank" rel="noopener">GitHub</a>
<br/>
<a href="https://discord.gg/SponsorBlock" target="_blank" rel="noopener">Discord</a> |
<a href="https://matrix.to/#/#sponsor:ajay.app?via=ajay.app&via=matrix.org&via=mozilla.org" target="_blank" rel="noopener">Matrix</a> |
<footer id="sbFooter">
<a id="helpButton">__MSG_help__</a>
<a href="https://sponsor.ajay.app" target="_blank" rel="noopener">__MSG_website__</a>
<a href="https://sponsor.ajay.app/stats" target="_blank" rel="noopener">__MSG_viewLeaderboard__</a>
<br />
<a href="https://github.com/ajayyy/SponsorBlock" target="_blank" rel="noopener">GitHub</a>
<a href="https://discord.gg/SponsorBlock" target="_blank" rel="noopener">Discord</a>
<a href="https://matrix.to/#/#sponsor:ajay.app?via=ajay.app&via=matrix.org&via=mozilla.org" target="_blank" rel="noopener">Matrix</a>
<a href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener" id="sbDonate">$</a>
</footer>
<button id="showNoticeAgain" style="display: none">__MSG_showNotice__</button>

View File

@@ -0,0 +1 @@
{"Albania":{"allowed":true},"Algeria":{"allowed":true},"Angola":{"allowed":true},"Argentina":{"allowed":true},"Armenia":{"allowed":true},"Australia":{"allowed":false},"Austria":{"allowed":false},"Azerbaijan":{"allowed":true},"Bangladesh":{"allowed":true},"Belarus":{"allowed":true},"Belgium":{"allowed":false},"Belize":{"allowed":true},"Benin":{"allowed":true},"Bhutan":{"allowed":true},"Bolivia":{"allowed":true},"Bosnia and Herzegovina":{"allowed":true},"Botswana":{"allowed":true},"Brazil":{"allowed":true},"Bulgaria":{"allowed":true},"Burkina Faso":{"allowed":true},"Burundi":{"allowed":true},"Cameroon":{"allowed":true},"Canada":{"allowed":false},"Central African Republic":{"allowed":true},"Chad":{"allowed":true},"Chile":{"allowed":true},"China":{"allowed":true},"Colombia":{"allowed":true},"Comoros":{"allowed":true},"Costa Rica":{"allowed":true},"Croatia":{"allowed":true},"Cyprus":{"allowed":false},"Czech Republic":{"allowed":false},"Denmark":{"allowed":false},"Djibouti":{"allowed":true},"Dominican Republic":{"allowed":true},"DR Congo":{"allowed":true},"Ecuador":{"allowed":true},"Egypt":{"allowed":true},"El Salvador":{"allowed":true},"Estonia":{"allowed":false},"Eswatini":{"allowed":true},"Ethiopia":{"allowed":true},"Fiji":{"allowed":true},"Finland":{"allowed":false},"France":{"allowed":false},"Gabon":{"allowed":true},"Gambia":{"allowed":true},"Georgia":{"allowed":true},"Germany":{"allowed":false},"Ghana":{"allowed":true},"Greece":{"allowed":true},"Guatemala":{"allowed":true},"Guinea":{"allowed":true},"Guinea-Bissau":{"allowed":true},"Guyana":{"allowed":true},"Haiti":{"allowed":true},"Honduras":{"allowed":true},"Hungary":{"allowed":true},"Iceland":{"allowed":false},"India":{"allowed":true},"Iran":{"allowed":true},"Iraq":{"allowed":true},"Ireland":{"allowed":false},"Israel":{"allowed":false},"Italy":{"allowed":false},"Ivory Coast":{"allowed":true},"Jamaica":{"allowed":true},"Japan":{"allowed":false},"Jordan":{"allowed":true},"Kazakhstan":{"allowed":true},"Kenya":{"allowed":true},"Kiribati":{"allowed":true},"Kyrgyzstan":{"allowed":true},"Laos":{"allowed":true},"Latvia":{"allowed":true},"Lebanon":{"allowed":true},"Lesotho":{"allowed":true},"Liberia":{"allowed":true},"Lithuania":{"allowed":true},"Luxembourg":{"allowed":false},"Madagascar":{"allowed":true},"Malawi":{"allowed":true},"Malaysia":{"allowed":true},"Maldives":{"allowed":true},"Mali":{"allowed":true},"Malta":{"allowed":false},"Mauritania":{"allowed":true},"Mauritius":{"allowed":true},"Mexico":{"allowed":true},"Micronesia":{"allowed":true},"Moldova":{"allowed":true},"Mongolia":{"allowed":true},"Montenegro":{"allowed":true},"Morocco":{"allowed":true},"Mozambique":{"allowed":true},"Myanmar":{"allowed":true},"Namibia":{"allowed":true},"Nepal":{"allowed":true},"Netherlands":{"allowed":false},"Nicaragua":{"allowed":true},"Niger":{"allowed":true},"Nigeria":{"allowed":true},"North Macedonia":{"allowed":true},"Norway":{"allowed":false},"Pakistan":{"allowed":true},"Panama":{"allowed":true},"Papua New Guinea":{"allowed":true},"Paraguay":{"allowed":true},"Peru":{"allowed":true},"Philippines":{"allowed":true},"Poland":{"allowed":true},"Portugal":{"allowed":true},"Republic of the Congo":{"allowed":true},"Romania":{"allowed":true},"Russia":{"allowed":true},"Rwanda":{"allowed":true},"Saint Lucia":{"allowed":true},"Samoa":{"allowed":true},"Sao Tome and Principe":{"allowed":true},"Senegal":{"allowed":true},"Serbia":{"allowed":true},"Seychelles":{"allowed":true},"Sierra Leone":{"allowed":true},"Slovakia":{"allowed":true},"Slovenia":{"allowed":false},"Solomon Islands":{"allowed":true},"South Africa":{"allowed":true},"South Korea":{"allowed":false},"South Sudan":{"allowed":true},"Spain":{"allowed":false},"Sri Lanka":{"allowed":true},"Sudan":{"allowed":true},"Suriname":{"allowed":true},"Sweden":{"allowed":false},"Switzerland":{"allowed":false},"Syria":{"allowed":true},"Taiwan":{"allowed":false},"Tajikistan":{"allowed":true},"Tanzania":{"allowed":true},"Thailand":{"allowed":true},"Timor-Leste":{"allowed":true},"Togo":{"allowed":true},"Tonga":{"allowed":true},"Trinidad and Tobago":{"allowed":true},"Tunisia":{"allowed":true},"Turkey":{"allowed":true},"Turkmenistan":{"allowed":true},"Tuvalu":{"allowed":true},"Uganda":{"allowed":true},"Ukraine":{"allowed":true},"United Arab Emirates":{"allowed":false},"United Kingdom":{"allowed":false},"United States":{"allowed":false},"Uruguay":{"allowed":true},"Uzbekistan":{"allowed":true},"Vanuatu":{"allowed":true},"Venezuela":{"allowed":true},"Vietnam":{"allowed":true},"Yemen":{"allowed":true},"Zambia":{"allowed":true},"Zimbabwe":{"allowed":true}}

219
public/shared.css Normal file
View File

@@ -0,0 +1,219 @@
.sponsorSkipNoticeParent {
position: absolute;
bottom: 100px;
right: var(--skip-notice-right);
}
.sponsorSkipNoticeParent, .sponsorSkipNotice {
border-spacing: var(--skip-notice-border-horizontal) var(--skip-notice-border-vertical);
padding-left: var(--skip-notice-padding);
padding-right: var(--skip-notice-padding);
border-collapse: unset;
}
.sponsorSkipNoticeParent {
min-width: 350px;
max-width: 50%;
}
.sponsorSkipNotice {
width: 100%;
}
.sponsorSkipNoticeTableContainer {
background-color: rgba(28, 28, 28, 0.9);
border-radius: 5px;
min-width: 100%;
}
.sponsorSkipNotice {
transition: all 0.1s ease-out;
}
.sponsorSkipNoticeLimitWidth {
max-width: calc(100% - 50px);
}
.sponsorSkipNotice .hidden {
display: none;
}
/* For Cloudtube */
.sponsorSkipNotice td, .sponsorSkipNotice table, .sponsorSkipNotice th {
border: none;
}
.sponsorSkipNoticeFadeIn {
animation: fadeIn 0.5s ease-out;
}
.sponsorSkipNoticeFaded {
opacity: 0.5;
}
.sponsorSkipNoticeFadeOut {
transition: opacity 3s cubic-bezier(0.55, 0.055, 0.675, 0.19);
opacity: 0 !important;
animation: none !important;
}
.sponsorSkipNotice .sponsorSkipNoticeTimeLeft {
color: #eeeeee;
border-radius: 4px;
padding: 2px 5px;
font-size: 12px;
display: flex;
align-items: center;
border: 1px solid #eeeeee;
}
.sponsorSkipNoticeTimeLeft img {
vertical-align: middle;
height: 13px;
padding-top: 7.8%;
padding-bottom: 7.8%;
}
/* if two are very close to eachother */
.secondSkipNotice {
bottom: 290px;
}
.noticeLeftIcon {
display: flex;
align-items: center;
}
.sponsorSkipNotice .sponsorSkipNoticeUnskipSection {
float: left;
border-left: 1px solid rgb(150, 150, 150);
}
.sponsorSkipNoticeButton {
background: none;
color: rgb(235, 235, 235);
border: none;
display: inline-block;
font-size: 13.3333px !important;
cursor: pointer;
margin-right: 10px;
padding: 2px 5px;
}
.sponsorSkipNoticeButton:hover {
background-color: rgba(235, 235, 235,0.2);
border-radius: 4px;
transition: background-color 0.4s;
}
.sponsorSkipNoticeFirstRow .sponsorSkipNoticeButton.sponsorSkipSmallButton {
height: 1.3em;
padding: 0;
}
.sponsorTimesVoteButtonsContainer {
float: left;
vertical-align:middle;
padding: 2px 5px;
margin-right: 4px;
}
.sponsorTimesVoteButtonsContainer div{
display: inline-block;
}
.sponsorSkipNoticeRightSection {
right: 0;
position: absolute;
float: right;
margin-right: 10px;
display: flex;
align-items: center;
}
.sponsorSkipNoticeRightButton {
margin-right: 0;
}
.sponsorSkipNoticeCloseButton {
height: 10px;
width: 10px;
box-sizing: unset;
padding: 2px 5px;
margin-left: 2px;
float: right;
}
.sponsorSkipNoticeCloseButton.biggerCloseButton {
padding: 20px;
}
.sponsorSkipMessage {
font-size: 14px;
font-weight: bold;
color: rgb(235, 235, 235);
margin-top: auto;
display: inline-block;
margin-right: 10px;
margin-bottom: auto;
}
.sponsorSkipInfo {
font-size: 10px;
color: #000000;
text-align: center;
margin-top: 0px;
}
#sponsorTimesThanksForVotingText {
font-size: 20px;
font-weight: bold;
color: #000000;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
#sponsorTimesThanksForVotingInfoText {
font-size: 12px;
font-weight: bold;
color: #000000;
text-align: center;
margin-top: 0px;
}
.sponsorTimesVoteButtonMessage {
float: left;
}
.sponsorTimesInfoMessage {
font-size: 13.3333px;
color: rgb(235, 235, 235);
}
.sb-guidelines-notice .sponsorTimesInfoMessage td {
padding-left: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: 15px;
display: flex;
align-items: center;
}

View File

@@ -2,9 +2,14 @@ import * as CompileConfig from "../config.json";
import Config from "./config";
import { Registration } from "./types";
import "content-scripts-register-polyfill";
import { sendRealRequestToCustomServer, setupBackgroundRequestProxy } from "@ajayyy/maze-utils/lib/background-request-proxy";
import { setupTabUpdates } from "@ajayyy/maze-utils/lib/tab-updates";
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
// Make the config public for debugging purposes
// window.SB = Config; //no window for service workers
window.SB = Config;
import Utils from "./utils";
const utils = new Utils({
@@ -12,62 +17,98 @@ const utils = new Utils({
unregisterFirefoxContentScript
});
const popupPort: Record<string, chrome.runtime.Port> = {};
// Used only on Firefox, which does not support non persistent background pages.
const contentScriptRegistrations = {};
// Register content script if needed
if (utils.isFirefox()) {
utils.wait(() => Config.config !== null).then(function() {
if (Config.config.supportInvidious) utils.setupExtraSiteContentScripts();
});
}
chrome.tabs.onUpdated.addListener(function(tabId) {
chrome.tabs.sendMessage(tabId, {
message: 'update',
}, () => void chrome.runtime.lastError ); // Suppress error on Firefox
utils.wait(() => Config.config !== null).then(function() {
if (Config.config.supportInvidious) utils.setupExtraSiteContentScripts();
});
setupBackgroundRequestProxy();
setupTabUpdates(Config);
chrome.runtime.onMessage.addListener(function (request, sender, callback) {
switch(request.message) {
switch(request.message) {
case "openConfig":
chrome.tabs.create({url: chrome.runtime.getURL('options/lock-options.html' + (request.hash ? '#' + request.hash : ''))});
return;
chrome.tabs.create({url: chrome.runtime.getURL('options/options.html' + (request.hash ? '#' + request.hash : ''))});
return false;
case "openHelp":
chrome.tabs.create({url: chrome.runtime.getURL('help/index.html')});
return;
return false;
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({
responseText: await response.text(),
status: response.status,
ok: response.ok
});
});
return true;
return false;
case "submitVote":
submitVote(request.type, request.UUID, request.category).then(callback);
//this allows the callback to be called later
return true;
case "registerContentScript":
case "registerContentScript":
registerFirefoxContentScript(request);
return false;
case "unregisterContentScript":
case "unregisterContentScript":
unregisterFirefoxContentScript(request.id)
return false;
case "tabs": {
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
chrome.tabs.sendMessage(
tabs[0].id,
request.data,
(response) => {
callback(response);
}
);
});
return true;
}
case "time":
case "infoUpdated":
case "videoChanged":
if (sender.tab) {
popupPort[sender.tab.id]?.postMessage(request);
}
return false;
default:
return false;
}
});
chrome.runtime.onMessageExternal.addListener((request, sender, callback) => {
if (CompileConfig.extensionCommunicationAllowList.includes(sender.id)) {
if (request.message === "requestConfig") {
callback({
userID: Config.config.userID,
allowExpirements: Config.config.allowExpirements,
showDonationLink: Config.config.showDonationLink,
showUpsells: Config.config.showUpsells,
darkMode: Config.config.darkMode,
})
}
}
});
chrome.runtime.onConnect.addListener((port) => {
if (port.name === "popup") {
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
popupPort[tabs[0].id] = port;
});
}
});
//add help page on install
chrome.runtime.onInstalled.addListener(function () {
// This let's the config sync to run fully before checking.
// This is required on Firefox
setTimeout(function() {
setTimeout(async () => {
const userID = Config.config.userID;
// If there is no userID, then it is the first install.
@@ -76,27 +117,33 @@ chrome.runtime.onInstalled.addListener(function () {
chrome.tabs.create({url: chrome.extension.getURL("/help/index.html")});
//generate a userID
const newUserID = utils.generateUserID();
const newUserID = generateUserID();
//save this UUID
Config.config.userID = newUserID;
// Don't show update notification
Config.config.categoryPillUpdate = true;
}
if (Config.config.supportInvidious) {
if (!(await utils.containsInvidiousPermission())) {
chrome.tabs.create({url: chrome.extension.getURL("/permissions/index.html")});
}
}
}, 1500);
});
/**
* Only works on Firefox.
* Firefox requires that it be applied after every extension restart.
*
* @param {JSON} options
*
* @param {JSON} options
*/
function registerFirefoxContentScript(options: Registration) {
const oldRegistration = contentScriptRegistrations[options.id];
if (oldRegistration) oldRegistration.unregister();
browser.contentScripts.register({
chrome.contentScripts.register({
allFrames: options.allFrames,
js: options.js,
css: options.css,
@@ -107,11 +154,13 @@ function registerFirefoxContentScript(options: Registration) {
/**
* Only works on Firefox.
* Firefox requires that this is handled by the background script
*
*
*/
function unregisterFirefoxContentScript(id: string) {
contentScriptRegistrations[id].unregister();
delete contentScriptRegistrations[id];
if (contentScriptRegistrations[id]) {
contentScriptRegistrations[id].unregister();
delete contentScriptRegistrations[id];
}
}
async function submitVote(type: number, UUID: string, category: string) {
@@ -119,7 +168,7 @@ async function submitVote(type: number, UUID: string, category: string) {
if (userID == undefined || userID === "undefined") {
//generate one
userID = utils.generateUserID();
userID = generateUserID();
Config.config.userID = userID;
}
@@ -150,35 +199,9 @@ async function submitVote(type: number, UUID: string, category: string) {
}
}
async function asyncRequestToServer(type: string, address: string, data = {}) {
const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
return await (sendRequestToCustomServer(type, serverAddress + address, data));
}
/**
* Sends a request to the specified url
*
* @param type The request type "GET", "POST", etc.
* @param address The address to add to the SponsorBlock server address
* @param callback
*/
async function sendRequestToCustomServer(type: string, url: string, data = {}) {
// If GET, convert JSON to parameters
if (type.toLowerCase() === "get") {
url = utils.objectToURI(url, data, true);
data = null;
}
const response = await fetch(url, {
method: type,
headers: {
'Content-Type': 'application/json'
},
redirect: 'follow',
body: data ? JSON.stringify(data) : null
});
return response;
return await (sendRealRequestToCustomServer(type, serverAddress + address, data));
}

View File

@@ -7,8 +7,8 @@ import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { VoteResponse } from "../messageTypes";
import { AnimationUtils } from "../utils/animationUtils";
import { GenericUtils } from "../utils/genericUtils";
import { Tooltip } from "../render/Tooltip";
import { getErrorMessage } from "@ajayyy/maze-utils/lib/formating";
export interface CategoryPillProps {
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
@@ -43,14 +43,14 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
return (
<span style={style}
className={"sponsorBlockCategoryPill"}
className={"sponsorBlockCategoryPill"}
aria-label={this.getTitleText()}
onClick={(e) => this.toggleOpen(e)}
onMouseEnter={() => this.openTooltip()}
onMouseLeave={() => this.closeTooltip()}>
<span className="sponsorBlockCategoryPillTitleSection">
<img className="sponsorSkipLogo sponsorSkipObject"
src={chrome.runtime.getURL("icons/IconSponsorBlocker256px.png")}>
src={chrome.extension.getURL("icons/IconSponsorBlocker256px.png")}>
</img>
<span className="sponsorBlockCategoryPillTitle">
{chrome.i18n.getMessage("category_" + this.state.segment?.category)}
@@ -79,7 +79,7 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
)}
{/* Close Button */}
<img src={chrome.runtime.getURL("icons/close.png")}
<img src={chrome.extension.getURL("icons/close.png")}
className="categoryPillClose"
onClick={() => this.setState({ show: false })}>
</img>
@@ -104,52 +104,40 @@ class CategoryPillComponent extends React.Component<CategoryPillProps, CategoryP
await stopAnimation();
if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) {
this.setState({
open: false,
this.setState({
open: false,
show: type === 1
});
} else if (response.statusCode !== 403) {
alert(GenericUtils.getErrorMessage(response.statusCode, response.responseText));
alert(getErrorMessage(response.statusCode, response.responseText));
}
}
}
private getColor(): string {
const configObject = Config.config.barTypes["preview-" + this.state.segment?.category]
|| Config.config.barTypes[this.state.segment?.category];
return configObject?.color;
// Handled by setCategoryColorCSSVariables() of content.ts
const category = this.state.segment?.category;
return category == null ? null : `var(--sb-category-preview-${category}, var(--sb-category-${category}))`;
}
private getTextColor(): string {
const color = this.getColor();
if (!color) return null;
const existingCalculatedColor = Config.config.categoryPillColors[this.state.segment?.category];
if (existingCalculatedColor && existingCalculatedColor.lastColor === color) {
return existingCalculatedColor.textColor;
} else {
const luminance = GenericUtils.getLuminance(color);
const textColor = luminance > 128 ? "black" : "white";
Config.config.categoryPillColors[this.state.segment?.category] = {
lastColor: color,
textColor
};
return textColor;
}
// Handled by setCategoryColorCSSVariables() of content.ts
const category = this.state.segment?.category;
return category == null ? null : `var(--sb-category-text-preview-${category}, var(--sb-category-text-${category}))`;
}
private openTooltip(): void {
const tooltipMount = document.querySelector("ytd-video-primary-info-renderer > #container") as HTMLElement;
const tooltipMount = document.querySelector("#above-the-fold") as HTMLElement;
if (tooltipMount) {
this.tooltip = new Tooltip({
text: this.getTitleText(),
referenceNode: tooltipMount,
bottomOffset: "70px",
bottomOffset: "0px",
opacity: 0.95,
displayTriangle: false,
showLogo: false,
showGotIt: false
showGotIt: false,
prependElement: tooltipMount.firstElementChild as HTMLElement
});
}
}

View File

@@ -0,0 +1,133 @@
import * as React from "react";
import Config from "../config";
import { ActionType, Category, SegmentUUID, SponsorTime } from "../types";
import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { VoteResponse } from "../messageTypes";
import { AnimationUtils } from "../utils/animationUtils";
import { Tooltip } from "../render/Tooltip";
import { getErrorMessage } from "@ajayyy/maze-utils/lib/formating";
export interface ChapterVoteProps {
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
size?: string;
}
export interface ChapterVoteState {
segment?: SponsorTime;
show: boolean;
size?: string;
}
class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVoteState> {
tooltip?: Tooltip;
constructor(props: ChapterVoteProps) {
super(props);
this.state = {
segment: null,
show: false,
size: props.size ?? "22px"
};
}
render(): React.ReactElement {
if (this.tooltip && !this.state.show) {
this.tooltip.close();
this.tooltip = null;
}
return (
<>
{/* Upvote Button */}
<button id={"sponsorTimesDownvoteButtonsContainerUpvoteChapter"}
className={"playerButton sbPlayerUpvote ytp-button " + (!this.state.show ? "hidden" : "")}
draggable="false"
title={chrome.i18n.getMessage("upvoteButtonInfo")}
onClick={(e) => this.vote(e, 1)}>
<ThumbsUpSvg className="playerButtonImage"
fill={Config.config.colorPalette.white}
width={this.state.size} height={this.state.size} />
</button>
{/* Downvote Button */}
<button id={"sponsorTimesDownvoteButtonsContainerDownvoteChapter"}
className={"playerButton sbPlayerDownvote ytp-button " + (!this.state.show ? "hidden" : "")}
draggable="false"
title={chrome.i18n.getMessage("reportButtonInfo")}
onClick={(e) => {
const chapterNode = document.querySelector(".ytp-chapter-container") as HTMLElement;
if (this.tooltip) {
this.tooltip.close();
this.tooltip = null;
} else {
if (this.state.segment?.actionType === ActionType.Chapter) {
const referenceNode = chapterNode?.parentElement?.parentElement;
if (referenceNode) {
const outerBounding = referenceNode.getBoundingClientRect();
const buttonBounding = (e.target as HTMLElement)?.parentElement?.getBoundingClientRect();
this.tooltip = new Tooltip({
referenceNode: chapterNode?.parentElement?.parentElement,
prependElement: chapterNode?.parentElement,
showLogo: false,
showGotIt: false,
bottomOffset: `${outerBounding.height + 25}px`,
leftOffset: `${buttonBounding.x - outerBounding.x}px`,
extraClass: "centeredSBTriangle",
buttons: [
{
name: chrome.i18n.getMessage("incorrectVote"),
listener: (event) => this.vote(event, 0, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}, {
name: chrome.i18n.getMessage("harmfulVote"),
listener: (event) => this.vote(event, 30, e.target as HTMLElement).then(() => {
this.tooltip?.close();
this.tooltip = null;
})
}
]
});
}
} else {
this.vote(e, 0, e.target as HTMLElement)
}
}
}}>
<ThumbsDownSvg
className="playerButtonImage"
fill={downvoteButtonColor(this.state.segment ? [this.state.segment] : null, SkipNoticeAction.Downvote, SkipNoticeAction.Downvote)}
width={this.state.size}
height={this.state.size} />
</button>
</>
);
}
private async vote(event: React.MouseEvent, type: number, element?: HTMLElement): Promise<void> {
event.stopPropagation();
if (this.state.segment) {
const stopAnimation = AnimationUtils.applyLoadingAnimation(element ?? event.currentTarget as HTMLElement, 0.3);
const response = await this.props.vote(type, this.state.segment.UUID);
await stopAnimation();
if (response.successType == 1 || (response.successType == -1 && response.statusCode == 429)) {
this.setState({
show: type === 1
});
} else if (response.statusCode !== 403) {
alert(getErrorMessage(response.statusCode, response.responseText));
}
}
}
}
export default ChapterVoteComponent;

View File

@@ -8,39 +8,42 @@ enum CountdownMode {
}
export interface NoticeProps {
noticeTitle: string,
noticeTitle: string;
maxCountdownTime?: () => number,
amountOfPreviousNotices?: number,
showInSecondSlot?: boolean,
timed?: boolean,
idSuffix?: string,
maxCountdownTime?: () => number;
dontPauseCountdown?: boolean;
amountOfPreviousNotices?: number;
showInSecondSlot?: boolean;
timed?: boolean;
idSuffix?: string;
fadeIn?: boolean,
startFaded?: boolean,
firstColumn?: React.ReactElement,
firstRow?: React.ReactElement,
bottomRow?: React.ReactElement[],
fadeIn?: boolean;
startFaded?: boolean;
firstColumn?: React.ReactElement[] | React.ReactElement;
firstRow?: React.ReactElement;
bottomRow?: React.ReactElement[];
smaller?: boolean,
limitWidth?: boolean,
smaller?: boolean;
limitWidth?: boolean;
extraClass?: string;
hideLogo?: boolean;
hideRightInfo?: boolean;
// Callback for when this is closed
closeListener: () => void,
onMouseEnter?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void,
closeListener: () => void;
onMouseEnter?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
zIndex?: number,
style?: React.CSSProperties
zIndex?: number;
style?: React.CSSProperties;
biggerCloseButton?: boolean;
children?: React.ReactNode;
}
export interface NoticeState {
noticeTitle: string,
maxCountdownTime: () => number;
maxCountdownTime: () => number,
countdownTime: number,
countdownMode: CountdownMode,
countdownTime: number;
countdownMode: CountdownMode;
mouseHovering: boolean;
@@ -54,9 +57,13 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
amountOfPreviousNotices: number;
parentRef: React.RefObject<HTMLDivElement>;
constructor(props: NoticeProps) {
super(props);
this.parentRef = React.createRef();
const maxCountdownTime = () => {
if (this.props.maxCountdownTime) return this.props.maxCountdownTime();
else return Config.config.skipNoticeDuration;
@@ -71,8 +78,6 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
// Setup state
this.state = {
noticeTitle: props.noticeTitle,
maxCountdownTime,
//the countdown until this notice closes
@@ -97,9 +102,11 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
return (
<div id={"sponsorSkipNotice" + this.idSuffix}
className={"sponsorSkipObject sponsorSkipNoticeParent"
+ (this.props.showInSecondSlot ? " secondSkipNotice" : "")}
+ (this.props.showInSecondSlot ? " secondSkipNotice" : "")
+ (this.props.extraClass ? ` ${this.props.extraClass}` : "")}
onMouseEnter={(e) => this.onMouseEnter(e) }
onMouseLeave={() => this.timerMouseLeave()}
ref={this.parentRef}
style={noticeStyle} >
<div className={"sponsorSkipNoticeTableContainer"
+ (this.props.fadeIn ? " sponsorSkipNoticeFadeIn" : "")
@@ -114,16 +121,18 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
{/* Left column */}
<td className="noticeLeftIcon">
{/* Logo */}
<img id={"sponsorSkipLogo" + this.idSuffix}
className="sponsorSkipLogo sponsorSkipObject"
src={chrome.runtime.getURL("icons/IconSponsorBlocker256px.png")}>
</img>
{!this.props.hideLogo &&
<img id={"sponsorSkipLogo" + this.idSuffix}
className="sponsorSkipLogo sponsorSkipObject"
src={chrome.extension.getURL("icons/IconSponsorBlocker256px.png")}>
</img>
}
<span id={"sponsorSkipMessage" + this.idSuffix}
style={{float: "left"}}
style={{float: "left", marginRight: this.props.hideLogo ? "0px" : null}}
className="sponsorSkipMessage sponsorSkipObject">
{this.state.noticeTitle}
{this.props.noticeTitle}
</span>
{this.props.firstColumn}
@@ -132,28 +141,30 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
{this.props.firstRow}
{/* Right column */}
<td className="sponsorSkipNoticeRightSection"
style={{top: "9.32px"}}>
{!this.props.hideRightInfo &&
<td className="sponsorSkipNoticeRightSection"
style={{top: "9.32px"}}>
{/* Time left */}
{this.props.timed ? (
<span id={"sponsorSkipNoticeTimeLeft" + this.idSuffix}
onClick={() => this.toggleManualPause()}
className="sponsorSkipObject sponsorSkipNoticeTimeLeft">
{this.getCountdownElements()}
</span>
) : ""}
{/* Time left */}
{this.props.timed ? (
<span id={"sponsorSkipNoticeTimeLeft" + this.idSuffix}
onClick={() => this.toggleManualPause()}
className="sponsorSkipObject sponsorSkipNoticeTimeLeft">
{this.getCountdownElements()}
</span>
) : ""}
{/* Close button */}
<img src={chrome.runtime.getURL("icons/close.png")}
className={"sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeCloseButton sponsorSkipNoticeRightButton"
+ (this.props.biggerCloseButton ? " biggerCloseButton" : "")}
onClick={() => this.close()}>
</img>
</td>
{/* Close button */}
<img src={chrome.extension.getURL("icons/close.png")}
className={"sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeCloseButton sponsorSkipNoticeRightButton"
+ (this.props.biggerCloseButton ? " biggerCloseButton" : "")}
onClick={() => this.close()}>
</img>
</td>
}
</tr>
{this.props.children}
@@ -184,7 +195,7 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
id={"skipNoticeTimerText" + this.idSuffix}
key="skipNoticeTimerText"
className={this.state.countdownMode !== CountdownMode.Timer ? "hidden" : ""} >
{this.state.countdownTime + "s"}
{chrome.i18n.getMessage("NoticeTimeAfterSkip").replace("{seconds}", this.state.countdownTime.toString())}
</span>
),(
<img
@@ -286,7 +297,7 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
}
pauseCountdown(): void {
if (!this.props.timed) return;
if (!this.props.timed || this.props.dontPauseCountdown) return;
//remove setInterval
if (this.countdownInterval) clearInterval(this.countdownInterval);
@@ -344,12 +355,6 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
if (!silent) this.props.closeListener();
}
changeNoticeTitle(title: string): void {
this.setState({
noticeTitle: title
});
}
addNoticeInfoMessage(message: string, message2 = ""): void {
//TODO: Replace
@@ -384,6 +389,10 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
document.querySelector("#sponsorSkipNotice" + this.idSuffix + " > tbody").insertBefore(thanksForVotingText2, document.getElementById("sponsorSkipNoticeSpacer" + this.idSuffix));
}
}
getElement(): React.RefObject<HTMLDivElement> {
return this.parentRef;
}
}
export default NoticeComponent;

View File

@@ -1,9 +1,11 @@
import * as React from "react";
export interface NoticeTextSelectionProps {
text: string,
idSuffix: string,
onClick?: (event: React.MouseEvent) => unknown
icon?: string;
text: string;
idSuffix: string;
onClick?: (event: React.MouseEvent) => unknown;
children?: React.ReactNode;
}
export interface NoticeTextSelectionState {
@@ -24,14 +26,42 @@ class NoticeTextSelectionComponent extends React.Component<NoticeTextSelectionPr
}
return (
<p id={"sponsorTimesInfoMessage" + this.props.idSuffix}
<tr id={"sponsorTimesInfoMessage" + this.props.idSuffix}
onClick={this.props.onClick}
style={style}
className="sponsorTimesInfoMessage">
{this.props.text}
</p>
<td>
{this.props.icon ?
<img src={chrome.runtime.getURL(this.props.icon)} className="sponsorTimesInfoIcon" />
: null}
<span>
{this.getTextElements(this.props.text)}
</span>
</td>
</tr>
);
}
private getTextElements(text: string): Array<string | React.ReactElement> {
const elements: Array<string | React.ReactElement> = [];
const textParts = text.split(/(?=\s+)/);
for (const textPart of textParts) {
if (textPart.match(/^\s*http/)) {
elements.push(
<a href={textPart} target="_blank" rel="noreferrer">
{textPart}
</a>
);
} else {
elements.push(textPart);
}
}
return elements;
}
}
export default NoticeTextSelectionComponent;

View File

@@ -0,0 +1,63 @@
import * as React from "react";
export interface SelectorOption {
label: string;
}
export interface SelectorProps {
id: string;
options: SelectorOption[];
onChange: (value: string) => void;
onMouseEnter?: () => void;
onMouseLeave?: () => void;
}
export interface SelectorState {
}
class SelectorComponent extends React.Component<SelectorProps, SelectorState> {
constructor(props: SelectorProps) {
super(props);
// Setup state
this.state = {
}
}
render(): React.ReactElement {
return (
<div id={this.props.id}
style={{display: this.props.options.length > 0 ? "inherit" : "none"}}
className="sbSelector">
<div onMouseEnter={this.props.onMouseEnter}
onMouseLeave={this.props.onMouseLeave}
className="sbSelectorBackground">
{this.getOptions()}
</div>
</div>
);
}
getOptions(): React.ReactElement[] {
const result: React.ReactElement[] = [];
for (const option of this.props.options) {
result.push(
<div className="sbSelectorOption"
onClick={(e) => {
e.stopPropagation();
this.props.onChange(option.label);
}}
key={option.label}>
{option.label}
</div>
);
}
return result;
}
}
export default SelectorComponent;

View File

@@ -1,23 +1,31 @@
import * as React from "react";
import * as CompileConfig from "../../config.json";
import Config from "../config"
import { Category, ContentContainer, SponsorHideType, SponsorTime, NoticeVisbilityMode, ActionType, SponsorSourceType, SegmentUUID } from "../types";
import { Category, ContentContainer, SponsorTime, NoticeVisbilityMode, ActionType, SponsorSourceType, SegmentUUID } from "../types";
import NoticeComponent from "./NoticeComponent";
import NoticeTextSelectionComponent from "./NoticeTextSectionComponent";
import Utils from "../utils";
const utils = new Utils();
import { getSkippingText } from "../utils/categoryUtils";
import { keybindToString } from "../utils/configUtils";
import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
import PencilSvg from "../svg-icons/pencil_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { generateUserID } from "@ajayyy/maze-utils/lib/setup";
import { keybindToString } from "@ajayyy/maze-utils/lib/config";
enum SkipButtonState {
Undo, // Unskip
Redo, // Reskip
Start // Skip
}
export interface SkipNoticeProps {
segments: SponsorTime[];
autoSkip: boolean;
startReskip?: boolean;
// Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer;
@@ -38,9 +46,9 @@ export interface SkipNoticeState {
maxCountdownTime?: () => number;
countdownText?: string;
skipButtonText?: string;
skipButtonCallback?: (index: number) => void;
showSkipButton?: boolean;
skipButtonStates?: SkipButtonState[];
skipButtonCallbacks?: Array<(buttonIndex: number, index: number, forceSeek: boolean) => void>;
showSkipButton?: boolean[];
editing?: boolean;
choosingCategory?: boolean;
@@ -65,7 +73,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
amountOfPreviousNotices: number;
showInSecondSlot: boolean;
idSuffix: string;
noticeRef: React.MutableRefObject<NoticeComponent>;
@@ -98,7 +106,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
if (this.segments.length > 1) {
this.segments.sort((a, b) => a.segment[0] - b.segment[0]);
}
// This is the suffix added at the end of every id
for (const segment of this.segments) {
this.idSuffix += segment.UUID;
@@ -109,6 +117,15 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
this.unselectedColor = Config.config.colorPalette.white;
this.lockedColor = Config.config.colorPalette.locked;
const isMuteSegment = this.segments[0].actionType === ActionType.Mute;
const maxCountdownTime = isMuteSegment ? this.getFullDurationCountdown(0) : () => Config.config.skipNoticeDuration;
const defaultSkipButtonState = this.props.startReskip ? SkipButtonState.Redo : SkipButtonState.Undo;
const skipButtonStates = [defaultSkipButtonState, isMuteSegment ? SkipButtonState.Start : defaultSkipButtonState];
const defaultSkipButtonCallback = this.props.startReskip ? this.reskip.bind(this) : this.unskip.bind(this);
const skipButtonCallbacks = [defaultSkipButtonCallback, isMuteSegment ? this.reskip.bind(this) : defaultSkipButtonCallback];
// Setup state
this.state = {
noticeTitle,
@@ -116,13 +133,13 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
messageOnClick: null,
//the countdown until this notice closes
maxCountdownTime: () => Config.config.skipNoticeDuration,
countdownTime: Config.config.skipNoticeDuration,
maxCountdownTime,
countdownTime: maxCountdownTime(),
countdownText: null,
skipButtonText: this.getUnskipText(),
skipButtonCallback: (index) => this.unskip(index),
showSkipButton: true,
skipButtonStates,
skipButtonCallbacks,
showSkipButton: [true, true],
editing: false,
choosingCategory: false,
@@ -141,7 +158,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
if (!this.autoSkip) {
// Assume manual skip is only skipping 1 submission
Object.assign(this.state, this.getUnskippedModeInfo(0, this.getSkipText()));
Object.assign(this.state, this.getUnskippedModeInfo(null, 0, SkipButtonState.Start));
}
}
@@ -152,13 +169,20 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
noticeStyle.transform = "scale(0.8) translate(10%, 10%)";
}
// If it started out as smaller, always keep the
// skip button there
const showFirstSkipButton = this.props.smaller || this.segments[0].actionType === ActionType.Mute;
const firstColumn = showFirstSkipButton ? (
this.getSkipButton(0)
) : null;
return (
<NoticeComponent noticeTitle={this.state.noticeTitle}
amountOfPreviousNotices={this.amountOfPreviousNotices}
showInSecondSlot={this.showInSecondSlot}
idSuffix={this.idSuffix}
fadeIn={true}
startFaded={Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAll
startFaded={Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAll
|| (Config.config.noticeVisibilityMode >= NoticeVisbilityMode.FadedForAutoSkip && this.autoSkip)}
timed={true}
maxCountdownTime={this.state.maxCountdownTime}
@@ -168,7 +192,8 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
closeListener={() => this.closeListener()}
smaller={this.state.smaller}
limitWidth={true}
bottomRow={[...this.getMessageBoxes()]}
firstColumn={firstColumn}
bottomRow={[...this.getMessageBoxes(), ...this.getBottomRow() ]}
onMouseEnter={() => this.onMouseEnter() } >
</NoticeComponent>
);
@@ -181,7 +206,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
key={0}>
{/* Vote Button Container */}
{!this.state.thanksForVotingText ?
{!this.state.thanksForVotingText ?
<td id={"sponsorTimesVoteButtonsContainer" + this.idSuffix}
className="sponsorTimesVoteButtonsContainer">
@@ -240,10 +265,11 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
}
{/* Unskip/Skip Button */}
{!this.props.smaller ? this.getSkipButton() : null}
{!this.props.smaller || this.segments[0].actionType === ActionType.Mute
? this.getSkipButton(1) : null}
{/* Never show button if autoSkip is enabled */}
{!this.autoSkip ? "" :
{/* Never show button */}
{!this.autoSkip || this.props.startReskip ? "" :
<td className="sponsorSkipNoticeRightSection"
key={1}>
<button className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeRightButton"
@@ -317,14 +343,17 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
];
}
getSkipButton(): JSX.Element {
if (this.state.showSkipButton && (this.segments.length > 1
getSkipButton(buttonIndex: number): JSX.Element {
if (this.state.showSkipButton[buttonIndex] && (this.segments.length > 1
|| this.segments[0].actionType !== ActionType.Poi
|| this.props.unskipTime)) {
const forceSeek = buttonIndex === 1 && this.segments[0].actionType === ActionType.Mute;
const style: React.CSSProperties = {
marginLeft: "4px",
color: (this.state.actionState === SkipNoticeAction.Unskip) ? this.selectedColor : this.unselectedColor
color: ([SkipNoticeAction.Unskip0, SkipNoticeAction.Unskip1].includes(this.state.actionState))
? this.selectedColor : this.unselectedColor
};
if (this.contentContainer().onMobileYouTube) {
style.padding = "20px";
@@ -336,12 +365,15 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
<button id={"sponsorSkipUnskipButton" + this.idSuffix}
className="sponsorSkipObject sponsorSkipNoticeButton"
style={style}
onClick={() => this.prepAction(SkipNoticeAction.Unskip)}>
{this.state.skipButtonText + (this.state.showKeybindHint ? " (" + keybindToString(Config.config.skipKeybind) + ")" : "")}
onClick={() => this.prepAction(buttonIndex === 1 ? SkipNoticeAction.Unskip1 : SkipNoticeAction.Unskip0)}>
{this.getSkipButtonText(buttonIndex, forceSeek ? ActionType.Skip : null)
+ (!forceSeek && this.state.showKeybindHint
? " (" + keybindToString(Config.config.skipKeybind) + ")" : "")}
</button>
</span>
);
}
return null;
}
getSubmissionChooser(): JSX.Element[] {
@@ -349,7 +381,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
for (let i = 0; i < this.segments.length; i++) {
elements.push(
<button className="sponsorSkipObject sponsorSkipNoticeButton"
style={{opacity: this.getSubmissionChooserOpacity(i),
style={{opacity: this.getSubmissionChooserOpacity(i),
color: this.getSubmissionChooserColor(i)}}
onClick={() => this.performAction(i)}
key={"submission" + i + this.segments[i].category + this.idSuffix}>
@@ -374,18 +406,18 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
getSubmissionChooserColor(index: number): string {
const isDownvote = this.state.actionState == SkipNoticeAction.Downvote;
const isCopyDownvote = this.state.actionState == SkipNoticeAction.CopyDownvote;
const shouldWarnUser = Config.config.isVip && (isDownvote || isCopyDownvote)
const shouldWarnUser = Config.config.isVip && (isDownvote || isCopyDownvote)
&& this.segments[index].locked === 1;
return shouldWarnUser ? this.lockedColor : this.unselectedColor;
}
onMouseEnter(): void {
// if (this.state.smaller) {
// this.setState({
// smaller: false
// });
// }
if (this.state.smaller) {
this.setState({
smaller: false
});
}
}
getMessageBoxes(): JSX.Element[] {
@@ -438,8 +470,11 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
case SkipNoticeAction.CopyDownvote:
this.resetStateToStart(SkipNoticeAction.CopyDownvote, true);
break;
case SkipNoticeAction.Unskip:
this.resetStateToStart(SkipNoticeAction.Unskip);
case SkipNoticeAction.Unskip0:
this.resetStateToStart(SkipNoticeAction.Unskip0);
break;
case SkipNoticeAction.Unskip1:
this.resetStateToStart(SkipNoticeAction.Unskip1);
break;
}
}
@@ -447,8 +482,8 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
/**
* Performs the action from the current state
*
* @param index
*
* @param index
*/
performAction(index: number, action?: SkipNoticeAction): void {
switch (action ?? this.state.actionState) {
@@ -467,8 +502,11 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
case SkipNoticeAction.CopyDownvote:
this.copyDownvote(index);
break;
case SkipNoticeAction.Unskip:
this.unskipAction(index);
case SkipNoticeAction.Unskip0:
this.unskipAction(0, index, false);
break;
case SkipNoticeAction.Unskip1:
this.unskipAction(1, index, true);
break;
default:
this.resetStateToStart();
@@ -504,7 +542,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
const sponsorVideoID = this.props.contentContainer().sponsorVideoID;
const sponsorTimesSubmitting : SponsorTime = {
segment: this.segments[index].segment,
UUID: utils.generateUserID() as SegmentUUID,
UUID: generateUserID() as SegmentUUID,
category: this.segments[index].category,
actionType: this.segments[index].actionType,
source: SponsorSourceType.Local
@@ -530,8 +568,8 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
});
}
unskipAction(index: number): void {
this.state.skipButtonCallback(index);
unskipAction(buttonIndex: number, index: number, forceSeek: boolean): void {
this.state.skipButtonCallbacks[buttonIndex](buttonIndex, index, forceSeek);
}
openEditingOptions(): void {
@@ -558,28 +596,29 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
return this.props.contentContainer().lockedCategories.includes(category) ? "sponsorBlockLockedColor" : ""
}
unskip(index: number): void {
this.contentContainer().unskipSponsorTime(this.segments[index], this.props.unskipTime);
unskip(buttonIndex: number, index: number, forceSeek: boolean): void {
this.contentContainer().unskipSponsorTime(this.segments[index], this.props.unskipTime, forceSeek);
this.unskippedMode(index, this.getReskipText());
this.unskippedMode(buttonIndex, index, SkipButtonState.Redo);
}
reskip(index: number): void {
this.contentContainer().reskipSponsorTime(this.segments[index]);
reskip(buttonIndex: number, index: number, forceSeek: boolean): void {
this.contentContainer().reskipSponsorTime(this.segments[index], forceSeek);
const skipButtonStates = this.state.skipButtonStates;
skipButtonStates[buttonIndex] = SkipButtonState.Undo;
const skipButtonCallbacks = this.state.skipButtonCallbacks;
skipButtonCallbacks[buttonIndex] = this.unskip.bind(this);
const newState: SkipNoticeState = {
skipButtonText: this.getUnskipText(),
skipButtonCallback: this.unskip.bind(this),
skipButtonStates,
skipButtonCallbacks,
maxCountdownTime: () => Config.config.skipNoticeDuration,
countdownTime: Config.config.skipNoticeDuration
};
// See if the title should be changed
if (!this.autoSkip) {
newState.noticeTitle = chrome.i18n.getMessage("noticeTitle");
}
//reset countdown
this.setState(newState, () => {
this.noticeRef.current.resetCountdown();
@@ -587,30 +626,54 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
}
/** Sets up notice to be not skipped yet */
unskippedMode(index: number, buttonText: string): void {
unskippedMode(buttonIndex: number, index: number, skipButtonState: SkipButtonState): void {
//setup new callback and reset countdown
this.setState(this.getUnskippedModeInfo(index, buttonText), () => {
this.setState(this.getUnskippedModeInfo(buttonIndex, index, skipButtonState), () => {
this.noticeRef.current.resetCountdown();
});
}
getUnskippedModeInfo(index: number, buttonText: string): SkipNoticeState {
getUnskippedModeInfo(buttonIndex: number, index: number, skipButtonState: SkipButtonState): SkipNoticeState {
const changeCountdown = this.segments[index].actionType !== ActionType.Poi;
const maxCountdownTime = changeCountdown ? () => {
const maxCountdownTime = changeCountdown ?
this.getFullDurationCountdown(index) : this.state.maxCountdownTime;
const skipButtonStates = this.state.skipButtonStates;
const skipButtonCallbacks = this.state.skipButtonCallbacks;
if (buttonIndex === null) {
for (let i = 0; i < this.segments.length; i++) {
skipButtonStates[i] = skipButtonState;
skipButtonCallbacks[i] = this.reskip.bind(this);
}
} else {
skipButtonStates[buttonIndex] = skipButtonState;
skipButtonCallbacks[buttonIndex] = this.reskip.bind(this);
if (buttonIndex === 1) {
// Trigger both to move at once
skipButtonStates[0] = SkipButtonState.Redo;
skipButtonCallbacks[0] = this.reskip.bind(this);
}
}
return {
skipButtonStates,
skipButtonCallbacks,
// change max duration to however much of the sponsor is left
maxCountdownTime,
countdownTime: maxCountdownTime(),
showSkipButton: buttonIndex === 1 ? [true, true] : this.state.showSkipButton
} as SkipNoticeState;
}
getFullDurationCountdown(index: number): () => number {
return () => {
const sponsorTime = this.segments[index];
const duration = Math.round((sponsorTime.segment[1] - this.contentContainer().v.currentTime) * (1 / this.contentContainer().v.playbackRate));
return Math.max(duration, Config.config.skipNoticeDuration);
} : this.state.maxCountdownTime;
return {
skipButtonText: buttonText,
skipButtonCallback: (index) => this.reskip(index),
// change max duration to however much of the sponsor is left
maxCountdownTime: maxCountdownTime,
countdownTime: maxCountdownTime()
} as SkipNoticeState;
};
}
afterVote(segment: SponsorTime, type: number, category: Category): void {
@@ -657,7 +720,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
messages
});
}
addVoteButtonInfo(message: string): void {
this.setState({
thanksForVotingText: message
@@ -683,12 +746,12 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
}
}
unmutedListener(): void {
if (this.props.segments.length === 1
&& this.props.segments[0].actionType === ActionType.Mute
&& this.contentContainer().v.currentTime >= this.props.segments[0].segment[1]) {
unmutedListener(time: number): void {
if (this.props.segments.length === 1
&& this.props.segments[0].actionType === ActionType.Mute
&& time >= this.props.segments[0].segment[1]) {
this.setState({
showSkipButton: false
showSkipButton: [false, true]
});
}
}
@@ -703,36 +766,50 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
});
}
private getUnskipText(): string {
switch (this.props.segments[0].actionType) {
private getSkipButtonText(buttonIndex: number, forceType?: ActionType): string {
switch (this.state.skipButtonStates[buttonIndex]) {
case SkipButtonState.Undo:
return this.getUndoText(forceType);
case SkipButtonState.Redo:
return this.getRedoText(forceType);
case SkipButtonState.Start:
return this.getStartText(forceType);
}
}
private getUndoText(forceType?: ActionType): string {
const actionType = forceType || this.segments[0].actionType;
switch (actionType) {
case ActionType.Mute: {
return chrome.i18n.getMessage("unmute");
}
case ActionType.Skip:
case ActionType.Skip:
default: {
return chrome.i18n.getMessage("unskip");
}
}
}
private getReskipText(): string {
switch (this.props.segments[0].actionType) {
private getRedoText(forceType?: ActionType): string {
const actionType = forceType || this.segments[0].actionType;
switch (actionType) {
case ActionType.Mute: {
return chrome.i18n.getMessage("mute");
}
case ActionType.Skip:
case ActionType.Skip:
default: {
return chrome.i18n.getMessage("reskip");
}
}
}
private getSkipText(): string {
switch (this.props.segments[0].actionType) {
private getStartText(forceType?: ActionType): string {
const actionType = forceType || this.segments[0].actionType;
switch (actionType) {
case ActionType.Mute: {
return chrome.i18n.getMessage("mute");
}
case ActionType.Skip:
case ActionType.Skip:
default: {
return chrome.i18n.getMessage("skip");
}

View File

@@ -1,32 +1,41 @@
import * as React from "react";
import * as CompileConfig from "../../config.json";
import Config from "../config";
import { ActionType, Category, ContentContainer, SponsorTime } from "../types";
import { ActionType, Category, ChannelIDStatus, ContentContainer, SponsorTime } from "../types";
import Utils from "../utils";
import SubmissionNoticeComponent from "./SubmissionNoticeComponent";
import { RectangleTooltip } from "../render/RectangleTooltip";
import SelectorComponent, { SelectorOption } from "./SelectorComponent";
import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
import { getFormattedTime, getFormattedTimeToSeconds } from "@ajayyy/maze-utils/lib/formating";
const utils = new Utils();
export interface SponsorTimeEditProps {
index: number,
index: number;
idSuffix: string,
idSuffix: string;
// Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer,
contentContainer: ContentContainer;
submissionNotice: SubmissionNoticeComponent;
categoryList?: Category[];
categoryChangeListener?: (index: number, category: Category) => void;
children?: React.ReactNode;
}
export interface SponsorTimeEditState {
editing: boolean;
sponsorTimeEdits: [string, string];
selectedCategory: Category;
description: string;
suggestedNames: SelectorOption[];
chapterNameSelectorOpen: boolean;
chapterNameSelectorHovering: boolean;
}
const DEFAULT_CATEGORY = "chooseACategory";
const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter")
.map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/)));
class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, SponsorTimeEditState> {
@@ -34,6 +43,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
categoryOptionRef: React.RefObject<HTMLSelectElement>;
actionTypeOptionRef: React.RefObject<HTMLSelectElement>;
descriptionOptionRef: React.RefObject<HTMLInputElement>;
configUpdateListener: () => void;
@@ -41,26 +51,36 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
// Used when selecting POI or Full
timesBeforeChanging: number[] = [];
fullVideoWarningShown = false;
categoryNameWarningShown = false;
// For description auto-complete
fetchingSuggestions: boolean;
constructor(props: SponsorTimeEditProps) {
super(props);
this.categoryOptionRef = React.createRef();
this.actionTypeOptionRef = React.createRef();
this.descriptionOptionRef = React.createRef();
this.idSuffix = this.props.idSuffix;
this.previousSkipType = ActionType.Skip;
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
this.state = {
editing: false,
sponsorTimeEdits: [null, null],
selectedCategory: DEFAULT_CATEGORY as Category
selectedCategory: DEFAULT_CATEGORY as Category,
description: sponsorTime.description || "",
suggestedNames: [],
chapterNameSelectorOpen: false,
chapterNameSelectorHovering: false
};
}
componentDidMount(): void {
// Prevent inputs from triggering key events
document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('keydown', function (event) {
document.getElementById("sponsorTimeEditContainer" + this.idSuffix).addEventListener('keydown', function (event) {
event.stopPropagation();
});
@@ -86,6 +106,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
render(): React.ReactElement {
this.checkToShowFullVideoWarning();
this.checkToShowChapterWarning();
const style: React.CSSProperties = {
textAlign: "center"
@@ -95,14 +116,6 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
style.marginTop = "15px";
}
// This method is required to get !important
// https://stackoverflow.com/a/45669262/1985387
const oldYouTubeDarkStyles = (node) => {
if (node) {
node.style.setProperty("color", "black", "important");
node.style.setProperty("text-shadow", "none", "important");
}
};
// Create time display
let timeDisplay: JSX.Element;
const timeDisplayStyle: React.CSSProperties = {};
@@ -122,11 +135,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
</span>
<input id={"submittingTime0" + this.idSuffix}
className="sponsorTimeEdit sponsorTimeEditInput"
ref={oldYouTubeDarkStyles}
type="text"
style={{color: "inherit", backgroundColor: "inherit"}}
value={this.state.sponsorTimeEdits[0]}
onChange={(e) => {this.handleOnChange(0, e, sponsorTime, e.target.value)}}
onWheel={(e) => {this.changeTimesWhenScrolling(0, e, sponsorTime)}}>
onChange={(e) => this.handleOnChange(0, e, sponsorTime, e.target.value)}
onWheel={(e) => this.changeTimesWhenScrolling(0, e, sponsorTime)}>
</input>
{sponsorTime.actionType !== ActionType.Poi ? (
@@ -137,11 +150,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
<input id={"submittingTime1" + this.idSuffix}
className="sponsorTimeEdit sponsorTimeEditInput"
ref={oldYouTubeDarkStyles}
type="text"
style={{color: "inherit", backgroundColor: "inherit"}}
value={this.state.sponsorTimeEdits[1]}
onChange={(e) => {this.handleOnChange(1, e, sponsorTime, e.target.value)}}
onWheel={(e) => {this.changeTimesWhenScrolling(1, e, sponsorTime)}}>
onChange={(e) => this.handleOnChange(1, e, sponsorTime, e.target.value)}
onWheel={(e) => this.changeTimesWhenScrolling(1, e, sponsorTime)}>
</input>
<span id={"nowButton1" + this.idSuffix}
@@ -166,15 +179,15 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
style={timeDisplayStyle}
className="sponsorTimeDisplay"
onClick={this.toggleEditTime.bind(this)}>
{utils.getFormattedTime(segment[0], true) +
{getFormattedTime(segment[0], true) +
((!isNaN(segment[1]) && sponsorTime.actionType !== ActionType.Poi)
? " " + chrome.i18n.getMessage("to") + " " + utils.getFormattedTime(segment[1], true) : "")}
? " " + chrome.i18n.getMessage("to") + " " + getFormattedTime(segment[1], true) : "")}
</div>
);
}
return (
<div style={style}>
<div id={"sponsorTimeEditContainer" + this.idSuffix} style={style}>
{timeDisplay}
@@ -184,7 +197,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
className="sponsorTimeEditSelector sponsorTimeCategories"
defaultValue={sponsorTime.category}
ref={this.categoryOptionRef}
onChange={this.categorySelectionChange.bind(this)}>
style={{color: "inherit", backgroundColor: "inherit"}}
onChange={(event) => this.categorySelectionChange(event)}>
{this.getCategoryOptions()}
</select>
@@ -194,7 +208,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
target="_blank" rel="noreferrer">
<img id={"sponsorTimeCategoriesHelpButton" + this.idSuffix}
className="helpButton"
src={chrome.runtime.getURL("icons/help.svg")}
src={chrome.extension.getURL("icons/help.svg")}
title={chrome.i18n.getMessage("categoryGuidelines")} />
</a>
</div>
@@ -207,6 +221,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
<select id={"sponsorTimeActionTypes" + this.idSuffix}
className="sponsorTimeEditSelector sponsorTimeActionTypes"
defaultValue={sponsorTime.actionType}
style={{color: "inherit", backgroundColor: "inherit"}}
ref={this.actionTypeOptionRef}
onChange={(e) => this.actionTypeSelectionChange(e)}>
{this.getActionTypeOptions(sponsorTime)}
@@ -214,6 +229,32 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
</div>
): ""}
{/* Chapter Name */}
{sponsorTime.actionType === ActionType.Chapter ? (
<div onBlur={() => this.setState({chapterNameSelectorOpen: false})}>
<input id={"chapterName" + this.idSuffix}
className="sponsorTimeEdit sponsorTimeEditInput sponsorChapterNameInput"
style={{color: "inherit", backgroundColor: "inherit"}}
ref={this.descriptionOptionRef}
type="text"
value={this.state.description}
onContextMenu={(e) => e.stopPropagation()}
onChange={(e) => this.descriptionUpdate(e.target.value)}
onFocus={() => this.setState({chapterNameSelectorOpen: true})}>
</input>
{this.state.description
&& (this.state.chapterNameSelectorOpen || this.state.chapterNameSelectorHovering) &&
<SelectorComponent
id={"chapterNameSelector" + this.idSuffix}
options={this.state.suggestedNames}
onMouseEnter={() => this.setState({chapterNameSelectorHovering: true})}
onMouseLeave={() => this.setState({chapterNameSelectorHovering: false})}
onChange={(v) => this.descriptionUpdate(v)}
/>
}
</div>
): ""}
<br/>
{/* Editing Tools */}
@@ -224,7 +265,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
{chrome.i18n.getMessage("delete")}
</span>
{(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(sponsorTime.actionType)) ? (
{(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(sponsorTime.actionType))
&& sponsorTime.actionType !== ActionType.Chapter ? (
<span id={"sponsorTimePreviewButton" + this.idSuffix}
className="sponsorTimeEditButton"
onClick={(e) => this.previewTime(e.ctrlKey, e.shiftKey)}>
@@ -240,6 +282,15 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
</span>
): ""}
{(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(sponsorTime.actionType))
&& sponsorTime.actionType === ActionType.Chapter ? (
<span id={"sponsorTimePreviewButton" + this.idSuffix}
className="sponsorTimeEditButton"
onClick={(e) => this.previewTime(e.ctrlKey, e.shiftKey)}>
{chrome.i18n.getMessage("End")}
</span>
): ""}
{(!isNaN(segment[1]) && sponsorTime.actionType != ActionType.Full) ? (
<span id={"sponsorTimeEditButton" + this.idSuffix}
className="sponsorTimeEditButton"
@@ -255,19 +306,19 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
const sponsorTimeEdits = this.state.sponsorTimeEdits;
// check if change is small engough to show tooltip
const before = utils.getFormattedTimeToSeconds(sponsorTimeEdits[index]);
const after = utils.getFormattedTimeToSeconds(targetValue);
const before = getFormattedTimeToSeconds(sponsorTimeEdits[index]);
const after = getFormattedTimeToSeconds(targetValue);
const difference = Math.abs(before - after);
if (0 < difference && difference< 0.5) this.showScrollToEditToolTip();
if (0 < difference && difference < 0.5) this.showScrollToEditToolTip();
sponsorTimeEdits[index] = targetValue;
if (index === 0 && sponsorTime.actionType === ActionType.Poi) sponsorTimeEdits[1] = targetValue;
this.setState({sponsorTimeEdits});
this.saveEditTimes();
this.setState({sponsorTimeEdits}, () => this.saveEditTimes());
}
changeTimesWhenScrolling(index: number, e: React.WheelEvent, sponsorTime: SponsorTime): void {
if (!Config.config.allowScrollingToEdit) return;
let step = 0;
// shift + ctrl = 1
// ctrl = 0.1
@@ -280,7 +331,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
const sponsorTimeEdits = this.state.sponsorTimeEdits;
let timeAsNumber = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[index]);
let timeAsNumber = getFormattedTimeToSeconds(this.state.sponsorTimeEdits[index]);
if (timeAsNumber !== null && e.deltaY != 0) {
if (e.deltaY < 0) {
timeAsNumber += step;
@@ -289,7 +340,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
} else {
timeAsNumber = 0;
}
sponsorTimeEdits[index] = utils.getFormattedTime(timeAsNumber, true);
sponsorTimeEdits[index] = getFormattedTime(timeAsNumber, true);
if (sponsorTime.actionType === ActionType.Poi) sponsorTimeEdits[1] = sponsorTimeEdits[0];
this.setState({sponsorTimeEdits});
@@ -299,26 +351,29 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
showScrollToEditToolTip(): void {
if (!Config.config.scrollToEditTimeUpdate && document.getElementById("sponsorRectangleTooltip" + "sponsorTimesContainer" + this.idSuffix) === null) {
this.showToolTip(chrome.i18n.getMessage("SponsorTimeEditScrollNewFeature"), () => { Config.config.scrollToEditTimeUpdate = true });
this.showToolTip(chrome.i18n.getMessage("SponsorTimeEditScrollNewFeature"), "scrollToEdit", () => { Config.config.scrollToEditTimeUpdate = true });
}
}
showToolTip(text: string, buttonFunction?: () => void): boolean {
showToolTip(text: string, id: string, buttonFunction?: () => void): boolean {
const element = document.getElementById("sponsorTimesContainer" + this.idSuffix);
if (element) {
new RectangleTooltip({
text,
referenceNode: element.parentElement,
prependElement: element,
timeout: 15,
bottomOffset: 0 + "px",
leftOffset: -318 + "px",
backgroundColor: "rgba(28, 28, 28, 1.0)",
htmlId: "sponsorTimesContainer" + this.idSuffix,
buttonFunction,
fontSize: "14px",
maxHeight: "200px"
});
if (element) {
const htmlId = `sponsorRectangleTooltip${id + this.idSuffix}`;
if (!document.getElementById(htmlId)) {
new RectangleTooltip({
text,
referenceNode: element.parentElement,
prependElement: element,
timeout: 15,
bottomOffset: 0 + "px",
leftOffset: -318 + "px",
backgroundColor: "rgba(28, 28, 28, 1.0)",
htmlId,
buttonFunction,
fontSize: "14px",
maxHeight: "200px"
});
}
return true;
} else {
@@ -333,12 +388,25 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
if (videoPercentage > 0.6 && !this.fullVideoWarningShown
&& (sponsorTime.category === "sponsor" || sponsorTime.category === "selfpromo" || sponsorTime.category === "chooseACategory")) {
if (this.showToolTip(chrome.i18n.getMessage("fullVideoTooltipWarning"))) {
if (this.showToolTip(chrome.i18n.getMessage("fullVideoTooltipWarning"), "fullVideoWarning")) {
this.fullVideoWarningShown = true;
}
}
}
checkToShowChapterWarning(): void {
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
if (sponsorTime.actionType === ActionType.Chapter && sponsorTime.description
&& !this.categoryNameWarningShown
&& categoryNamesGrams.some(
(category) => sponsorTime.description.toLowerCase().includes(category.toLowerCase()))) {
if (this.showToolTip(chrome.i18n.getMessage("chapterNameTooltipWarning"), "chapterWarning")) {
this.categoryNameWarningShown = true;
}
}
}
getCategoryOptions(): React.ReactElement[] {
const elements = [(
<option value={DEFAULT_CATEGORY}
@@ -348,6 +416,13 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
)];
for (const category of (this.props.categoryList ?? CompileConfig.categoryList)) {
// If permission not loaded, treat it like we have permission except chapter
const defaultBlockCategories = ["chapter"];
const permission = (Config.config.showCategoryWithoutPermission
|| Config.config.permissions[category as Category]);
if ((defaultBlockCategories.includes(category)
|| (permission !== undefined && !Config.config.showCategoryWithoutPermission)) && !permission) continue;
elements.push(
<option value={category}
key={category}
@@ -365,9 +440,10 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
categorySelectionChange(event: React.ChangeEvent<HTMLSelectElement>): void {
const chosenCategory = event.target.value as Category;
// See if show more categories was pressed
if (event.target.value !== DEFAULT_CATEGORY && !Config.config.categorySelections.some((category) => category.name === event.target.value)) {
const chosenCategory = event.target.value;
if (chosenCategory !== DEFAULT_CATEGORY && !Config.config.categorySelections.some((category) => category.name === chosenCategory)) {
event.target.value = DEFAULT_CATEGORY;
// Alert that they have to enable this category first
@@ -381,8 +457,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
this.handleReplacingLostTimes(event.target.value as Category, sponsorTime.actionType, sponsorTime);
this.handleReplacingLostTimes(chosenCategory, sponsorTime.actionType, sponsorTime);
this.saveEditTimes();
if (this.props.categoryChangeListener) {
this.props.categoryChangeListener(this.props.index, chosenCategory);
}
}
actionTypeSelectionChange(event: React.ChangeEvent<HTMLSelectElement>): void {
@@ -414,7 +494,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
this.previousSkipType = ActionType.Full;
} else if ((category === "chooseACategory" || (CompileConfig.categorySupport[category]?.includes(ActionType.Skip)
} else if ((category === "chooseACategory" || ((CompileConfig.categorySupport[category]?.includes(ActionType.Skip)
|| CompileConfig.categorySupport[category]?.includes(ActionType.Chapter))
&& ![ActionType.Poi, ActionType.Full].includes(this.getNextActionType(category, actionType))))
&& this.previousSkipType !== ActionType.Skip) {
if (this.timesBeforeChanging[0]) {
@@ -459,12 +540,17 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
if (time === null) time = sponsorTime.segment[0];
const addedTime = sponsorTime.segment.length === 1;
sponsorTime.segment[index] = time;
if (sponsorTime.actionType === ActionType.Poi) sponsorTime.segment[1] = time;
if (addedTime) {
this.props.contentContainer().updateEditButtonsOnPlayer();
}
this.setState({
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)
}, this.saveEditTimes);
}, () => this.saveEditTimes());
}
toggleEditTime(): void {
@@ -487,28 +573,39 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
/** Returns an array in the sponsorTimeEdits form (formatted time string) from a normal seconds sponsor time */
getFormattedSponsorTimesEdits(sponsorTime: SponsorTime): [string, string] {
return [utils.getFormattedTime(sponsorTime.segment[0], true),
utils.getFormattedTime(sponsorTime.segment[1], true)];
return [getFormattedTime(sponsorTime.segment[0], true),
getFormattedTime(sponsorTime.segment[1], true)];
}
saveEditTimes(): void {
const sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
const category = this.categoryOptionRef.current.value as Category
if (this.state.editing) {
const startTime = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[0]);
const endTime = utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[1]);
const startTime = getFormattedTimeToSeconds(this.state.sponsorTimeEdits[0]);
const endTime = getFormattedTimeToSeconds(this.state.sponsorTimeEdits[1]);
// Change segment time only if the format was correct
if (startTime !== null && endTime !== null) {
const addingTime = sponsorTimesSubmitting[this.props.index].segment.length === 1;
sponsorTimesSubmitting[this.props.index].segment = [startTime, endTime];
if (addingTime) {
this.props.contentContainer().updateEditButtonsOnPlayer();
}
}
} else if (this.state.sponsorTimeEdits[1] === null && category === "outro" && !sponsorTimesSubmitting[this.props.index].segment[1]) {
sponsorTimesSubmitting[this.props.index].segment[1] = this.props.contentContainer().v.duration;
this.props.contentContainer().updateEditButtonsOnPlayer();
}
const category = this.categoryOptionRef.current.value as Category
sponsorTimesSubmitting[this.props.index].category = category;
const inputActionType = this.actionTypeOptionRef?.current?.value as ActionType;
sponsorTimesSubmitting[this.props.index].actionType = this.getNextActionType(category, inputActionType);
const actionType = this.getNextActionType(category, this.actionTypeOptionRef?.current?.value as ActionType);
sponsorTimesSubmitting[this.props.index].actionType = actionType;
const description = actionType === ActionType.Chapter ? this.descriptionOptionRef?.current?.value : "";
sponsorTimesSubmitting[this.props.index].description = description;
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments");
@@ -530,14 +627,19 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
previewTime(ctrlPressed = false, shiftPressed = false): void {
const sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
const index = this.props.index;
const skipTime = sponsorTimes[index].segment[0];
let seekTime = 2;
if (ctrlPressed) seekTime = 0.5;
if (shiftPressed) seekTime = 0.25;
this.props.contentContainer().previewTime(skipTime - (seekTime * this.props.contentContainer().v.playbackRate));
const startTime = sponsorTimes[index].segment[0];
const endTime = sponsorTimes[index].segment[1];
const isChapter = sponsorTimes[index].actionType === ActionType.Chapter;
// If segment starts at 0:00, start playback at the end of the segment
const skipToEndTime = startTime === 0 || isChapter;
const skipTime = skipToEndTime ? endTime : (startTime - (seekTime * this.props.contentContainer().v.playbackRate));
this.props.contentContainer().previewTime(skipTime, !isChapter);
}
inspectTime(): void {
@@ -581,6 +683,41 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
}
}
descriptionUpdate(description: string): void {
this.setState({
description
}, () => {
this.saveEditTimes();
});
if (!this.fetchingSuggestions) {
this.fetchSuggestions(description);
}
}
async fetchSuggestions(description: string): Promise<void> {
if (this.props.contentContainer().channelIDInfo.status !== ChannelIDStatus.Found) return;
this.fetchingSuggestions = true;
const result = await utils.asyncRequestToServer("GET", "/api/chapterNames", {
description,
channelID: this.props.contentContainer().channelIDInfo.id
});
if (result.ok) {
try {
const names = JSON.parse(result.responseText) as {description: string}[];
this.setState({
suggestedNames: names.map(n => ({
label: n.description
}))
});
} catch (e) {} //eslint-disable-line no-empty
}
this.fetchingSuggestions = false;
}
configUpdate(): void {
this.forceUpdate();
}

View File

@@ -1,10 +1,14 @@
import * as React from "react";
import Config from "../config"
import { ContentContainer } from "../types";
import GenericNotice from "../render/GenericNotice";
import { Category, ContentContainer } from "../types";
import * as CompileConfig from "../../config.json";
import NoticeComponent from "./NoticeComponent";
import NoticeTextSelectionComponent from "./NoticeTextSectionComponent";
import SponsorTimeEditComponent from "./SponsorTimeEditComponent";
import { getGuidelineInfo } from "../utils/constants";
import { exportTimes } from "../utils/exporter";
export interface SubmissionNoticeProps {
// Contains functions and variables from the content script needed by the skip notice
@@ -16,8 +20,8 @@ export interface SubmissionNoticeProps {
}
export interface SubmissionNoticeState {
noticeTitle: string,
messages: string[],
noticeTitle: string;
messages: string[];
idSuffix: string;
}
@@ -32,6 +36,8 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
videoObserver: MutationObserver;
guidelinesReminder: GenericNotice;
constructor(props: SubmissionNoticeProps) {
super(props);
this.noticeRef = React.createRef();
@@ -68,12 +74,29 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
}
render(): React.ReactElement {
const sortButton =
<img id={"sponsorSkipSortButton" + this.state.idSuffix}
className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipSmallButton"
onClick={() => this.sortSegments()}
title={chrome.i18n.getMessage("sortSegments")}
key="sortButton"
src={chrome.extension.getURL("icons/sort.svg")}>
</img>;
const exportButton =
<img id={"sponsorSkipExportButton" + this.state.idSuffix}
className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipSmallButton"
onClick={() => this.exportSegments()}
title={chrome.i18n.getMessage("exportSegments")}
key="exportButton"
src={chrome.extension.getURL("icons/export.svg")}>
</img>;
return (
<NoticeComponent noticeTitle={this.state.noticeTitle}
idSuffix={this.state.idSuffix}
ref={this.noticeRef}
closeListener={this.cancel.bind(this)}
zIndex={5000}>
zIndex={5000}
firstColumn={[sortButton, exportButton]}>
{/* Text Boxes */}
{this.getMessageBoxes()}
@@ -128,6 +151,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
index={i}
contentContainer={this.props.contentContainer}
submissionNotice={this}
categoryChangeListener={this.categoryChangeListener.bind(this)}
ref={timeRef}>
</SponsorTimeEditComponent>
);
@@ -154,9 +178,10 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
}
cancel(): void {
this.guidelinesReminder?.close();
this.noticeRef.current.close(true);
this.contentContainer().resetSponsorSubmissionNotice();
this.contentContainer().resetSponsorSubmissionNotice(false);
this.props.closeListener();
}
@@ -190,6 +215,79 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
this.cancel();
}
sortSegments(): void {
let sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
sponsorTimesSubmitting = sponsorTimesSubmitting.sort((a, b) => a.segment[0] - b.segment[0]);
Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting;
Config.forceSyncUpdate("unsubmittedSegments");
this.forceUpdate();
}
exportSegments() {
const sponsorTimesSubmitting = this.props.contentContainer()
.sponsorTimesSubmitting.sort((a, b) => a.segment[0] - b.segment[0]);
window.navigator.clipboard.writeText(exportTimes(sponsorTimesSubmitting));
new GenericNotice(null, "exportCopied", {
title: chrome.i18n.getMessage(`CopiedExclamation`),
timed: true,
maxCountdownTime: () => 0.6,
referenceNode: document.querySelector(".noticeLeftIcon"),
dontPauseCountdown: true,
style: {
top: 0,
bottom: 0,
minWidth: 0,
right: "30px",
margin: "auto"
},
hideLogo: true,
hideRightInfo: true,
extraClass: "exportCopiedNotice"
});
}
categoryChangeListener(index: number, category: Category): void {
const dialogWidth = this.noticeRef?.current?.getElement()?.current?.offsetWidth;
if (category !== "chooseACategory" && Config.config.showCategoryGuidelines
&& this.contentContainer().v.offsetWidth > dialogWidth * 2) {
const options = {
title: chrome.i18n.getMessage(`category_${category}`),
textBoxes: getGuidelineInfo(category),
buttons: [{
name: chrome.i18n.getMessage("FullDetails"),
listener: () => window.open(CompileConfig.wikiLinks[category])
},
{
name: chrome.i18n.getMessage("Hide"),
listener: () => {
Config.config.showCategoryGuidelines = false;
this.guidelinesReminder?.close();
this.guidelinesReminder = null;
}
}],
timed: false,
style: {
right: `${dialogWidth + 10}px`,
},
extraClass: "sb-guidelines-notice"
};
if (options.textBoxes) {
if (this.guidelinesReminder) {
this.guidelinesReminder.update(options);
} else {
this.guidelinesReminder = new GenericNotice(null, "GuidelinesReminder", options);
}
} else {
this.guidelinesReminder?.close();
this.guidelinesReminder = null;
}
}
}
}
export default SubmissionNoticeComponent;

View File

@@ -1,6 +1,4 @@
import * as React from "react";
import Config from "../config";
import { Category, SegmentUUID, SponsorTime } from "../types";
export interface TooltipProps {
text: string;

View File

@@ -1,7 +1,7 @@
import * as React from "react";
import * as CompileConfig from "../../config.json";
import { Category } from "../types";
import * as CompileConfig from "../../../config.json";
import { Category } from "../../types";
import CategorySkipOptionsComponent from "./CategorySkipOptionsComponent";
export interface CategoryChooserProps {

View File

@@ -1,15 +1,17 @@
import * as React from "react";
import Config from "../config"
import * as CompileConfig from "../../config.json";
import { Category, CategorySkipOption } from "../types";
import Config from "../../config"
import * as CompileConfig from "../../../config.json";
import { Category, CategorySkipOption } from "../../types";
import { getCategorySuffix } from "../utils/categoryUtils";
import { getCategorySuffix } from "../../utils/categoryUtils";
import ToggleOptionComponent from "./ToggleOptionComponent";
export interface CategorySkipOptionsProps {
category: Category;
defaultColor?: string;
defaultPreviewColor?: string;
children?: React.ReactNode;
}
export interface CategorySkipOptionsState {
@@ -17,7 +19,14 @@ export interface CategorySkipOptionsState {
previewColor: string;
}
export interface ToggleOption {
configKey: string;
label: string;
dontDisable?: boolean;
}
class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsProps, CategorySkipOptionsState> {
setBarColorTimeout: NodeJS.Timeout;
constructor(props: CategorySkipOptionsProps) {
super(props);
@@ -25,8 +34,8 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
// Setup state
this.state = {
color: props.defaultColor || Config.config.barTypes[this.props.category]?.color,
previewColor: props.defaultPreviewColor || Config.config.barTypes["preview-" + this.props.category]?.color,
}
previewColor: props.defaultPreviewColor || Config.config.barTypes["preview-" + this.props.category]?.color
};
}
render(): React.ReactElement {
@@ -53,7 +62,7 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
return (
<>
<tr id={this.props.category + "OptionsRow"}
className="categoryTableElement">
className={`categoryTableElement`} >
<td id={this.props.category + "OptionName"}
className="categoryTableLabel">
{chrome.i18n.getMessage("category_" + this.props.category)}
@@ -68,17 +77,19 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
{this.getCategorySkipOptions()}
</select>
</td>
<td id={this.props.category + "ColorOption"}
className="colorOption">
<input
className="categoryColorTextBox option-text-box"
type="color"
onChange={(event) => this.setColorState(event, false)}
value={this.state.color} />
</td>
{this.props.category !== "exclusive_access" &&
{this.props.category !== "chapter" &&
<td id={this.props.category + "ColorOption"}
className="colorOption">
<input
className="categoryColorTextBox option-text-box"
type="color"
onChange={(event) => this.setColorState(event, false)}
value={this.state.color} />
</td>
}
{!["chapter", "exclusive_access"].includes(this.props.category) &&
<td id={this.props.category + "PreviewColorOption"}
className="previewColorOption">
<input
@@ -92,7 +103,7 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
</tr>
<tr id={this.props.category + "DescriptionRow"}
className="small-description categoryTableDescription">
className={`small-description categoryTableDescription`}>
<td
colSpan={2}>
{chrome.i18n.getMessage("category_" + this.props.category + "_description")}
@@ -102,6 +113,8 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
</a>
</td>
</tr>
{this.getExtraOptionComponents(this.props.category)}
</>
);
@@ -110,10 +123,10 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
skipOptionSelected(event: React.ChangeEvent<HTMLSelectElement>): void {
let option: CategorySkipOption;
this.removeCurrentCategorySelection();
switch (event.target.value) {
case "disable":
case "disable":
Config.config.categorySelections = Config.config.categorySelections.filter(
categorySelection => categorySelection.name !== this.props.category);
return;
case "showOverlay":
option = CategorySkipOption.ShowOverlay;
@@ -129,35 +142,25 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
break;
}
Config.config.categorySelections.push({
name: this.props.category,
option: option
});
// Forces the Proxy to send this to the chrome storage API
Config.config.categorySelections = Config.config.categorySelections;
}
/** Removes this category from the config list of category selections */
removeCurrentCategorySelection(): void {
// Remove it if it exists
for (let i = 0; i < Config.config.categorySelections.length; i++) {
if (Config.config.categorySelections[i].name === this.props.category) {
Config.config.categorySelections.splice(i, 1);
// Forces the Proxy to send this to the chrome storage API
Config.config.categorySelections = Config.config.categorySelections;
break;
}
const existingSelection = Config.config.categorySelections.find(selection => selection.name === this.props.category);
if (existingSelection) {
existingSelection.option = option;
} else {
Config.config.categorySelections.push({
name: this.props.category,
option: option
});
}
Config.forceSyncUpdate("categorySelections");
}
getCategorySkipOptions(): JSX.Element[] {
const elements: JSX.Element[] = [];
let optionNames = ["disable", "showOverlay", "manualSkip", "autoSkip"];
if (this.props.category === "exclusive_access") optionNames = ["disable", "showOverlay"];
if (this.props.category === "chapter") optionNames = ["disable", "showOverlay"]
else if (this.props.category === "exclusive_access") optionNames = ["disable", "showOverlay"];
for (const optionName of optionNames) {
elements.push(
@@ -172,6 +175,8 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
}
setColorState(event: React.FormEvent<HTMLInputElement>, preview: boolean): void {
clearTimeout(this.setBarColorTimeout);
if (preview) {
this.setState({
previewColor: event.currentTarget.value
@@ -188,7 +193,50 @@ class CategorySkipOptionsComponent extends React.Component<CategorySkipOptionsPr
}
// Make listener get called
Config.config.barTypes = Config.config.barTypes;
this.setBarColorTimeout = setTimeout(() => {
Config.config.barTypes = Config.config.barTypes;
}, 50);
}
getExtraOptionComponents(category: string): JSX.Element[] {
const result = [];
for (const option of this.getExtraOptions(category)) {
result.push(
<tr key={option.configKey}>
<td id={`${category}_${option.configKey}`} className="categoryExtraOptions">
<ToggleOptionComponent
configKey={option.configKey}
label={option.label}
style={{width: "inherit"}}
/>
</td>
</tr>
)
}
return result;
}
getExtraOptions(category: string): ToggleOption[] {
switch (category) {
case "chapter":
return [{
configKey: "renderSegmentsAsChapters",
label: chrome.i18n.getMessage("renderAsChapters"),
dontDisable: true
}, {
configKey: "showSegmentNameInChapterBar",
label: chrome.i18n.getMessage("showSegmentNameInChapterBar"),
dontDisable: true
}];
case "music_offtopic":
return [{
configKey: "autoSkipOnMusicVideos",
label: chrome.i18n.getMessage("autoSkipOnMusicVideos"),
}];
default:
return [];
}
}
}

View File

@@ -1,9 +1,8 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import Config from "../config";
import { Keybind } from "../types";
import { createRoot, Root } from 'react-dom/client';
import Config from "../../config";
import KeybindDialogComponent from "./KeybindDialogComponent";
import { keybindEquals, keybindToString, formatKey } from "../utils/configUtils";
import { formatKey, Keybind, keybindEquals, keybindToString } from "@ajayyy/maze-utils/lib/config";
export interface KeybindProps {
option: string;
@@ -14,6 +13,7 @@ export interface KeybindState {
}
let dialog;
let root: Root;
class KeybindComponent extends React.Component<KeybindProps, KeybindState> {
constructor(props: KeybindProps) {
@@ -56,11 +56,12 @@ class KeybindComponent extends React.Component<KeybindProps, KeybindState> {
dialog = parent.document.createElement("div");
dialog.id = "keybind-dialog";
parent.document.body.prepend(dialog);
ReactDOM.render(<KeybindDialogComponent option={this.props.option} closeListener={(updateWith) => this.closeEditDialog(updateWith)} />, dialog);
root = createRoot(dialog);
root.render(<KeybindDialogComponent option={this.props.option} closeListener={(updateWith) => this.closeEditDialog(updateWith)} />);
}
closeEditDialog(updateWith: Keybind): void {
ReactDOM.unmountComponentAtNode(dialog);
root.unmount();
dialog.remove();
if (updateWith != null)
this.setState({keybind: updateWith});

View File

@@ -1,8 +1,7 @@
import * as React from "react";
import { ChangeEvent } from "react";
import Config from "../config";
import { Keybind } from "../types";
import { keybindEquals, formatKey } from "../utils/configUtils";
import Config from "../../config";
import { Keybind, formatKey, keybindEquals } from "@ajayyy/maze-utils/lib/config";
export interface KeybindDialogProps {
option: string;
@@ -124,7 +123,7 @@ class KeybindDialogComponent extends React.Component<KeybindDialogProps, Keybind
let youtubeShortcuts: Keybind[];
if (/[a-zA-Z0-9,.+\-\][:]/.test(this.state.key.key)) {
youtubeShortcuts = [{key: "k"}, {key: "j"}, {key: "l"}, {key: "p", shift: true}, {key: "n", shift: true}, {key: ","}, {key: "."}, {key: ",", shift: true}, {key: ".", shift: true},
{key: "ArrowRight"}, {key: "ArrowLeft"}, {key: "ArrowUp"}, {key: "ArrowDown"}, {key: "ArrowRight", ctrl: true}, {key: "ArrowLeft", ctrl: true}, {key: "c"}, {key: "o"},
{key: "ArrowRight"}, {key: "ArrowLeft"}, {key: "ArrowUp"}, {key: "ArrowDown"}, {key: "c"}, {key: "o"},
{key: "w"}, {key: "+"}, {key: "-"}, {key: "f"}, {key: "t"}, {key: "i"}, {key: "m"}, {key: "a"}, {key: "s"}, {key: "d"}, {key: "Home"}, {key: "End"},
{key: "0"}, {key: "1"}, {key: "2"}, {key: "3"}, {key: "4"}, {key: "5"}, {key: "6"}, {key: "7"}, {key: "8"}, {key: "9"}, {key: "]"}, {key: "["}];
} else {

View File

@@ -0,0 +1,57 @@
import * as React from "react";
import Config from "../../config";
export interface ToggleOptionProps {
configKey: string;
label: string;
disabled?: boolean;
style?: React.CSSProperties;
}
export interface ToggleOptionState {
enabled: boolean;
}
class ToggleOptionComponent extends React.Component<ToggleOptionProps, ToggleOptionState> {
constructor(props: ToggleOptionProps) {
super(props);
// Setup state
this.state = {
enabled: Config.config[props.configKey]
}
}
render(): React.ReactElement {
return (
<div className={`sb-toggle-option ${this.props.disabled ? "disabled" : ""}`}>
<div className="switch-container" style={this.props.style}>
<label className="switch">
<input id={this.props.configKey}
type="checkbox"
checked={this.state.enabled}
disabled={this.props.disabled}
onChange={(e) => this.clicked(e)}/>
<span className="slider round"></span>
</label>
<label className="switch-label" htmlFor={this.props.configKey}>
{this.props.label}
</label>
</div>
</div>
);
}
clicked(event: React.ChangeEvent<HTMLInputElement>): void {
Config.config[this.props.configKey] = event.target.checked;
this.setState({
enabled: event.target.checked
});
}
}
export default ToggleOptionComponent;

View File

@@ -0,0 +1,72 @@
import * as React from "react";
import Config from "../../config";
import UnsubmittedVideoListItem from "./UnsubmittedVideoListItem";
export interface UnsubmittedVideoListProps {
}
export interface UnsubmittedVideoListState {
}
class UnsubmittedVideoListComponent extends React.Component<UnsubmittedVideoListProps, UnsubmittedVideoListState> {
constructor(props: UnsubmittedVideoListProps) {
super(props);
// Setup state
this.state = {
};
}
render(): React.ReactElement {
// Render nothing if there are no unsubmitted segments
if (Object.keys(Config.config.unsubmittedSegments).length == 0)
return <></>;
return (
<table id="unsubmittedVideosList"
className="categoryChooserTable"
style={{marginTop: "10px"}} >
<tbody>
{/* Headers */}
<tr id="UnsubmittedVideosListHeader"
className="categoryTableElement categoryTableHeader">
<th id="UnsubmittedVideoID">
{chrome.i18n.getMessage("videoID")}
</th>
<th id="UnsubmittedSegmentCount">
{chrome.i18n.getMessage("segmentCount")}
</th>
<th id="UnsubmittedVideoActions">
{chrome.i18n.getMessage("actions")}
</th>
</tr>
{this.getUnsubmittedVideos()}
</tbody>
</table>
);
}
getUnsubmittedVideos(): JSX.Element[] {
const elements: JSX.Element[] = [];
for (const videoID of Object.keys(Config.config.unsubmittedSegments)) {
elements.push(
<UnsubmittedVideoListItem videoID={videoID} key={videoID}>
</UnsubmittedVideoListItem>
);
}
return elements;
}
}
export default UnsubmittedVideoListComponent;

View File

@@ -0,0 +1,96 @@
import * as React from "react";
import Config from "../../config";
import { exportTimes, exportTimesAsHashParam } from "../../utils/exporter";
export interface UnsubmittedVideosListItemProps {
videoID: string;
children?: React.ReactNode;
}
export interface UnsubmittedVideosListItemState {
}
class UnsubmittedVideoListItem extends React.Component<UnsubmittedVideosListItemProps, UnsubmittedVideosListItemState> {
constructor(props: UnsubmittedVideosListItemProps) {
super(props);
// Setup state
this.state = {
};
}
render(): React.ReactElement {
const segmentCount = Config.config.unsubmittedSegments[this.props.videoID]?.length ?? 0;
return (
<>
<tr id={this.props.videoID + "UnsubmittedSegmentsRow"}
className="categoryTableElement">
<td id={this.props.videoID + "UnsubmittedVideoID"}
className="categoryTableLabel">
<a href={`https://youtu.be/${this.props.videoID}`}
target="_blank" rel="noreferrer">
{this.props.videoID}
</a>
</td>
<td id={this.props.videoID + "UnsubmittedSegmentCount"}>
{segmentCount}
</td>
<td id={this.props.videoID + "UnsubmittedVideoActions"}>
<div id={this.props.videoID + "ExportSegmentsAction"}
className="option-button inline low-profile"
onClick={this.exportSegments.bind(this)}>
{chrome.i18n.getMessage("exportSegments")}
</div>
{" "}
<div id={this.props.videoID + "ExportSegmentsAsURLAction"}
className="option-button inline low-profile"
onClick={this.exportSegmentsAsURL.bind(this)}>
{chrome.i18n.getMessage("exportSegmentsAsURL")}
</div>
{" "}
<div id={this.props.videoID + "ClearSegmentsAction"}
className="option-button inline low-profile"
onClick={this.clearSegments.bind(this)}>
{chrome.i18n.getMessage("clearTimes")}
</div>
</td>
</tr>
</>
);
}
clearSegments(): void {
if (confirm(chrome.i18n.getMessage("clearThis"))) {
delete Config.config.unsubmittedSegments[this.props.videoID];
Config.forceSyncUpdate("unsubmittedSegments");
}
}
exportSegments(): void {
this.copyToClipboard(exportTimes(Config.config.unsubmittedSegments[this.props.videoID]));
}
exportSegmentsAsURL(): void {
this.copyToClipboard(`https://youtube.com/watch?v=${this.props.videoID}${exportTimesAsHashParam(Config.config.unsubmittedSegments[this.props.videoID])}`)
}
copyToClipboard(text: string): void {
navigator.clipboard.writeText(text)
.then(() => {
alert(chrome.i18n.getMessage("CopiedExclamation"));
})
.catch(() => {
alert(chrome.i18n.getMessage("copyDebugInformationFailed"));
});
}
}
export default UnsubmittedVideoListItem;

View File

@@ -0,0 +1,55 @@
import * as React from "react";
import Config from "../../config";
import UnsubmittedVideoListComponent from "./UnsubmittedVideoListComponent";
export interface UnsubmittedVideosProps {
}
export interface UnsubmittedVideosState {
tableVisible: boolean;
}
class UnsubmittedVideosComponent extends React.Component<UnsubmittedVideosProps, UnsubmittedVideosState> {
constructor(props: UnsubmittedVideosProps) {
super(props);
this.state = {
tableVisible: false,
};
}
render(): React.ReactElement {
const videoCount = Object.keys(Config.config.unsubmittedSegments).length;
const segmentCount = Object.values(Config.config.unsubmittedSegments).reduce((acc: number, vid: Array<unknown>) => acc + vid.length, 0);
return <>
<div style={{marginBottom: "10px"}}>
{segmentCount == 0 ?
chrome.i18n.getMessage("unsubmittedSegmentCountsZero") :
chrome.i18n.getMessage("unsubmittedSegmentCounts")
.replace("{0}", `${segmentCount} ${chrome.i18n.getMessage("unsubmittedSegments" + (segmentCount == 1 ? "Singular" : "Plural"))}`)
.replace("{1}", `${videoCount} ${chrome.i18n.getMessage("videos" + (videoCount == 1 ? "Singular" : "Plural"))}`)
}
</div>
{videoCount > 0 && <div className="option-button inline" onClick={() => this.setState({tableVisible: !this.state.tableVisible})}>
{chrome.i18n.getMessage(this.state.tableVisible ? "hideUnsubmittedSegments" : "showUnsubmittedSegments")}
</div>}
{" "}
<div className="option-button inline" onClick={this.clearAllSegments}>
{chrome.i18n.getMessage("clearUnsubmittedSegments")}
</div>
{this.state.tableVisible && <UnsubmittedVideoListComponent/>}
</>;
}
clearAllSegments(): void {
if (confirm(chrome.i18n.getMessage("clearUnsubmittedSegmentsConfirm")))
Config.config.unsubmittedSegments = {};
}
}
export default UnsubmittedVideosComponent;

View File

@@ -1,436 +1,443 @@
import * as CompileConfig from "../config.json";
import * as invidiousList from "../ci/invidiouslist.json";
import { Category, CategorySelection, CategorySkipOption, NoticeVisbilityMode, PreviewBarOption, SponsorTime, StorageChangesObject, UnEncodedSegmentTimes as UnencodedSegmentTimes, Keybind, HashedValue, VideoID, SponsorHideType } from "./types";
import { keybindEquals } from "./utils/configUtils";
import { Category, CategorySelection, CategorySkipOption, NoticeVisbilityMode, PreviewBarOption, SponsorTime, VideoID, SponsorHideType } from "./types";
import { Keybind, ProtoConfig, keybindEquals } from "@ajayyy/maze-utils/lib/config";
import { HashedValue } from "@ajayyy/maze-utils/lib/hash";
export interface Permission {
canSubmit: boolean;
}
interface SBConfig {
userID: string,
isVip: boolean,
lastIsVipUpdate: number,
userID: string;
isVip: boolean;
permissions: Record<Category, Permission>;
/* Contains unsubmitted segments that the user has created. */
unsubmittedSegments: Record<string, SponsorTime[]>,
defaultCategory: Category,
whitelistedChannels: string[],
forceChannelCheck: boolean,
minutesSaved: number,
skipCount: number,
sponsorTimesContributed: number,
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
showTimeWithSkips: boolean,
disableSkipping: boolean,
muteSegments: boolean,
fullVideoSegments: boolean,
trackViewCount: boolean,
trackViewCountInPrivate: boolean,
trackDownvotes: boolean,
dontShowNotice: boolean,
noticeVisibilityMode: NoticeVisbilityMode,
hideVideoPlayerControls: boolean,
hideInfoButtonPlayerControls: boolean,
hideDeleteButtonPlayerControls: boolean,
hideUploadButtonPlayerControls: boolean,
hideSkipButtonPlayerControls: boolean,
hideDiscordLaunches: number,
hideDiscordLink: boolean,
invidiousInstances: string[],
supportInvidious: boolean,
serverAddress: string,
minDuration: number,
skipNoticeDuration: number,
audioNotificationOnSkip: boolean,
checkForUnlistedVideos: boolean,
testingServer: boolean,
refetchWhenNotFound: boolean,
ytInfoPermissionGranted: boolean,
allowExpirements: boolean,
showDonationLink: boolean,
showPopupDonationCount: number,
donateClicked: number,
autoHideInfoButton: boolean,
autoSkipOnMusicVideos: boolean,
unsubmittedSegments: Record<string, SponsorTime[]>;
defaultCategory: Category;
renderSegmentsAsChapters: boolean;
whitelistedChannels: string[];
forceChannelCheck: boolean;
minutesSaved: number;
skipCount: number;
sponsorTimesContributed: number;
submissionCountSinceCategories: number; // New count used to show the "Read The Guidelines!!" message
showTimeWithSkips: boolean;
disableSkipping: boolean;
muteSegments: boolean;
fullVideoSegments: boolean;
fullVideoLabelsOnThumbnails: boolean;
manualSkipOnFullVideo: boolean;
trackViewCount: boolean;
trackViewCountInPrivate: boolean;
trackDownvotes: boolean;
dontShowNotice: boolean;
noticeVisibilityMode: NoticeVisbilityMode;
hideVideoPlayerControls: boolean;
hideInfoButtonPlayerControls: boolean;
hideDeleteButtonPlayerControls: boolean;
hideUploadButtonPlayerControls: boolean;
hideSkipButtonPlayerControls: boolean;
hideDiscordLaunches: number;
hideDiscordLink: boolean;
invidiousInstances: string[];
supportInvidious: boolean;
serverAddress: string;
minDuration: number;
skipNoticeDuration: number;
audioNotificationOnSkip: boolean;
checkForUnlistedVideos: boolean;
testingServer: boolean;
refetchWhenNotFound: boolean;
ytInfoPermissionGranted: boolean;
allowExpirements: boolean;
showDonationLink: boolean;
showPopupDonationCount: number;
showUpsells: boolean;
donateClicked: number;
autoHideInfoButton: boolean;
autoSkipOnMusicVideos: boolean;
colorPalette: {
red: string,
white: string,
locked: string
},
scrollToEditTimeUpdate: boolean,
categoryPillUpdate: boolean,
darkMode: boolean,
red: string;
white: string;
locked: string;
};
scrollToEditTimeUpdate: boolean;
categoryPillUpdate: boolean;
showChapterInfoMessage: boolean;
darkMode: boolean;
showCategoryGuidelines: boolean;
showCategoryWithoutPermission: boolean;
showSegmentNameInChapterBar: boolean;
useVirtualTime: boolean;
showSegmentFailedToFetchWarning: boolean;
allowScrollingToEdit: boolean;
// Used to cache calculated text color info
categoryPillColors: {
[key in Category]: {
lastColor: string,
textColor: string
lastColor: string;
textColor: string;
}
}
};
skipKeybind: Keybind,
startSponsorKeybind: Keybind,
submitKeybind: Keybind,
skipKeybind: Keybind;
startSponsorKeybind: Keybind;
submitKeybind: Keybind;
nextChapterKeybind: Keybind;
previousChapterKeybind: Keybind;
// What categories should be skipped
categorySelections: CategorySelection[],
categorySelections: CategorySelection[];
payments: {
licenseKey: string;
lastCheck: number;
lastFreeCheck: number;
freeAccess: boolean;
chaptersAllowed: boolean;
};
// Preview bar
barTypes: {
"preview-chooseACategory": PreviewBarOption,
"sponsor": PreviewBarOption,
"preview-sponsor": PreviewBarOption,
"selfpromo": PreviewBarOption,
"preview-selfpromo": PreviewBarOption,
"exclusive_access": PreviewBarOption,
"interaction": PreviewBarOption,
"preview-interaction": PreviewBarOption,
"intro": PreviewBarOption,
"preview-intro": PreviewBarOption,
"outro": PreviewBarOption,
"preview-outro": PreviewBarOption,
"preview": PreviewBarOption,
"preview-preview": PreviewBarOption,
"music_offtopic": PreviewBarOption,
"preview-music_offtopic": PreviewBarOption,
"poi_highlight": PreviewBarOption,
"preview-poi_highlight": PreviewBarOption,
"filler": PreviewBarOption,
"preview-filler": PreviewBarOption,
}
"preview-chooseACategory": PreviewBarOption;
"sponsor": PreviewBarOption;
"preview-sponsor": PreviewBarOption;
"selfpromo": PreviewBarOption;
"preview-selfpromo": PreviewBarOption;
"exclusive_access": PreviewBarOption;
"interaction": PreviewBarOption;
"preview-interaction": PreviewBarOption;
"intro": PreviewBarOption;
"preview-intro": PreviewBarOption;
"outro": PreviewBarOption;
"preview-outro": PreviewBarOption;
"preview": PreviewBarOption;
"preview-preview": PreviewBarOption;
"music_offtopic": PreviewBarOption;
"preview-music_offtopic": PreviewBarOption;
"poi_highlight": PreviewBarOption;
"preview-poi_highlight": PreviewBarOption;
"filler": PreviewBarOption;
"preview-filler": PreviewBarOption;
};
}
export type VideoDownvotes = { segments: { uuid: HashedValue, hidden: SponsorHideType }[] , lastAccess: number };
export type VideoDownvotes = { segments: { uuid: HashedValue; hidden: SponsorHideType }[]; lastAccess: number };
interface SBStorage {
/* VideoID prefixes to UUID prefixes */
downvotedSegments: Record<VideoID & HashedValue, VideoDownvotes>,
downvotedSegments: Record<VideoID & HashedValue, VideoDownvotes>;
navigationApiAvailable: boolean;
}
export interface SBObject {
configSyncListeners: Array<(changes: StorageChangesObject) => unknown>;
syncDefaults: SBConfig;
localDefaults: SBStorage;
cachedSyncConfig: SBConfig;
cachedLocalStorage: SBStorage;
config: SBConfig;
local: SBStorage;
forceSyncUpdate(prop: string): void;
forceLocalUpdate(prop: string): void;
}
const Config: SBObject = {
/**
* Callback function when an option is updated
*/
configSyncListeners: [],
syncDefaults: {
userID: null,
isVip: false,
lastIsVipUpdate: 0,
unsubmittedSegments: {},
defaultCategory: "chooseACategory" as Category,
whitelistedChannels: [],
forceChannelCheck: false,
minutesSaved: 0,
skipCount: 0,
sponsorTimesContributed: 0,
submissionCountSinceCategories: 0,
showTimeWithSkips: true,
disableSkipping: false,
muteSegments: true,
fullVideoSegments: true,
trackViewCount: true,
trackViewCountInPrivate: true,
trackDownvotes: true,
dontShowNotice: false,
noticeVisibilityMode: NoticeVisbilityMode.FadedForAutoSkip,
hideVideoPlayerControls: false,
hideInfoButtonPlayerControls: false,
hideDeleteButtonPlayerControls: false,
hideUploadButtonPlayerControls: false,
hideSkipButtonPlayerControls: false,
hideDiscordLaunches: 0,
hideDiscordLink: false,
invidiousInstances: ["invidious.snopyta.org"], // leave as default
supportInvidious: false,
serverAddress: CompileConfig.serverAddress,
minDuration: 0,
skipNoticeDuration: 4,
audioNotificationOnSkip: false,
checkForUnlistedVideos: false,
testingServer: false,
refetchWhenNotFound: true,
ytInfoPermissionGranted: false,
allowExpirements: true,
showDonationLink: true,
showPopupDonationCount: 0,
donateClicked: 0,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,
scrollToEditTimeUpdate: false, // false means the tooltip will be shown
categoryPillUpdate: false,
darkMode: true,
categoryPillColors: {},
/**
* Default keybinds should not set "code" as that's gonna be different based on the user's locale. They should also only use EITHER ctrl OR alt modifiers (or none).
* Using ctrl+alt, or shift may produce a different character that we will not be able to recognize in different locales.
* The exception for shift is letters, where it only capitalizes. So shift+A is fine, but shift+1 isn't.
* Don't forget to add the new keybind to the checks in "KeybindDialogComponent.isKeybindAvailable()" and in "migrateOldFormats()"!
* TODO: Find a way to skip having to update these checks. Maybe storing keybinds in a Map?
*/
skipKeybind: {key: "Enter"},
startSponsorKeybind: {key: ";"},
submitKeybind: {key: "'"},
categorySelections: [{
name: "sponsor" as Category,
option: CategorySkipOption.AutoSkip
}, {
name: "interaction" as Category,
option: CategorySkipOption.AutoSkip
}, {
name: "selfpromo" as Category,
option: CategorySkipOption.AutoSkip
}],
colorPalette: {
red: "#780303",
white: "#ffffff",
locked: "#ffc83d"
},
// Preview bar
barTypes: {
"preview-chooseACategory": {
color: "#ffffff",
opacity: "0.7"
},
"sponsor": {
color: "#807EFB",
opacity: "0.7"
},
"preview-sponsor": {
color: "#007800",
opacity: "0.7"
},
"selfpromo": {
color: "#ffff00",
opacity: "0.7"
},
"preview-selfpromo": {
color: "#bfbf35",
opacity: "0.7"
},
"exclusive_access": {
color: "#008a5c",
opacity: "0.7"
},
"interaction": {
color: "#cc00ff",
opacity: "0.7"
},
"preview-interaction": {
color: "#6c0087",
opacity: "0.7"
},
"intro": {
color: "#00ffff",
opacity: "0.7"
},
"preview-intro": {
color: "#008080",
opacity: "0.7"
},
"outro": {
color: "#0202ed",
opacity: "0.7"
},
"preview-outro": {
color: "#000070",
opacity: "0.7"
},
"preview": {
color: "#008fd6",
opacity: "0.7"
},
"preview-preview": {
color: "#005799",
opacity: "0.7"
},
"music_offtopic": {
color: "#ff9900",
opacity: "0.7"
},
"preview-music_offtopic": {
color: "#a6634a",
opacity: "0.7"
},
"poi_highlight": {
color: "#ff1684",
opacity: "0.7"
},
"preview-poi_highlight": {
color: "#9b044c",
opacity: "0.7"
},
"filler": {
color: "#7300FF",
opacity: "0.9"
},
"preview-filler": {
color: "#2E0066",
opacity: "0.7"
}
}
},
localDefaults: {
downvotedSegments: {}
},
cachedSyncConfig: null,
cachedLocalStorage: null,
config: null,
local: null,
forceSyncUpdate,
forceLocalUpdate
};
// Function setup
function configProxy(): { sync: SBConfig, local: SBStorage } {
chrome.storage.onChanged.addListener((changes: {[key: string]: chrome.storage.StorageChange}, areaName) => {
if (areaName === "sync") {
for (const key in changes) {
Config.cachedSyncConfig[key] = changes[key].newValue;
}
for (const callback of Config.configSyncListeners) {
callback(changes);
}
} else if (areaName === "local") {
for (const key in changes) {
Config.cachedLocalStorage[key] = changes[key].newValue;
}
}
});
const syncHandler: ProxyHandler<SBConfig> = {
set<K extends keyof SBConfig>(obj: SBConfig, prop: K, value: SBConfig[K]) {
Config.cachedSyncConfig[prop] = value;
chrome.storage.sync.set({
[prop]: value
});
return true;
},
get<K extends keyof SBConfig>(obj: SBConfig, prop: K): SBConfig[K] {
const data = Config.cachedSyncConfig[prop];
return obj[prop] || data;
},
deleteProperty(obj: SBConfig, prop: keyof SBConfig) {
chrome.storage.sync.remove(<string> prop);
return true;
}
};
const localHandler: ProxyHandler<SBStorage> = {
set<K extends keyof SBStorage>(obj: SBStorage, prop: K, value: SBStorage[K]) {
Config.cachedLocalStorage[prop] = value;
chrome.storage.local.set({
[prop]: value
});
return true;
},
get<K extends keyof SBStorage>(obj: SBStorage, prop: K): SBStorage[K] {
const data = Config.cachedLocalStorage[prop];
return obj[prop] || data;
},
deleteProperty(obj: SBStorage, prop: keyof SBStorage) {
chrome.storage.local.remove(<string> prop);
return true;
}
};
return {
sync: new Proxy<SBConfig>({ handler: syncHandler } as unknown as SBConfig, syncHandler),
local: new Proxy<SBStorage>({ handler: localHandler } as unknown as SBStorage, localHandler)
};
}
function forceSyncUpdate(prop: string): void {
chrome.storage.sync.set({
[prop]: Config.cachedSyncConfig[prop]
});
}
function forceLocalUpdate(prop: string): void {
chrome.storage.local.set({
[prop]: Config.cachedLocalStorage[prop]
});
}
async function fetchConfig(): Promise<void> {
await Promise.all([new Promise<void>((resolve) => {
chrome.storage.sync.get(null, function(items) {
Config.cachedSyncConfig = <SBConfig> <unknown> items;
resolve();
class ConfigClass extends ProtoConfig<SBConfig, SBStorage> {
resetToDefault() {
chrome.storage.sync.set({
...this.syncDefaults,
userID: this.config.userID,
minutesSaved: this.config.minutesSaved,
skipCount: this.config.skipCount,
sponsorTimesContributed: this.config.sponsorTimesContributed
});
}), new Promise<void>((resolve) => {
chrome.storage.local.get(null, function(items) {
Config.cachedLocalStorage = <SBStorage> <unknown> items;
resolve();
});
})]);
}
}
function migrateOldSyncFormats(config: SBConfig) {
//
}
if (!config["chapterCategoryAdded"]) {
config["chapterCategoryAdded"] = true;
async function setupConfig() {
await fetchConfig();
addDefaults();
const config = configProxy();
migrateOldSyncFormats(config.sync);
if (!config.categorySelections.some((s) => s.name === "chapter")) {
config.categorySelections.push({
name: "chapter" as Category,
option: CategorySkipOption.ShowOverlay
});
config.categorySelections = config.categorySelections;
}
}
Config.config = config.sync;
Config.local = config.local;
}
if (config["segmentTimes"]) {
const unsubmittedSegments = {};
for (const item of config["segmentTimes"]) {
unsubmittedSegments[item[0]] = item[1];
}
// Add defaults
function addDefaults() {
for (const key in Config.syncDefaults) {
if(!Object.prototype.hasOwnProperty.call(Config.cachedSyncConfig, key)) {
Config.cachedSyncConfig[key] = Config.syncDefaults[key];
} else if (key === "barTypes") {
for (const key2 in Config.syncDefaults[key]) {
if(!Object.prototype.hasOwnProperty.call(Config.cachedSyncConfig[key], key2)) {
Config.cachedSyncConfig[key][key2] = Config.syncDefaults[key][key2];
}
chrome.storage.sync.remove("segmentTimes", () => config.unsubmittedSegments = unsubmittedSegments);
}
if (config["exclusive_accessCategoryAdded"] !== undefined) {
chrome.storage.sync.remove("exclusive_accessCategoryAdded");
}
if (config["fillerUpdate"] !== undefined) {
chrome.storage.sync.remove("fillerUpdate");
}
if (config["highlightCategoryAdded"] !== undefined) {
chrome.storage.sync.remove("highlightCategoryAdded");
}
if (config["highlightCategoryUpdate"] !== undefined) {
chrome.storage.sync.remove("highlightCategoryUpdate");
}
if (config["askAboutUnlistedVideos"]) {
chrome.storage.sync.remove("askAboutUnlistedVideos");
}
if (!config["autoSkipOnMusicVideosUpdate"]) {
config["autoSkipOnMusicVideosUpdate"] = true;
for (const selection of config.categorySelections) {
if (selection.name === "music_offtopic"
&& selection.option === CategorySkipOption.AutoSkip) {
config.autoSkipOnMusicVideos = true;
break;
}
}
}
for (const key in Config.localDefaults) {
if(!Object.prototype.hasOwnProperty.call(Config.cachedLocalStorage, key)) {
Config.cachedLocalStorage[key] = Config.localDefaults[key];
if (config["disableAutoSkip"]) {
for (const selection of config.categorySelections) {
if (selection.name === "sponsor") {
selection.option = CategorySkipOption.ManualSkip;
chrome.storage.sync.remove("disableAutoSkip");
}
}
}
if (typeof config["skipKeybind"] == "string") {
config["skipKeybind"] = { key: config["skipKeybind"] };
}
if (typeof config["startSponsorKeybind"] == "string") {
config["startSponsorKeybind"] = { key: config["startSponsorKeybind"] };
}
if (typeof config["submitKeybind"] == "string") {
config["submitKeybind"] = { key: config["submitKeybind"] };
}
// Unbind key if it matches a previous one set by the user (should be ordered oldest to newest)
const keybinds = ["skipKeybind", "startSponsorKeybind", "submitKeybind"];
for (let i = keybinds.length - 1; i >= 0; i--) {
for (let j = 0; j < keybinds.length; j++) {
if (i == j)
continue;
if (keybindEquals(config[keybinds[i]], config[keybinds[j]]))
config[keybinds[i]] = null;
}
}
// Remove some old unused options
if (config["sponsorVideoID"] !== undefined) {
chrome.storage.sync.remove("sponsorVideoID");
}
if (config["previousVideoID"] !== undefined) {
chrome.storage.sync.remove("previousVideoID");
}
// populate invidiousInstances with new instances if 3p support is **DISABLED**
if (!config["supportInvidious"] && config["invidiousInstances"].length < invidiousList.length) {
config["invidiousInstances"] = [...new Set([...invidiousList, ...config["invidiousInstances"]])];
}
if (config["lastIsVipUpdate"]) {
chrome.storage.sync.remove("lastIsVipUpdate");
}
}
// Sync config
setupConfig();
const syncDefaults = {
userID: null,
isVip: false,
permissions: {},
unsubmittedSegments: {},
defaultCategory: "chooseACategory" as Category,
renderSegmentsAsChapters: false,
whitelistedChannels: [],
forceChannelCheck: false,
minutesSaved: 0,
skipCount: 0,
sponsorTimesContributed: 0,
submissionCountSinceCategories: 0,
showTimeWithSkips: true,
disableSkipping: false,
muteSegments: true,
fullVideoSegments: true,
fullVideoLabelsOnThumbnails: true,
manualSkipOnFullVideo: false,
trackViewCount: true,
trackViewCountInPrivate: true,
trackDownvotes: true,
dontShowNotice: false,
noticeVisibilityMode: NoticeVisbilityMode.FadedForAutoSkip,
hideVideoPlayerControls: false,
hideInfoButtonPlayerControls: false,
hideDeleteButtonPlayerControls: false,
hideUploadButtonPlayerControls: false,
hideSkipButtonPlayerControls: false,
hideDiscordLaunches: 0,
hideDiscordLink: false,
invidiousInstances: ["invidious.snopyta.org"], // leave as default
supportInvidious: false,
serverAddress: CompileConfig.serverAddress,
minDuration: 0,
skipNoticeDuration: 4,
audioNotificationOnSkip: false,
checkForUnlistedVideos: false,
testingServer: false,
refetchWhenNotFound: true,
ytInfoPermissionGranted: false,
allowExpirements: true,
showDonationLink: true,
showPopupDonationCount: 0,
showUpsells: true,
donateClicked: 0,
autoHideInfoButton: true,
autoSkipOnMusicVideos: false,
scrollToEditTimeUpdate: false, // false means the tooltip will be shown
categoryPillUpdate: false,
showChapterInfoMessage: true,
darkMode: true,
showCategoryGuidelines: true,
showCategoryWithoutPermission: false,
showSegmentNameInChapterBar: true,
useVirtualTime: true,
showSegmentFailedToFetchWarning: true,
allowScrollingToEdit: true,
export default Config;
categoryPillColors: {},
/**
* Default keybinds should not set "code" as that's gonna be different based on the user's locale. They should also only use EITHER ctrl OR alt modifiers (or none).
* Using ctrl+alt, or shift may produce a different character that we will not be able to recognize in different locales.
* The exception for shift is letters, where it only capitalizes. So shift+A is fine, but shift+1 isn't.
* Don't forget to add the new keybind to the checks in "KeybindDialogComponent.isKeybindAvailable()" and in "migrateOldFormats()"!
* TODO: Find a way to skip having to update these checks. Maybe storing keybinds in a Map?
*/
skipKeybind: { key: "Enter" },
startSponsorKeybind: { key: ";" },
submitKeybind: { key: "'" },
nextChapterKeybind: { key: "ArrowRight", ctrl: true },
previousChapterKeybind: { key: "ArrowLeft", ctrl: true },
categorySelections: [{
name: "sponsor" as Category,
option: CategorySkipOption.AutoSkip
}, {
name: "poi_highlight" as Category,
option: CategorySkipOption.ManualSkip
}, {
name: "exclusive_access" as Category,
option: CategorySkipOption.ShowOverlay
}, {
name: "chapter" as Category,
option: CategorySkipOption.ShowOverlay
}],
payments: {
licenseKey: null,
lastCheck: 0,
lastFreeCheck: 0,
freeAccess: false,
chaptersAllowed: false
},
colorPalette: {
red: "#780303",
white: "#ffffff",
locked: "#ffc83d"
},
// Preview bar
barTypes: {
"preview-chooseACategory": {
color: "#ffffff",
opacity: "0.7"
},
"sponsor": {
color: "#00d400",
opacity: "0.7"
},
"preview-sponsor": {
color: "#007800",
opacity: "0.7"
},
"selfpromo": {
color: "#ffff00",
opacity: "0.7"
},
"preview-selfpromo": {
color: "#bfbf35",
opacity: "0.7"
},
"exclusive_access": {
color: "#008a5c",
opacity: "0.7"
},
"interaction": {
color: "#cc00ff",
opacity: "0.7"
},
"preview-interaction": {
color: "#6c0087",
opacity: "0.7"
},
"intro": {
color: "#00ffff",
opacity: "0.7"
},
"preview-intro": {
color: "#008080",
opacity: "0.7"
},
"outro": {
color: "#0202ed",
opacity: "0.7"
},
"preview-outro": {
color: "#000070",
opacity: "0.7"
},
"preview": {
color: "#008fd6",
opacity: "0.7"
},
"preview-preview": {
color: "#005799",
opacity: "0.7"
},
"music_offtopic": {
color: "#ff9900",
opacity: "0.7"
},
"preview-music_offtopic": {
color: "#a6634a",
opacity: "0.7"
},
"poi_highlight": {
color: "#ff1684",
opacity: "0.7"
},
"preview-poi_highlight": {
color: "#9b044c",
opacity: "0.7"
},
"filler": {
color: "#7300FF",
opacity: "0.9"
},
"preview-filler": {
color: "#2E0066",
opacity: "0.7"
}
}
};
const localDefaults = {
downvotedSegments: {},
navigationApiAvailable: null
};
const Config = new ConfigClass(syncDefaults, localDefaults, migrateOldSyncFormats);
export default Config;

File diff suppressed because it is too large Load Diff

3
src/document.ts Normal file
View File

@@ -0,0 +1,3 @@
import { init } from "@ajayyy/maze-utils/lib/injected/document";
init();

2
src/globals.d.ts vendored
View File

@@ -1,6 +1,6 @@
import { SBObject } from "./config";
declare global {
interface Window { SB: SBObject; }
interface Window { SB: SBObject }
// Remove this once the API becomes stable and types are shipped in @types/chrome
namespace chrome {
namespace declarativeContent {

View File

@@ -1,15 +1,15 @@
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
import Config from "./config";
import { showDonationLink } from "./utils/configUtils";
import Utils from "./utils";
const utils = new Utils();
import { waitFor } from "@ajayyy/maze-utils";
window.addEventListener('DOMContentLoaded', init);
async function init() {
utils.localizeHtmlPage();
localizeHtmlPage();
await utils.wait(() => Config.config !== null);
await waitFor(() => Config.config !== null);
if (!Config.config.darkMode) {
document.documentElement.setAttribute("data-theme", "light");

View File

@@ -1,47 +0,0 @@
import Config from "../config";
import Utils from "../utils";
const utils = new Utils();
export interface ChatConfig {
displayName: string,
composerInitialValue?: string,
customDescription?: string
}
export function openChat(config: ChatConfig): void {
const chat = document.createElement("div");
chat.classList.add("sbChatNotice");
chat.style.zIndex = "2000";
const iframe= document.createElement("iframe");
iframe.src = "https://chat.sponsor.ajay.app/#" + utils.objectToURI("", config, false);
chat.appendChild(iframe);
const closeButton = document.createElement("img");
closeButton.classList.add("sbChatClose");
closeButton.src = chrome.runtime.getURL("icons/close.png");
closeButton.addEventListener("click", () => {
chat.remove();
closeButton.remove();
});
chat.appendChild(closeButton);
const referenceNode = utils.findReferenceNode();
referenceNode.prepend(chat);
}
export async function openWarningChat(warningMessage: string): Promise<void> {
const warningReasonMatch = warningMessage.match(/Warning reason: '(.+)'/);
alert(chrome.i18n.getMessage("warningChatInfo") + `\n\n${warningReasonMatch ? ` Warning reason: ${warningReasonMatch[1]}` : ``}`);
const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : "";
const publicUserID = await utils.getHash(Config.config.userID);
openChat({
displayName: `${userName ? userName : ``}${userName !== publicUserID ? ` | ${publicUserID}` : ``}`,
composerInitialValue: `I got a warning and confirm I [REMOVE THIS CAPITAL TEXT TO CONFIRM] reread the guidelines.` +
warningReasonMatch ? ` Warning reason: ${warningReasonMatch[1]}` : ``,
customDescription: chrome.i18n.getMessage("warningChatInfo")
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,8 @@
import Config from "../config";
import { SponsorTime } from "../types";
import { getSkippingText } from "../utils/categoryUtils";
import { keybindToString } from "../utils/configUtils";
import Utils from "../utils";
import { AnimationUtils } from "../utils/animationUtils";
const utils = new Utils();
import { keybindToString } from "@ajayyy/maze-utils/lib/config";
export interface SkipButtonControlBarProps {
skip: (segment: SponsorTime) => void;
@@ -53,7 +50,7 @@ export class SkipButtonControlBar {
this.skipIcon.id = "sbSkipIconControlBarImage";
this.textContainer = document.createElement("div");
this.container.appendChild(this.skipIcon);
this.container.appendChild(this.textContainer);
this.container.addEventListener("click", () => this.toggleSkip());
@@ -73,7 +70,7 @@ export class SkipButtonControlBar {
attachToPage(): void {
const mountingContainer = this.getMountingContainer();
this.chapterText = document.querySelector(".ytp-chapter-container");
if (mountingContainer && !mountingContainer.contains(this.container)) {
if (this.onMobileYouTube) {
mountingContainer.appendChild(this.container);
@@ -105,6 +102,7 @@ export class SkipButtonControlBar {
this.enabled = true;
this.refreshText();
this.container?.classList?.remove("textDisabled");
this.textContainer?.classList?.remove("hidden");
AnimationUtils.disableAutoHideAnimation(this.skipIcon);
@@ -137,7 +135,6 @@ export class SkipButtonControlBar {
disable(): void {
this.container.classList.add("hidden");
this.textContainer?.classList?.remove("hidden");
this.chapterText?.classList?.remove("hidden");
this.getChapterPrefix()?.classList?.remove("hidden");
@@ -145,13 +142,17 @@ export class SkipButtonControlBar {
this.enabled = false;
}
isEnabled(): boolean {
return this.enabled;
}
toggleSkip(): void {
this.skip(this.segment);
this.disableText();
}
disableText(): void {
if (Config.config.hideVideoPlayerControls || Config.config.hideSkipButtonPlayerControls) {
if (Config.config.hideSkipButtonPlayerControls) {
this.disable();
return;
}
@@ -172,10 +173,10 @@ export class SkipButtonControlBar {
const overlay = document.getElementById("player-control-overlay");
if (overlay && this.enabled) {
if (overlay?.classList?.contains("pointer-events-off")) {
this.hideButton();
} else {
if (overlay?.classList?.contains("fadein")) {
this.showButton();
} else {
this.hideButton();
}
}
}
@@ -220,4 +221,3 @@ export class SkipButtonControlBar {
this.container.style.left = this.left + "px";
}
}

View File

@@ -9,14 +9,15 @@ interface BaseMessage {
}
interface DefaultMessage {
message:
message:
"update"
| "sponsorStart"
| "getVideoID"
| "getChannelID"
| "isChannelWhitelisted"
| "submitTimes"
| "refreshSegments";
| "refreshSegments"
| "closePopup";
}
interface BoolValueMessage {
@@ -29,6 +30,11 @@ interface IsInfoFoundMessage {
updating: boolean;
}
interface SkipMessage {
message: "unskip" | "reskip";
UUID: SegmentUUID;
}
interface SubmitVoteMessage {
message: "submitVote";
type: number;
@@ -41,11 +47,35 @@ interface HideSegmentMessage {
UUID: SegmentUUID;
}
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage | IsInfoFoundMessage | SubmitVoteMessage | HideSegmentMessage);
interface CopyToClipboardMessage {
message: "copyToClipboard";
text: string;
}
interface ImportSegmentsMessage {
message: "importSegments";
data: string;
}
interface KeyDownMessage {
message: "keydown";
key: string;
keyCode: number;
code: string;
which: number;
shiftKey: boolean;
ctrlKey: boolean;
altKey: boolean;
metaKey: boolean;
}
export type Message = BaseMessage & (DefaultMessage | BoolValueMessage | IsInfoFoundMessage | SkipMessage | SubmitVoteMessage | HideSegmentMessage | CopyToClipboardMessage | ImportSegmentsMessage | KeyDownMessage);
export interface IsInfoFoundMessageResponse {
found: boolean;
status: number;
sponsorTimes: SponsorTime[];
time: number;
onMobileYouTube: boolean;
}
@@ -53,29 +83,51 @@ interface GetVideoIdResponse {
videoID: string;
}
interface GetChannelIDResponse {
export interface GetChannelIDResponse {
channelID: string;
}
interface SponsorStartResponse {
export interface SponsorStartResponse {
creatingSegment: boolean;
}
interface IsChannelWhitelistedResponse {
export interface IsChannelWhitelistedResponse {
value: boolean;
}
export type MessageResponse =
export type MessageResponse =
IsInfoFoundMessageResponse
| GetVideoIdResponse
| GetChannelIDResponse
| SponsorStartResponse
| IsChannelWhitelistedResponse
| Record<string, never>
| VoteResponse;
| Record<string, never> // empty object response {}
| VoteResponse
| ImportSegmentsResponse;
export interface VoteResponse {
successType: number;
statusCode: number;
responseText: string;
}
}
interface ImportSegmentsResponse {
importedSegments: SponsorTime[];
}
export interface TimeUpdateMessage {
message: "time";
time: number;
}
export type InfoUpdatedMessage = IsInfoFoundMessageResponse & {
message: "infoUpdated";
}
export interface VideoChangedPopupMessage {
message: "videoChanged";
videoID: string;
whitelisted: boolean;
}
export type PopupMessage = TimeUpdateMessage | InfoUpdatedMessage | VideoChangedPopupMessage;

View File

@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import { createRoot } from 'react-dom/client';
import Config from "./config";
import * as CompileConfig from "../config.json";
@@ -10,15 +10,23 @@ window.SB = Config;
import Utils from "./utils";
import CategoryChooser from "./render/CategoryChooser";
import KeybindComponent from "./components/KeybindComponent";
import UnsubmittedVideos from "./render/UnsubmittedVideos";
import KeybindComponent from "./components/options/KeybindComponent";
import { showDonationLink } from "./utils/configUtils";
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
import { StorageChangesObject } from "@ajayyy/maze-utils/lib/config";
import { getHash } from "@ajayyy/maze-utils/lib/hash";
import { isFirefoxOrSafari } from "@ajayyy/maze-utils";
const utils = new Utils();
let embed = false;
const categoryChoosers: CategoryChooser[] = [];
const unsubmittedVideos: UnsubmittedVideos[] = [];
window.addEventListener('DOMContentLoaded', init);
async function init() {
utils.localizeHtmlPage();
localizeHtmlPage();
// selected tab
if (location.hash != "") {
@@ -102,7 +110,7 @@ async function init() {
// Add click listener
checkbox.addEventListener("click", async () => {
// Confirm if required
if (confirmMessage && ((confirmOnTrue && checkbox.checked) || (!confirmOnTrue && !checkbox.checked))
if (confirmMessage && ((confirmOnTrue && checkbox.checked) || (!confirmOnTrue && !checkbox.checked))
&& !confirm(chrome.i18n.getMessage(confirmMessage))){
checkbox.checked = !checkbox.checked;
return;
@@ -119,7 +127,7 @@ async function init() {
if (!checkbox.checked) {
// Enable the notice
Config.config["dontShowNotice"] = false;
const showNoticeSwitch = <HTMLInputElement> document.querySelector("[data-sync='dontShowNotice'] > div > label > input");
showNoticeSwitch.checked = true;
}
@@ -161,7 +169,7 @@ async function init() {
}
case "text-change": {
const textChangeInput = <HTMLInputElement> optionsElements[i].querySelector(".option-text-box");
const textChangeSetButton = <HTMLElement> optionsElements[i].querySelector(".text-change-set");
textChangeInput.value = Config.config[option];
@@ -179,7 +187,7 @@ async function init() {
}
// Permission needed on Firefox
if (utils.isFirefox()) {
if (isFirefoxOrSafari()) {
const permissionSuccess = await new Promise((resolve) => {
chrome.permissions.request({
origins: [textChangeInput.value + "/"],
@@ -232,17 +240,28 @@ async function init() {
}
case "button-press": {
const actionButton = optionsElements[i].querySelector(".trigger-button");
const confirmMessage = optionsElements[i].getAttribute("data-confirm-message");
switch(optionsElements[i].getAttribute("data-sync")) {
case "copyDebugInformation":
actionButton.addEventListener("click", copyDebugOutputToClipboard);
break;
}
actionButton.addEventListener("click", () => {
if (confirmMessage !== null && !confirm(chrome.i18n.getMessage(confirmMessage))) {
return;
}
switch (optionsElements[i].getAttribute("data-sync")) {
case "copyDebugInformation":
copyDebugOutputToClipboard();
break;
case "resetToDefault":
Config.resetToDefault();
window.location.reload();
break;
}
});
break;
}
case "keybind-change": {
ReactDOM.render(React.createElement(KeybindComponent, {option: option}), optionsElements[i].querySelector("div"));
const root = createRoot(optionsElements[i].querySelector("div"));
root.render(React.createElement(KeybindComponent, {option: option}));
break;
}
case "display": {
@@ -279,7 +298,10 @@ async function init() {
break;
}
case "react-CategoryChooserComponent":
new CategoryChooser(optionsElements[i]);
categoryChoosers.push(new CategoryChooser(optionsElements[i]));
break;
case "react-UnsubmittedVideosComponent":
unsubmittedVideos.push(new UnsubmittedVideos(optionsElements[i]));
break;
}
}
@@ -327,8 +349,8 @@ function createStickyHeader() {
/**
* Handle special cases where an option shouldn't show
*
* @param {String} element
*
* @param {String} element
*/
async function shouldHideOption(element: Element): Promise<boolean> {
return (element.getAttribute("data-private-only") === "true" && !(await isIncognitoAllowed()))
@@ -337,10 +359,8 @@ async function shouldHideOption(element: Element): Promise<boolean> {
/**
* Called when the config is updated
*
* @param {String} element
*/
function optionsConfigUpdateListener() {
function optionsConfigUpdateListener(changes: StorageChangesObject) {
const optionsContainer = document.getElementById("options");
const optionsElements = optionsContainer.querySelectorAll("*");
@@ -348,14 +368,25 @@ function optionsConfigUpdateListener() {
switch (optionsElements[i].getAttribute("data-type")) {
case "display":
updateDisplayElement(<HTMLElement> optionsElements[i])
break;
}
}
if (changes.categorySelections || changes.payments) {
for (const chooser of categoryChoosers) {
chooser.update();
}
} else if (changes.unsubmittedSegments) {
for (const chooser of unsubmittedVideos) {
chooser.update();
}
}
}
/**
* Will set display elements to the proper text
*
* @param element
*
* @param element
*/
function updateDisplayElement(element: HTMLElement) {
const displayOption = element.getAttribute("data-sync")
@@ -382,9 +413,9 @@ function updateDisplayElement(element: HTMLElement) {
/**
* Initializes the option to add Invidious instances
*
* @param element
* @param option
*
* @param element
* @param option
*/
function invidiousInstanceAddInit(element: HTMLElement, option: string) {
const textBox = <HTMLInputElement> element.querySelector(".option-text-box");
@@ -401,7 +432,7 @@ function invidiousInstanceAddInit(element: HTMLElement, option: string) {
let instanceList = Config.config[option];
if (!instanceList) instanceList = [];
instanceList.push(textBox.value);
instanceList.push(textBox.value.trim().toLowerCase());
Config.config[option] = instanceList;
@@ -436,18 +467,12 @@ function invidiousInstanceAddInit(element: HTMLElement, option: string) {
/**
* Run when the invidious button is being initialized
*
* @param checkbox
* @param option
*
* @param checkbox
* @param option
*/
function invidiousInit(checkbox: HTMLInputElement, option: string) {
let permissions = ["declarativeContent"];
if (utils.isFirefox()) permissions = [];
chrome.permissions.contains({
origins: utils.getPermissionRegex(),
permissions: permissions
}, function (result) {
utils.containsInvidiousPermission().then((result) => {
if (result != checkbox.checked) {
Config.config[option] = result;
@@ -458,33 +483,19 @@ function invidiousInit(checkbox: HTMLInputElement, option: string) {
/**
* Run whenever the invidious checkbox is clicked
*
* @param checkbox
* @param option
*
* @param checkbox
* @param option
*/
async function invidiousOnClick(checkbox: HTMLInputElement, option: string): Promise<void> {
return new Promise((resolve) => {
if (checkbox.checked) {
utils.setupExtraSitePermissions(function (granted) {
if (!granted) {
Config.config[option] = false;
checkbox.checked = false;
} else {
checkbox.checked = true;
}
resolve();
});
} else {
utils.removeExtraSiteRegistration();
}
});
const enabled = await utils.applyInvidiousPermissions(checkbox.checked, option);
checkbox.checked = enabled;
}
/**
* Will trigger the textbox to appear to be able to change an option's text.
*
* @param element
*
* @param element
*/
function activatePrivateTextChange(element: HTMLElement) {
const button = element.querySelector(".trigger-button");
@@ -501,7 +512,7 @@ function activatePrivateTextChange(element: HTMLElement) {
element.querySelector(".option-hidden-section").classList.remove("hidden");
return;
}
let result = Config.config[option];
// See if anything extra must be done
switch (option) {
@@ -512,7 +523,7 @@ function activatePrivateTextChange(element: HTMLElement) {
}
textBox.value = result;
const setButton = element.querySelector(".text-change-set");
setButton.addEventListener("click", async () => {
setTextOption(option, element, textBox.value);
@@ -523,7 +534,7 @@ function activatePrivateTextChange(element: HTMLElement) {
case "userID":
if (Config.config[option]) {
utils.asyncRequestToServer("GET", "/api/userInfo", {
userID: Config.config[option],
publicUserID: getHash(Config.config[option]),
values: ["warnings", "banned"]
}).then((result) => {
const userInfo = JSON.parse(result.responseText);
@@ -541,7 +552,7 @@ function activatePrivateTextChange(element: HTMLElement) {
/**
* Function to run when a textbox change is submitted
*
*
* @param option data-sync value
* @param element main container div
* @param value new text
@@ -551,7 +562,7 @@ async function setTextOption(option: string, element: HTMLElement, value: string
const confirmMessage = element.getAttribute("data-confirm-message");
if (confirmMessage === null || confirm(chrome.i18n.getMessage(confirmMessage))) {
// See if anything extra must be done
switch (option) {
case "*":
@@ -563,13 +574,13 @@ async function setTextOption(option: string, element: HTMLElement, value: string
if (newConfig.supportInvidious) {
const checkbox = <HTMLInputElement> document.querySelector("#support-invidious > div > label > input");
checkbox.checked = true;
await invidiousOnClick(checkbox, "supportInvidious");
}
window.location.reload();
} catch (e) {
alert(chrome.i18n.getMessage("incorrectlyFormattedOptions"));
}
@@ -587,8 +598,9 @@ async function setTextOption(option: string, element: HTMLElement, value: string
function downloadConfig() {
const file = document.createElement("a");
const jsonData = JSON.parse(JSON.stringify(Config.cachedSyncConfig));
file.setAttribute("href", "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(jsonData)));
file.setAttribute("download", "SponsorBlockConfig.json");
const dateTimeString = new Date().toJSON().replace("T", "_").replace(/:/g, ".").replace(/.\d+Z/g, "")
file.setAttribute("href", `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(jsonData))}`);
file.setAttribute("download", `SponsorBlockConfig_${dateTimeString}.json`);
document.body.append(file);
file.click();
file.remove();
@@ -611,7 +623,7 @@ function uploadConfig(e) {
/**
* Validates the value used for the database server address.
* Returns null and alerts the user if there is an issue.
*
*
* @param input Input server address
*/
function validateServerAddress(input: string): string {
@@ -645,7 +657,7 @@ function copyDebugOutputToClipboard() {
// Sanitise sensitive user config values
delete output.config.userID;
output.config.serverAddress = (output.config.serverAddress === CompileConfig.serverAddress)
output.config.serverAddress = (output.config.serverAddress === CompileConfig.serverAddress)
? "Default server address" : "Custom server address";
output.config.invidiousInstances = output.config.invidiousInstances.length;
output.config.whitelistedChannels = output.config.whitelistedChannels.length;
@@ -662,4 +674,4 @@ function copyDebugOutputToClipboard() {
function isIncognitoAllowed(): Promise<boolean> {
return new Promise((resolve) => chrome.extension.isAllowedIncognitoAccess(resolve));
}
}

View File

@@ -1,5 +1,6 @@
import Config from "./config";
import Utils from "./utils";
import { localizeHtmlPage } from "@ajayyy/maze-utils/lib/setup";
const utils = new Utils();
// This is needed, if Config is not imported before Utils, things break.
@@ -9,27 +10,19 @@ Config.config;
window.addEventListener('DOMContentLoaded', init);
async function init() {
utils.localizeHtmlPage();
const domains = document.location.hash.replace("#", "").split(",");
localizeHtmlPage();
const acceptButton = document.getElementById("acceptPermissionButton");
acceptButton.addEventListener("click", () => {
chrome.permissions.request({
origins: utils.getPermissionRegex(domains),
permissions: []
}, (granted) => {
if (granted) {
utils.applyInvidiousPermissions(Config.config.supportInvidious).then((enabled) => {
Config.config.supportInvidious = enabled;
if (enabled) {
alert(chrome.i18n.getMessage("permissionRequestSuccess"));
Config.config.ytInfoPermissionGranted = true;
chrome.tabs.getCurrent((tab) => {
chrome.tabs.remove(tab.id);
});
window.close();
} else {
alert(chrome.i18n.getMessage("permissionRequestFailed"));
}
});
})
});
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,24 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import CategoryChooserComponent from "../components/CategoryChooserComponent";
import { createRoot } from 'react-dom/client';
import CategoryChooserComponent from "../components/options/CategoryChooserComponent";
class CategoryChooser {
ref: React.RefObject<CategoryChooserComponent>;
constructor(element: Element) {
ReactDOM.render(
<CategoryChooserComponent/>,
element
this.ref = React.createRef();
const root = createRoot(element);
root.render(
<CategoryChooserComponent ref={this.ref} />
);
}
update(): void {
this.ref.current?.forceUpdate();
}
}
export default CategoryChooser;

View File

@@ -1,19 +1,26 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import { createRoot, Root } from "react-dom/client";
import CategoryPillComponent, { CategoryPillState } from "../components/CategoryPillComponent";
import Config from "../config";
import { VoteResponse } from "../messageTypes";
import { Category, SegmentUUID, SponsorTime } from "../types";
import { GenericUtils } from "../utils/genericUtils";
import { Tooltip } from "./Tooltip";
import { waitFor } from "@ajayyy/maze-utils";
import { getYouTubeTitleNode } from "@ajayyy/maze-utils/lib/elements";
const id = "categoryPill";
export class CategoryPill {
container: HTMLElement;
ref: React.RefObject<CategoryPillComponent>;
root: Root;
unsavedState: CategoryPillState;
lastState: CategoryPillState;
mutationObserver?: MutationObserver;
onMobileYouTube: boolean;
onInvidious: boolean;
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>;
constructor() {
this.ref = React.createRef();
@@ -21,50 +28,63 @@ export class CategoryPill {
async attachToPage(onMobileYouTube: boolean, onInvidious: boolean,
vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>): Promise<void> {
this.onMobileYouTube = onMobileYouTube;
this.onInvidious = onInvidious;
this.vote = vote;
this.attachToPageInternal();
}
private async attachToPageInternal(): Promise<void> {
const referenceNode =
await GenericUtils.wait(() =>
// New YouTube Title, YouTube, Mobile YouTube, Invidious
document.querySelector("#title h1, .ytd-video-primary-info-renderer.title, .slim-video-information-title, #player-container + .h-box > h1") as HTMLElement);
await waitFor(() => getYouTubeTitleNode());
if (referenceNode && !referenceNode.contains(this.container)) {
this.container = document.createElement('span');
this.container.id = "categoryPill";
this.container.style.display = "relative";
if (!this.container) {
this.container = document.createElement('span');
this.container.id = id;
this.container.style.display = "relative";
referenceNode.prepend(this.container);
referenceNode.style.display = "flex";
this.root = createRoot(this.container);
this.ref = React.createRef();
this.root.render(<CategoryPillComponent ref={this.ref} vote={this.vote} />);
if (this.ref.current) {
this.unsavedState = this.ref.current.state;
}
ReactDOM.render(
<CategoryPillComponent ref={this.ref} vote={vote} />,
this.container
);
if (this.unsavedState) {
this.ref.current?.setState(this.unsavedState);
this.unsavedState = null;
}
if (onMobileYouTube) {
if (this.mutationObserver) {
this.mutationObserver.disconnect();
if (this.onMobileYouTube) {
if (this.mutationObserver) {
this.mutationObserver.disconnect();
}
this.mutationObserver = new MutationObserver((changes) => {
if (changes.some((change) => change.removedNodes.length > 0)) {
this.attachToPageInternal();
}
});
this.mutationObserver.observe(referenceNode, {
childList: true,
subtree: true
});
}
this.mutationObserver = new MutationObserver(() => this.attachToPage(onMobileYouTube, onInvidious, vote));
}
this.mutationObserver.observe(referenceNode, {
childList: true,
subtree: true
if (this.lastState) {
waitFor(() => this.ref.current).then(() => {
this.ref.current?.setState(this.lastState);
});
}
// Use a parent because YouTube does weird things to the top level object
// react would have to rerender if container was the top level
const parent = document.createElement("span");
parent.appendChild(this.container);
referenceNode.prepend(parent);
referenceNode.style.display = "flex";
}
}
close(): void {
ReactDOM.unmountComponentAtNode(this.container);
this.root.unmount();
this.container.remove();
}
@@ -74,11 +94,8 @@ export class CategoryPill {
open: show ? this.ref.current?.state.open : false
};
if (this.ref.current) {
this.ref.current?.setState(newState);
} else {
this.unsavedState = newState;
}
this.ref.current?.setState(newState);
this.lastState = newState;
}
async setSegment(segment: SponsorTime): Promise<void> {
@@ -89,16 +106,13 @@ export class CategoryPill {
open: false
};
if (this.ref.current) {
this.ref.current?.setState(newState);
} else {
this.unsavedState = newState;
}
this.ref.current?.setState(newState);
this.lastState = newState;
if (!Config.config.categoryPillUpdate) {
Config.config.categoryPillUpdate = true;
const watchDiv = await GenericUtils.wait(() => document.querySelector("#info.ytd-watch-flexy") as HTMLElement);
const watchDiv = await waitFor(() => document.querySelector("#info.ytd-watch-flexy") as HTMLElement);
if (watchDiv) {
new Tooltip({
text: chrome.i18n.getMessage("categoryPillNewFeature"),
@@ -112,5 +126,9 @@ export class CategoryPill {
}
}
}
if (this.onMobileYouTube && !document.contains(this.container)) {
this.attachToPageInternal();
}
}
}

View File

@@ -0,0 +1,63 @@
import * as React from "react";
import { createRoot, Root } from 'react-dom/client';
import ChapterVoteComponent, { ChapterVoteState } from "../components/ChapterVoteComponent";
import { VoteResponse } from "../messageTypes";
import { Category, SegmentUUID, SponsorTime } from "../types";
export class ChapterVote {
container: HTMLElement;
ref: React.RefObject<ChapterVoteComponent>;
root: Root;
unsavedState: ChapterVoteState;
mutationObserver?: MutationObserver;
constructor(vote: (type: number, UUID: SegmentUUID, category?: Category) => Promise<VoteResponse>) {
this.ref = React.createRef();
this.container = document.createElement('span');
this.container.id = "chapterVote";
this.container.style.height = "100%";
this.root = createRoot(this.container);
this.root.render(<ChapterVoteComponent ref={this.ref} vote={vote} />);
}
getContainer(): HTMLElement {
return this.container;
}
close(): void {
this.root.unmount();
this.container.remove();
}
setVisibility(show: boolean): void {
const newState = {
show,
...(!show ? { segment: null } : {})
};
if (this.ref.current) {
this.ref.current?.setState(newState);
} else {
this.unsavedState = newState;
}
}
async setSegment(segment: SponsorTime): Promise<void> {
if (this.ref.current?.state?.segment !== segment) {
const newState = {
segment,
show: true
};
if (this.ref.current) {
this.ref.current?.setState(newState);
} else {
this.unsavedState = newState;
}
}
}
}

View File

@@ -1,24 +1,31 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import { createRoot, Root } from 'react-dom/client';
import NoticeComponent from "../components/NoticeComponent";
import Utils from "../utils";
const utils = new Utils();
import { ContentContainer } from "../types";
import { ButtonListener, ContentContainer } from "../types";
import NoticeTextSelectionComponent from "../components/NoticeTextSectionComponent";
export interface ButtonListener {
name: string,
listener: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
export interface TextBox {
icon: string;
text: string;
}
export interface NoticeOptions {
title: string,
textBoxes?: string[],
buttons?: ButtonListener[],
fadeIn?: boolean,
timed?: boolean
title: string;
referenceNode?: HTMLElement;
textBoxes?: TextBox[];
buttons?: ButtonListener[];
fadeIn?: boolean;
timed?: boolean;
style?: React.CSSProperties;
extraClass?: string;
maxCountdownTime?: () => number;
dontPauseCountdown?: boolean;
hideLogo?: boolean;
hideRightInfo?: boolean;
}
export default class GenericNotice {
@@ -27,52 +34,80 @@ export default class GenericNotice {
noticeElement: HTMLDivElement;
noticeRef: React.MutableRefObject<NoticeComponent>;
idSuffix: string;
root: Root;
constructor(contentContainer: ContentContainer, idSuffix: string, options: NoticeOptions) {
this.noticeRef = React.createRef();
this.idSuffix = idSuffix;
this.contentContainer = contentContainer;
const referenceNode = utils.findReferenceNode();
const referenceNode = options.referenceNode ?? utils.findReferenceNode();
this.noticeElement = document.createElement("div");
this.noticeElement.id = "sponsorSkipNoticeContainer" + idSuffix;
referenceNode.prepend(this.noticeElement);
ReactDOM.render(
this.root = createRoot(this.noticeElement);
this.update(options);
}
update(options: NoticeOptions): void {
this.root.render(
<NoticeComponent
noticeTitle={options.title}
idSuffix={idSuffix}
idSuffix={this.idSuffix}
fadeIn={options.fadeIn ?? true}
timed={options.timed ?? true}
ref={this.noticeRef}
style={options.style}
extraClass={options.extraClass}
maxCountdownTime={options.maxCountdownTime}
dontPauseCountdown={options.dontPauseCountdown}
hideLogo={options.hideLogo}
hideRightInfo={options.hideRightInfo}
closeListener={() => this.close()} >
{this.getMessageBox(idSuffix, options.textBoxes)}
{options.textBoxes?.length > 0 ?
<tr id={"sponsorSkipNoticeMiddleRow" + this.idSuffix}
className="sponsorTimeMessagesRow"
style={{maxHeight: this.contentContainer ? (this.contentContainer().v.offsetHeight - 200) + "px" : null}}>
<td style={{width: "100%"}}>
{this.getMessageBoxes(this.idSuffix, options.textBoxes)}
</td>
</tr>
: null}
<tr id={"sponsorSkipNoticeSpacer" + idSuffix}
className="sponsorBlockSpacer">
</tr>
{!options.hideLogo ?
<>
<tr id={"sponsorSkipNoticeSpacer" + this.idSuffix}
className="sponsorBlockSpacer">
</tr>
<div className="sponsorSkipNoticeRightSection"
style={{position: "relative"}}>
<tr className="sponsorSkipNoticeRightSection"
style={{position: "relative"}}>
<td>
{this.getButtons(options.buttons)}
</td>
</tr>
</>
: null}
{this.getButtons(options.buttons)}
</div>
</NoticeComponent>,
this.noticeElement
</NoticeComponent>
);
}
getMessageBox(idSuffix: string, textBoxes: string[]): JSX.Element[] {
getMessageBoxes(idSuffix: string, textBoxes: TextBox[]): JSX.Element[] {
if (textBoxes) {
const result = [];
for (let i = 0; i < textBoxes.length; i++) {
result.push(
<NoticeTextSelectionComponent idSuffix={idSuffix}
key={i}
text={textBoxes[i]} />
icon={textBoxes[i].icon}
text={textBoxes[i].text} />
)
}
@@ -104,7 +139,7 @@ export default class GenericNotice {
}
close(): void {
ReactDOM.unmountComponentAtNode(this.noticeElement);
this.root.unmount();
this.noticeElement.remove();
}

Some files were not shown because too many files have changed in this diff Show More