Merge branch 'master' into not-operator

This commit is contained in:
mschae23
2025-10-02 16:43:46 +02:00
12 changed files with 293 additions and 115 deletions

View File

@@ -12,7 +12,8 @@ jobs:
steps:
# Initialization
- uses: actions/checkout@v4
- name: Checkout release branch w/submodules
uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/setup-node@v4
@@ -34,12 +35,27 @@ jobs:
path: ../builds/SourceCodeUseThisOne.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout source maps branch
uses: actions/checkout@v5
with:
path: source-maps
ref: source-maps
- name: Set up committer info
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- run: npm ci
# Create Firefox artifacts
- name: Create Firefox artifacts
run: npm run build:firefox
run: npm run build:firefox -- --env ghpSourceMaps
- run: mkdir ./builds
- name: Move Firefox source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/firefox/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/firefox/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/firefox/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/FirefoxExtension.zip *
- name: Upload FirefoxExtension to release
@@ -52,7 +68,13 @@ jobs:
# Create Chrome artifacts
- name: Create Chrome artifacts
run: npm run build:chrome
run: npm run build:chrome -- --env ghpSourceMaps
- name: Move Chrome source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/chrome/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/chrome/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/chrome/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/ChromeExtension.zip *
- name: Upload ChromeExtension to release
@@ -67,7 +89,13 @@ jobs:
- name: Clear dist for Edge
run: rm -rf ./dist
- name: Create Edge artifacts
run: npm run build:edge
run: npm run build:edge -- --env ghpSourceMaps
- name: Move Edge source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/edge/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/edge/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/edge/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/EdgeExtension.zip *
- name: Upload EdgeExtension to release
@@ -80,7 +108,13 @@ jobs:
# Create Safari artifacts
- name: Create Safari artifacts
run: npm run build:safari
run: npm run build:safari -- --env ghpSourceMaps
- name: Move Safari source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/safari/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/safari/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/safari/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/SafariExtension.zip *
- name: Upload SafariExtension to release
@@ -93,7 +127,13 @@ jobs:
# Create Beta artifacts (Builds with the name changed to beta)
- name: Create Chrome Beta artifacts
run: npm run build:chrome -- --env stream=beta
run: npm run build:chrome -- --env stream=beta --env ghpSourceMaps
- name: Move Chrome Beta source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/chrome-beta/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/chrome-beta/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/chrome-beta/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/ChromeExtensionBeta.zip *
- name: Upload ChromeExtensionBeta to release
@@ -106,11 +146,17 @@ jobs:
# Firefox Beta
- name: Create Firefox Beta artifacts
run: npm run build:firefox -- --env stream=beta
run: npm run build:firefox -- --env stream=beta --env autoupdate --env ghpSourceMaps
- uses: actions/upload-artifact@v4
with:
name: FirefoxExtensionBeta
path: dist
- name: Move Firefox Beta source maps to source map repo
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
mkdir -p "./source-maps/firefox-beta/$VERSION/"
mv -v ./dist/**/*.js.map "./source-maps/firefox-beta/$VERSION/"
cp -v ./dist/**/*.js.LICENSE.txt "./source-maps/firefox-beta/$VERSION/"
- name: Zip Artifacts
run: cd ./dist ; zip -r ../builds/FirefoxExtensionBeta.zip *
@@ -120,10 +166,8 @@ jobs:
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
- name: Install rename
run: sudo apt-get install rename
- name: Rename signed file
run: cd ./web-ext-artifacts ; rename 's/.*/FirefoxSignedInstaller.xpi/' *
run: mv ./web-ext-artifacts/* ./web-ext-artifacts/FirefoxSignedInstaller.xpi
- uses: actions/upload-artifact@v4
with:
name: FirefoxExtensionSigned.xpi
@@ -137,3 +181,80 @@ jobs:
path: ./web-ext-artifacts/FirefoxSignedInstaller.xpi
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit & push new source maps
if: always()
run: |
VERSION=`jq -r '.version' ./dist/manifest.json`
cd ./source-maps
git add .
git commit -m "Publish source maps for version $VERSION"
git push
- name: Prepare new github pages deployment
shell: python
run: |
from pathlib import Path
import json
import shutil
import os
# config stuff
installer_name = "FirefoxSignedInstaller.xpi"
owner, repo_name = os.environ["GITHUB_REPOSITORY"].split("/")
owner = owner.lower()
# create the github paged dir
ghp_dir = Path("./github-pages")
ghp_dir.mkdir(parents=True, exist_ok=True)
# move in the installer
Path("./web-ext-artifacts", installer_name).rename(ghp_dir / installer_name)
# read manifest.json and extract parameters
with open("./dist/manifest.json") as f:
manifest = json.load(f)
current_version = manifest["version"]
ext_id = manifest["browser_specific_settings"]["gecko"]["id"]
# generate updates file
updates = {
"addons": {
ext_id: {
"updates": [
{
"version": current_version,
# param doesn't actually matter, it's just a cachebuster
"update_link": f"https://{owner}.github.io/{repo_name}/{installer_name}?v={current_version}",
},
],
},
},
}
(ghp_dir / "updates.json").write_text(json.dumps(updates))
# copy in source maps
def only_sourcemaps(cur, ls):
if '/' in cur:
return []
return set(ls) - {"chrome", "chrome-beta", "edge", "firefox", "firefox-beta", "safari"}
shutil.copytree("source-maps", ghp_dir, ignore=only_sourcemaps, dirs_exist_ok=True)
- name: Upload new github pages deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./github-pages
deploy-ghp:
name: Deploy to github pages
needs: build
permissions:
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v4

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "6.0",
"version": "6.0.1",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

158
package-lock.json generated
View File

@@ -56,7 +56,7 @@
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "4.9",
"web-ext": "^8.9.0",
"web-ext": "^8.10.0",
"webpack": "^5.94.0",
"webpack-cli": "^4.10.0",
"webpack-merge": "^5.8.0"
@@ -529,9 +529,9 @@
}
},
"node_modules/@babel/runtime": {
"version": "7.27.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz",
"integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==",
"version": "7.28.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
"dev": true,
"engines": {
"node": ">=6.9.0"
@@ -1617,9 +1617,9 @@
}
},
"node_modules/@mdn/browser-compat-data": {
"version": "6.0.32",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-6.0.32.tgz",
"integrity": "sha512-XXZ0RbkrIw8mr71WbVYmtZk+zWYutS71+/8/E+gyPE3yt/ZNiW4UU5/NcrpgLO4NfIB+VBuWhPzSN6Pb1VxAWA==",
"version": "7.1.5",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.1.5.tgz",
"integrity": "sha512-j7XpHbvSU3GOtXawlGq6TIETj0wgcE9o7FXu88ragQE/ak8/OsqOxn+wZ2v/2QUe8vrVhb9OJes+gHgyGEOYEQ==",
"dev": true
},
"node_modules/@nodelib/fs.scandir": {
@@ -2580,14 +2580,14 @@
}
},
"node_modules/addons-linter": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-7.18.0.tgz",
"integrity": "sha512-XJ2FiBjwuprKaFte/5KEOPgym3OuBJw1sutUipeYtQ8q2StVzXqwKY+Fwp0wciDlFkmiQmxP9AMeDiKrc0MdRw==",
"version": "7.20.0",
"resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-7.20.0.tgz",
"integrity": "sha512-c6drrGsO91oGyqEdEZ3KIBFrSiSlhM5CKxoebBatH1l2vN1ByuRAlp9YUHLCjypLONThPcb+tVTA7X6yKIhpsw==",
"dev": true,
"dependencies": {
"@fluent/syntax": "0.19.0",
"@fregante/relaxed-json": "2.0.0",
"@mdn/browser-compat-data": "6.0.32",
"@mdn/browser-compat-data": "7.1.5",
"addons-moz-compare": "1.3.0",
"addons-scanner-utils": "9.13.0",
"ajv": "8.17.1",
@@ -2597,14 +2597,14 @@
"common-tags": "1.8.2",
"deepmerge": "4.3.1",
"eslint": "8.57.1",
"eslint-plugin-no-unsanitized": "4.1.2",
"eslint-plugin-no-unsanitized": "4.1.4",
"eslint-visitor-keys": "4.2.1",
"espree": "10.4.0",
"esprima": "4.0.1",
"fast-json-patch": "3.1.1",
"image-size": "2.0.2",
"json-merge-patch": "1.0.2",
"pino": "9.7.0",
"pino": "9.9.5",
"semver": "7.7.2",
"source-map-support": "0.5.21",
"upath": "2.0.1",
@@ -4298,9 +4298,9 @@
}
},
"node_modules/decamelize": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz",
"integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz",
"integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==",
"dev": true,
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
@@ -4870,9 +4870,9 @@
}
},
"node_modules/eslint-plugin-no-unsanitized": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.1.2.tgz",
"integrity": "sha512-ydF3PMFKEIkP71ZbLHFvu6/FW8SvRv6VV/gECfrQkqyD5+5oCAtPz8ZHy0GRuMDtNe2jsNdPCQXX4LSbkapAVQ==",
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.1.4.tgz",
"integrity": "sha512-cjAoZoq3J+5KJuycYYOWrc0/OpZ7pl2Z3ypfFq4GtaAgheg+L7YGxUo2YS3avIvo/dYU5/zR2hXu3v81M9NxhQ==",
"dev": true,
"peerDependencies": {
"eslint": "^8 || ^9"
@@ -5498,9 +5498,9 @@
}
},
"node_modules/fast-uri": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
"integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
"dev": true,
"funding": [
{
@@ -9905,9 +9905,9 @@
}
},
"node_modules/pino": {
"version": "9.7.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz",
"integrity": "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==",
"version": "9.9.5",
"resolved": "https://registry.npmjs.org/pino/-/pino-9.9.5.tgz",
"integrity": "sha512-d1s98p8/4TfYhsJ09r/Azt30aYELRi6NNnZtEbqFw6BoGsdPVf5lKNK3kUwH8BmJJfpTLNuicjUQjaMbd93dVg==",
"dev": true,
"dependencies": {
"atomic-sleep": "^1.0.0",
@@ -11293,9 +11293,9 @@
"dev": true
},
"node_modules/tmp": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz",
"integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==",
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz",
"integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==",
"dev": true,
"engines": {
"node": ">=14.14"
@@ -11856,18 +11856,18 @@
}
},
"node_modules/web-ext": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/web-ext/-/web-ext-8.9.0.tgz",
"integrity": "sha512-X2IeYfWSf7c/Tireuv48FRfgHougaINBWwwMoYOd9xcXbQGrYXK3IALZZf0cbPpq4AidNxNO8HTKw3SUeWvJgw==",
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/web-ext/-/web-ext-8.10.0.tgz",
"integrity": "sha512-RM15PF8/xBBTe3pkgTvTkPaRoJbwE4HZcKy9NeD0lHIdir23oy9kd2oC4LuOqhrtarFvhTK4HlJ6NPYXt8Isxw==",
"dev": true,
"dependencies": {
"@babel/runtime": "7.27.6",
"@babel/runtime": "7.28.4",
"@devicefarmer/adbkit": "3.3.8",
"addons-linter": "7.18.0",
"addons-linter": "7.20.0",
"camelcase": "8.0.0",
"chrome-launcher": "1.2.0",
"debounce": "1.2.1",
"decamelize": "6.0.0",
"decamelize": "6.0.1",
"es6-error": "4.1.1",
"firefox-profile": "4.7.0",
"fx-runner": "1.4.0",
@@ -11878,12 +11878,12 @@
"node-notifier": "10.0.1",
"open": "10.2.0",
"parse-json": "7.1.1",
"pino": "9.7.0",
"pino": "9.9.5",
"promise-toolbox": "0.21.0",
"source-map-support": "0.5.21",
"strip-bom": "5.0.0",
"strip-json-comments": "5.0.2",
"tmp": "0.2.3",
"strip-json-comments": "5.0.3",
"tmp": "0.2.5",
"update-notifier": "7.3.1",
"watchpack": "2.4.4",
"yargs": "17.7.2",
@@ -12007,9 +12007,9 @@
}
},
"node_modules/web-ext/node_modules/strip-json-comments": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.2.tgz",
"integrity": "sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==",
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz",
"integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==",
"dev": true,
"engines": {
"node": ">=14.16"
@@ -12992,9 +12992,9 @@
}
},
"@babel/runtime": {
"version": "7.27.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz",
"integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==",
"version": "7.28.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz",
"integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==",
"dev": true
},
"@babel/template": {
@@ -13814,9 +13814,9 @@
}
},
"@mdn/browser-compat-data": {
"version": "6.0.32",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-6.0.32.tgz",
"integrity": "sha512-XXZ0RbkrIw8mr71WbVYmtZk+zWYutS71+/8/E+gyPE3yt/ZNiW4UU5/NcrpgLO4NfIB+VBuWhPzSN6Pb1VxAWA==",
"version": "7.1.5",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.1.5.tgz",
"integrity": "sha512-j7XpHbvSU3GOtXawlGq6TIETj0wgcE9o7FXu88ragQE/ak8/OsqOxn+wZ2v/2QUe8vrVhb9OJes+gHgyGEOYEQ==",
"dev": true
},
"@nodelib/fs.scandir": {
@@ -14602,14 +14602,14 @@
"dev": true
},
"addons-linter": {
"version": "7.18.0",
"resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-7.18.0.tgz",
"integrity": "sha512-XJ2FiBjwuprKaFte/5KEOPgym3OuBJw1sutUipeYtQ8q2StVzXqwKY+Fwp0wciDlFkmiQmxP9AMeDiKrc0MdRw==",
"version": "7.20.0",
"resolved": "https://registry.npmjs.org/addons-linter/-/addons-linter-7.20.0.tgz",
"integrity": "sha512-c6drrGsO91oGyqEdEZ3KIBFrSiSlhM5CKxoebBatH1l2vN1ByuRAlp9YUHLCjypLONThPcb+tVTA7X6yKIhpsw==",
"dev": true,
"requires": {
"@fluent/syntax": "0.19.0",
"@fregante/relaxed-json": "2.0.0",
"@mdn/browser-compat-data": "6.0.32",
"@mdn/browser-compat-data": "7.1.5",
"addons-moz-compare": "1.3.0",
"addons-scanner-utils": "9.13.0",
"ajv": "8.17.1",
@@ -14619,14 +14619,14 @@
"common-tags": "1.8.2",
"deepmerge": "4.3.1",
"eslint": "8.57.1",
"eslint-plugin-no-unsanitized": "4.1.2",
"eslint-plugin-no-unsanitized": "4.1.4",
"eslint-visitor-keys": "4.2.1",
"espree": "10.4.0",
"esprima": "4.0.1",
"fast-json-patch": "3.1.1",
"image-size": "2.0.2",
"json-merge-patch": "1.0.2",
"pino": "9.7.0",
"pino": "9.9.5",
"semver": "7.7.2",
"source-map-support": "0.5.21",
"upath": "2.0.1",
@@ -15846,9 +15846,9 @@
}
},
"decamelize": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz",
"integrity": "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz",
"integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==",
"dev": true
},
"decimal.js": {
@@ -16446,9 +16446,9 @@
}
},
"eslint-plugin-no-unsanitized": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.1.2.tgz",
"integrity": "sha512-ydF3PMFKEIkP71ZbLHFvu6/FW8SvRv6VV/gECfrQkqyD5+5oCAtPz8ZHy0GRuMDtNe2jsNdPCQXX4LSbkapAVQ==",
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.1.4.tgz",
"integrity": "sha512-cjAoZoq3J+5KJuycYYOWrc0/OpZ7pl2Z3ypfFq4GtaAgheg+L7YGxUo2YS3avIvo/dYU5/zR2hXu3v81M9NxhQ==",
"dev": true,
"requires": {}
},
@@ -16692,9 +16692,9 @@
"dev": true
},
"fast-uri": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
"integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
"integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
"dev": true
},
"fastest-levenshtein": {
@@ -19892,9 +19892,9 @@
"dev": true
},
"pino": {
"version": "9.7.0",
"resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz",
"integrity": "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==",
"version": "9.9.5",
"resolved": "https://registry.npmjs.org/pino/-/pino-9.9.5.tgz",
"integrity": "sha512-d1s98p8/4TfYhsJ09r/Azt30aYELRi6NNnZtEbqFw6BoGsdPVf5lKNK3kUwH8BmJJfpTLNuicjUQjaMbd93dVg==",
"dev": true,
"requires": {
"atomic-sleep": "^1.0.0",
@@ -20917,9 +20917,9 @@
"dev": true
},
"tmp": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz",
"integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==",
"version": "0.2.5",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz",
"integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==",
"dev": true
},
"tmpl": {
@@ -21293,18 +21293,18 @@
}
},
"web-ext": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/web-ext/-/web-ext-8.9.0.tgz",
"integrity": "sha512-X2IeYfWSf7c/Tireuv48FRfgHougaINBWwwMoYOd9xcXbQGrYXK3IALZZf0cbPpq4AidNxNO8HTKw3SUeWvJgw==",
"version": "8.10.0",
"resolved": "https://registry.npmjs.org/web-ext/-/web-ext-8.10.0.tgz",
"integrity": "sha512-RM15PF8/xBBTe3pkgTvTkPaRoJbwE4HZcKy9NeD0lHIdir23oy9kd2oC4LuOqhrtarFvhTK4HlJ6NPYXt8Isxw==",
"dev": true,
"requires": {
"@babel/runtime": "7.27.6",
"@babel/runtime": "7.28.4",
"@devicefarmer/adbkit": "3.3.8",
"addons-linter": "7.18.0",
"addons-linter": "7.20.0",
"camelcase": "8.0.0",
"chrome-launcher": "1.2.0",
"debounce": "1.2.1",
"decamelize": "6.0.0",
"decamelize": "6.0.1",
"es6-error": "4.1.1",
"firefox-profile": "4.7.0",
"fx-runner": "1.4.0",
@@ -21315,12 +21315,12 @@
"node-notifier": "10.0.1",
"open": "10.2.0",
"parse-json": "7.1.1",
"pino": "9.7.0",
"pino": "9.9.5",
"promise-toolbox": "0.21.0",
"source-map-support": "0.5.21",
"strip-bom": "5.0.0",
"strip-json-comments": "5.0.2",
"tmp": "0.2.3",
"strip-json-comments": "5.0.3",
"tmp": "0.2.5",
"update-notifier": "7.3.1",
"watchpack": "2.4.4",
"yargs": "17.7.2",
@@ -21399,9 +21399,9 @@
"dev": true
},
"strip-json-comments": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.2.tgz",
"integrity": "sha512-4X2FR3UwhNUE9G49aIsJW5hRRR3GXGTBTZRMfv568O60ojM8HcWjV/VxAxCDW3SUND33O6ZY66ZuRcdkj73q2g==",
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz",
"integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==",
"dev": true
},
"type-fest": {

View File

@@ -38,7 +38,7 @@
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "4.9",
"web-ext": "^8.9.0",
"web-ext": "^8.10.0",
"webpack": "^5.94.0",
"webpack-cli": "^4.10.0",
"webpack-merge": "^5.8.0"

View File

@@ -80,9 +80,9 @@
</a>
</div>
<div data-type="react-AdvancedSkipOptionsComponent"></div>
<div data-type="react-AdvancedSkipOptionsComponent" class="hide-when-skip-profile"></div>
<div data-type="toggle" data-sync="forceChannelCheck">
<div data-type="toggle" data-sync="forceChannelCheck" class="hide-when-skip-profile">
<div class="switch-container">
<label class="switch">
<input id="forceChannelCheck" type="checkbox" checked>
@@ -96,7 +96,7 @@
<div class="small-description">__MSG_whatForceChannelCheck__</div>
</div>
<div data-type="toggle" data-sync="showCategoryWithoutPermission">
<div data-type="toggle" data-sync="showCategoryWithoutPermission" class="hide-when-skip-profile">
<div class="switch-container">
<label class="switch">
<input id="showCategoryWithoutPermission" type="checkbox" checked>

View File

@@ -23,6 +23,12 @@ export function CategoryChooserComponent() {
updateChannelList(setChannelListText, selectedConfigurationID!);
setSelections(getConfigurationValue<CategorySelection[]>(selectedConfigurationID, "categorySelections"));
if (selectedConfigurationID === null) {
document.querySelectorAll(".hide-when-skip-profile").forEach((e) => e.classList.remove("hidden"));
} else {
document.querySelectorAll(".hide-when-skip-profile").forEach((e) => e.classList.add("hidden"));
}
}, [selectedConfigurationID]);
const createNewConfig = () => {
@@ -145,6 +151,10 @@ export function CategoryChooserComponent() {
}
forceUpdateConfigurationIDs();
if (Config.local.skipProfileTemp && Config.local.skipProfileTemp.configID === selectedConfigurationID) {
Config.local.skipProfileTemp = null;
}
setConfigurations(Config.local!.skipProfiles);
const newID = Object.keys(Config.local!.skipProfiles)[0] as ConfigurationID;
setSelectedConfigurationID(newID);

View File

@@ -32,6 +32,14 @@ interface SegmentWithNesting extends SponsorTime {
innerChapters?: (SegmentWithNesting|SponsorTime)[];
}
function isSegment(segment) {
return segment.actionType !== ActionType.Chapter;
}
function isChapter(segment) {
return segment.actionType === ActionType.Chapter;
}
export const SegmentListComponent = (props: SegmentListComponentProps) => {
const [tab, setTab] = React.useState(SegmentListTab.Segments);
const [isVip, setIsVip] = React.useState(Config.config?.isVip ?? false);
@@ -46,17 +54,19 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
}
}, []);
React.useEffect(() => {
setTab(SegmentListTab.Segments);
}, [props.videoID]);
const [hasSegments, hasChapters] = React.useMemo(() => {
const hasSegments = Boolean(props.segments.find(isSegment))
const hasChapters = Boolean(props.segments.find(isChapter))
return [hasSegments, hasChapters];
}, [props.segments]);
const tabFilter = (segment: SponsorTime) => {
if (tab === SegmentListTab.Chapter) {
return segment.actionType === ActionType.Chapter;
React.useEffect(() => {
if (hasSegments){
setTab(SegmentListTab.Segments);
} else {
return segment.actionType !== ActionType.Chapter;
setTab(SegmentListTab.Chapter);
}
};
}, [props.videoID, hasSegments]);
const segmentsWithNesting = React.useMemo(() => {
const result: SegmentWithNesting[] = [];
@@ -98,7 +108,7 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
return (
<div id="issueReporterContainer">
<div id="issueReporterTabs" className={props.segments && props.segments.find(s => s.actionType === ActionType.Chapter) ? "" : "hidden"}>
<div id="issueReporterTabs" className={hasSegments && hasChapters ? "" : "hidden"}>
<span id="issueReporterTabSegments" className={tab === SegmentListTab.Segments ? "sbSelected" : ""} onClick={() => {
setTab(SegmentListTab.Segments);
}}>
@@ -125,7 +135,7 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
isVip={isVip}
loopedChapter={props.loopedChapter} // UUID instead of boolean so it can be passed down to nested chapters
tabFilter={tabFilter}
tabFilter={tab === SegmentListTab.Chapter ? isChapter : isSegment}
sendMessage={props.sendMessage}
/>
))

View File

@@ -5,7 +5,7 @@
"noImplicitAny": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": false,
"sourceMap": true,
"outDir": "dist/js",
"noEmitOnError": false,
"typeRoots": [ "node_modules/@types" ],
@@ -20,4 +20,4 @@
"include": [
"src/**/*"
]
}
}

View File

@@ -189,7 +189,8 @@ module.exports = env => {
new BuildManifest({
browser: env.browser,
pretty: env.mode === "production",
stream: env.stream
stream: env.stream,
autoupdate: env.autoupdate,
}),
new configDiffPlugin()
],
@@ -200,4 +201,4 @@ module.exports = env => {
}
};
};
};

View File

@@ -23,10 +23,13 @@ const schema = {
pretty: {
type: 'boolean'
},
steam: {
stream: {
type: 'string'
},
autoupdate: {
type: 'boolean',
}
}
}
};
class BuildManifest {
@@ -39,6 +42,7 @@ class BuildManifest {
apply() {
const distFolder = path.resolve(__dirname, "../dist/");
const distManifestFile = path.resolve(distFolder, "manifest.json");
const [owner, repo_name] = (process.env.GITHUB_REPOSITORY ?? "ajayyy/SponsorBlock").split("/");
// Add missing manifest elements
if (this.options.browser.toLowerCase() === "firefox") {
@@ -62,6 +66,10 @@ class BuildManifest {
}
}
if (this.options.autoupdate === true && this.options.browser.toLowerCase() === "firefox") {
manifest.browser_specific_settings.gecko.update_url = `https://${owner.toLowerCase()}.github.io/${repo_name}/updates.json`;
}
let result = JSON.stringify(manifest);
if (this.options.pretty) result = JSON.stringify(manifest, null, 2);
@@ -86,4 +94,4 @@ function mergeObjects(object1, object2) {
}
}
module.exports = BuildManifest;
module.exports = BuildManifest;

View File

@@ -1,12 +1,40 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { SourceMapDevToolPlugin } = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = env => {
async function createGHPSourceMapURL(env) {
const manifest = require("../manifest/manifest.json");
const version = manifest.version;
const [owner, repo_name] = (process.env.GITHUB_REPOSITORY ?? "ajayyy/SponsorBlock").split("/");
const ghpUrl = `https://${owner.toLowerCase()}.github.io/${repo_name}/${env.browser}${env.stream === "beta" ? "-beta" : ""}/${version}/`;
// make a request to the url and check if we got redirected
// firefox doesn't seem to like getting redirected on a source map request
try {
const resp = await fetch(ghpUrl);
return resp.url;
} catch {
return ghpUrl;
}
}
module.exports = async env => {
let mode = "production";
env.mode = mode;
return merge(common(env), {
mode
mode,
...(env.ghpSourceMaps
? {
devtool: false,
plugins: [new SourceMapDevToolPlugin({
publicPath: await createGHPSourceMapURL(env),
filename: '[file].map[query]',
})],
}
: {
devtool: "source-map",
}
),
});
};
};