Skip to content

Commit acd9aaa

Browse files
authored
Merge branch 'ajayyy:master' into master
2 parents 152730d + a4e1861 commit acd9aaa

File tree

82 files changed

+7392
-5918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+7392
-5918
lines changed

.github/workflows/release.yml

Lines changed: 131 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ jobs:
1212

1313
steps:
1414
# Initialization
15-
- uses: actions/checkout@v4
15+
- name: Checkout release branch w/submodules
16+
uses: actions/checkout@v5
1617
with:
1718
submodules: recursive
1819
- uses: actions/setup-node@v4
@@ -34,12 +35,27 @@ jobs:
3435
path: ../builds/SourceCodeUseThisOne.zip
3536
repo-token: ${{ secrets.GITHUB_TOKEN }}
3637

38+
- name: Checkout source maps branch
39+
uses: actions/checkout@v5
40+
with:
41+
path: source-maps
42+
ref: source-maps
43+
- name: Set up committer info
44+
run: |
45+
git config --global user.name "github-actions[bot]"
46+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
3747
- run: npm ci
3848

3949
# Create Firefox artifacts
4050
- name: Create Firefox artifacts
41-
run: npm run build:firefox
51+
run: npm run build:firefox -- --env ghpSourceMaps
4252
- run: mkdir ./builds
53+
- name: Move Firefox source maps to source map repo
54+
run: |
55+
VERSION=`jq -r '.version' ./dist/manifest.json`
56+
mkdir -p "./source-maps/firefox/$VERSION/"
57+
mv -v ./dist/**/*.js.map "./source-maps/firefox/$VERSION/"
58+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/firefox/$VERSION/"
4359
- name: Zip Artifacts
4460
run: cd ./dist ; zip -r ../builds/FirefoxExtension.zip *
4561
- name: Upload FirefoxExtension to release
@@ -52,7 +68,13 @@ jobs:
5268

5369
# Create Chrome artifacts
5470
- name: Create Chrome artifacts
55-
run: npm run build:chrome
71+
run: npm run build:chrome -- --env ghpSourceMaps
72+
- name: Move Chrome source maps to source map repo
73+
run: |
74+
VERSION=`jq -r '.version' ./dist/manifest.json`
75+
mkdir -p "./source-maps/chrome/$VERSION/"
76+
mv -v ./dist/**/*.js.map "./source-maps/chrome/$VERSION/"
77+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/chrome/$VERSION/"
5678
- name: Zip Artifacts
5779
run: cd ./dist ; zip -r ../builds/ChromeExtension.zip *
5880
- name: Upload ChromeExtension to release
@@ -67,7 +89,13 @@ jobs:
6789
- name: Clear dist for Edge
6890
run: rm -rf ./dist
6991
- name: Create Edge artifacts
70-
run: npm run build:edge
92+
run: npm run build:edge -- --env ghpSourceMaps
93+
- name: Move Edge source maps to source map repo
94+
run: |
95+
VERSION=`jq -r '.version' ./dist/manifest.json`
96+
mkdir -p "./source-maps/edge/$VERSION/"
97+
mv -v ./dist/**/*.js.map "./source-maps/edge/$VERSION/"
98+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/edge/$VERSION/"
7199
- name: Zip Artifacts
72100
run: cd ./dist ; zip -r ../builds/EdgeExtension.zip *
73101
- name: Upload EdgeExtension to release
@@ -80,7 +108,13 @@ jobs:
80108

81109
# Create Safari artifacts
82110
- name: Create Safari artifacts
83-
run: npm run build:safari
111+
run: npm run build:safari -- --env ghpSourceMaps
112+
- name: Move Safari source maps to source map repo
113+
run: |
114+
VERSION=`jq -r '.version' ./dist/manifest.json`
115+
mkdir -p "./source-maps/safari/$VERSION/"
116+
mv -v ./dist/**/*.js.map "./source-maps/safari/$VERSION/"
117+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/safari/$VERSION/"
84118
- name: Zip Artifacts
85119
run: cd ./dist ; zip -r ../builds/SafariExtension.zip *
86120
- name: Upload SafariExtension to release
@@ -93,7 +127,13 @@ jobs:
93127

94128
# Create Beta artifacts (Builds with the name changed to beta)
95129
- name: Create Chrome Beta artifacts
96-
run: npm run build:chrome -- --env stream=beta
130+
run: npm run build:chrome -- --env stream=beta --env ghpSourceMaps
131+
- name: Move Chrome Beta source maps to source map repo
132+
run: |
133+
VERSION=`jq -r '.version' ./dist/manifest.json`
134+
mkdir -p "./source-maps/chrome-beta/$VERSION/"
135+
mv -v ./dist/**/*.js.map "./source-maps/chrome-beta/$VERSION/"
136+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/chrome-beta/$VERSION/"
97137
- name: Zip Artifacts
98138
run: cd ./dist ; zip -r ../builds/ChromeExtensionBeta.zip *
99139
- name: Upload ChromeExtensionBeta to release
@@ -106,11 +146,17 @@ jobs:
106146

107147
# Firefox Beta
108148
- name: Create Firefox Beta artifacts
109-
run: npm run build:firefox -- --env stream=beta
149+
run: npm run build:firefox -- --env stream=beta --env autoupdate --env ghpSourceMaps
110150
- uses: actions/upload-artifact@v4
111151
with:
112152
name: FirefoxExtensionBeta
113153
path: dist
154+
- name: Move Firefox Beta source maps to source map repo
155+
run: |
156+
VERSION=`jq -r '.version' ./dist/manifest.json`
157+
mkdir -p "./source-maps/firefox-beta/$VERSION/"
158+
mv -v ./dist/**/*.js.map "./source-maps/firefox-beta/$VERSION/"
159+
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/firefox-beta/$VERSION/"
114160
- name: Zip Artifacts
115161
run: cd ./dist ; zip -r ../builds/FirefoxExtensionBeta.zip *
116162

@@ -120,10 +166,8 @@ jobs:
120166
env:
121167
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
122168
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
123-
- name: Install rename
124-
run: sudo apt-get install rename
125169
- name: Rename signed file
126-
run: cd ./web-ext-artifacts ; rename 's/.*/FirefoxSignedInstaller.xpi/' *
170+
run: mv ./web-ext-artifacts/* ./web-ext-artifacts/FirefoxSignedInstaller.xpi
127171
- uses: actions/upload-artifact@v4
128172
with:
129173
name: FirefoxExtensionSigned.xpi
@@ -137,3 +181,80 @@ jobs:
137181
path: ./web-ext-artifacts/FirefoxSignedInstaller.xpi
138182
repo-token: ${{ secrets.GITHUB_TOKEN }}
139183

184+
- name: Commit & push new source maps
185+
if: always()
186+
run: |
187+
VERSION=`jq -r '.version' ./dist/manifest.json`
188+
cd ./source-maps
189+
git add .
190+
git commit -m "Publish source maps for version $VERSION"
191+
git push
192+
193+
- name: Prepare new github pages deployment
194+
shell: python
195+
run: |
196+
from pathlib import Path
197+
import json
198+
import shutil
199+
import os
200+
201+
# config stuff
202+
installer_name = "FirefoxSignedInstaller.xpi"
203+
owner, repo_name = os.environ["GITHUB_REPOSITORY"].split("/")
204+
owner = owner.lower()
205+
206+
# create the github paged dir
207+
ghp_dir = Path("./github-pages")
208+
ghp_dir.mkdir(parents=True, exist_ok=True)
209+
210+
# move in the installer
211+
Path("./web-ext-artifacts", installer_name).rename(ghp_dir / installer_name)
212+
213+
# read manifest.json and extract parameters
214+
with open("./dist/manifest.json") as f:
215+
manifest = json.load(f)
216+
current_version = manifest["version"]
217+
ext_id = manifest["browser_specific_settings"]["gecko"]["id"]
218+
219+
# generate updates file
220+
updates = {
221+
"addons": {
222+
ext_id: {
223+
"updates": [
224+
{
225+
"version": current_version,
226+
# param doesn't actually matter, it's just a cachebuster
227+
"update_link": f"https://{owner}.github.io/{repo_name}/{installer_name}?v={current_version}",
228+
},
229+
],
230+
},
231+
},
232+
}
233+
(ghp_dir / "updates.json").write_text(json.dumps(updates))
234+
235+
# copy in source maps
236+
def only_sourcemaps(cur, ls):
237+
if '/' in cur:
238+
return []
239+
return set(ls) - {"chrome", "chrome-beta", "edge", "firefox", "firefox-beta", "safari"}
240+
shutil.copytree("source-maps", ghp_dir, ignore=only_sourcemaps, dirs_exist_ok=True)
241+
242+
- name: Upload new github pages deployment
243+
uses: actions/upload-pages-artifact@v3
244+
with:
245+
path: ./github-pages
246+
247+
deploy-ghp:
248+
name: Deploy to github pages
249+
needs: build
250+
permissions:
251+
id-token: write
252+
pages: write
253+
environment:
254+
name: github-pages
255+
url: ${{ steps.deployment.outputs.page_url }}
256+
runs-on: ubuntu-latest
257+
steps:
258+
- name: Deploy
259+
id: deployment
260+
uses: actions/deploy-pages@v4

.github/workflows/tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ jobs:
1616
with:
1717
node-version: '18'
1818
- run: npm ci
19-
- run: sudo apt-get install chromium-chromedriver
2019

2120
- name: Copy configuration
2221
run: cp config.json.example config.json
22+
23+
- name: Set up WireGuard Connection
24+
uses: niklaskeerl/easy-wireguard-action@50341d5f4b8245ff3a90e278aca67b2d283c78d0
25+
with:
26+
WG_CONFIG_FILE: ${{ secrets.WG_CONFIG_FILE }}
27+
2328
- name: Run tests
2429
run: npm run test
2530

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ https://crowdin.com/project/sponsorblock
55

66
# Building
77
## Building locally
8-
0. You must have [Node.js 16 or later](https://nodejs.org/) and npm installed. Works best on Linux
8+
0. You must have [Node.js 22 or later](https://nodejs.org/) and npm installed. Works best on Linux
99
1. Clone with submodules
1010
```bash
1111
git clone --recursive https://github.com/ajayyy/SponsorBlock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md)
6363

6464
# Credit
6565

66-
The awesome [Invidious API](https://docs.invidious.io/) was previously used, and the server is now using [NewLeaf](https://git.sr.ht/~cadence/NewLeaf) as a to get video info from YouTube.
66+
The awesome [Invidious API](https://docs.invidious.io/) was previously used, and the server is now using [NewLeaf](https://git.sr.ht/~cadence/NewLeaf) to get video info from YouTube.
6767

6868
Originally forked from [YTSponsorSkip](https://github.com/NDevTK/YTSponsorSkip), but very little code remains.
6969

config.json.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"serverAddress": "https://sponsor.ajay.app",
33
"testingServerAddress": "https://sponsor.ajay.app/test",
44
"serverAddressComment": "This specifies the default SponsorBlock server to connect to",
5-
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "filler", "chapter", "music_offtopic"],
5+
"categoryList": ["sponsor", "selfpromo", "exclusive_access", "interaction", "poi_highlight", "intro", "outro", "preview", "hook", "filler", "chapter", "music_offtopic"],
66
"categorySupport": {
77
"sponsor": ["skip", "mute", "full"],
88
"selfpromo": ["skip", "mute", "full"],
@@ -11,6 +11,7 @@
1111
"intro": ["skip", "mute"],
1212
"outro": ["skip", "mute"],
1313
"preview": ["skip", "mute"],
14+
"hook": ["skip", "mute"],
1415
"filler": ["skip", "mute"],
1516
"music_offtopic": ["skip"],
1617
"poi_highlight": ["poi"],
@@ -24,6 +25,7 @@
2425
"intro": "https://wiki.sponsor.ajay.app/w/Intermission/Intro_Animation",
2526
"outro": "https://wiki.sponsor.ajay.app/w/Endcards/Credits",
2627
"preview": "https://wiki.sponsor.ajay.app/w/Preview/Recap",
28+
"hook": "https://wiki.sponsor.ajay.app/w/Hook/Greetings",
2729
"filler": "https://wiki.sponsor.ajay.app/w/Tangents/Jokes",
2830
"music_offtopic": "https://wiki.sponsor.ajay.app/w/Music:_Non-Music_Section",
2931
"poi_highlight": "https://wiki.sponsor.ajay.app/w/Highlight",

manifest/chrome-manifest-extra.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
"icons/PlayerInfoIconSponsorBlocker.svg",
5454
"icons/PlayerDeleteIconSponsorBlocker.svg",
5555
"icons/dearrow.svg",
56+
"icons/sb-pride.png",
57+
"icons/pride.svg",
5658
"popup.html",
5759
"popup.css",
5860
"content.css",

manifest/manifest-v2-extra.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"icons/PlayerInfoIconSponsorBlocker.svg",
4646
"icons/PlayerDeleteIconSponsorBlocker.svg",
4747
"icons/dearrow.svg",
48+
"icons/sb-pride.png",
49+
"icons/pride.svg",
4850
"popup.html",
4951
"popup.css",
5052
"content.css",

manifest/manifest.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "__MSG_fullName__",
33
"short_name": "SponsorBlock",
4-
"version": "5.11.11",
4+
"version": "6.1.2",
55
"default_locale": "en",
66
"description": "__MSG_Description__",
77
"homepage_url": "https://sponsor.ajay.app",
@@ -16,7 +16,8 @@
1616
},
1717
"permissions": [
1818
"storage",
19-
"scripting"
19+
"scripting",
20+
"unlimitedStorage"
2021
],
2122
"options_ui": {
2223
"page": "options/options.html",

manifest/safari-manifest-extra.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@
1212
"64": "icons/SafariIconSponsorBlocker64px.png",
1313
"128": "icons/SafariIconSponsorBlocker128px.png"
1414
}
15+
},
16+
"browser_specific_settings": {
17+
"safari": {
18+
"strict_min_version": "14.0"
19+
}
1520
}
1621
}

0 commit comments

Comments
 (0)