From bd8326f95f292d995be67791cc520317d99d1028 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 18 Oct 2023 09:42:36 +0000
Subject: [PATCH 001/505] Bump @babel/traverse from 7.19.3 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.19.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)
---
updated-dependencies:
- dependency-name: "@babel/traverse"
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 292 ++++++++++++++++++++++++----------------------
1 file changed, 150 insertions(+), 142 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4e98614353..e74129a914 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -79,12 +79,13 @@
}
},
"node_modules/@babel/code-frame": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
- "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"dependencies": {
- "@babel/highlight": "^7.18.6"
+ "@babel/highlight": "^7.22.13",
+ "chalk": "^2.4.2"
},
"engines": {
"node": ">=6.9.0"
@@ -130,13 +131,14 @@
}
},
"node_modules/@babel/generator": {
- "version": "7.19.3",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz",
- "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.19.3",
+ "@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
},
"engines": {
@@ -176,34 +178,34 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
- "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
- "version": "7.19.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz",
- "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"dependencies": {
- "@babel/template": "^7.18.10",
- "@babel/types": "^7.19.0"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
- "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.18.6"
+ "@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
@@ -262,30 +264,30 @@
}
},
"node_modules/@babel/helper-split-export-declaration": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
- "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.18.6"
+ "@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-string-parser": {
- "version": "7.19.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
- "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.19.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
- "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true,
"engines": {
"node": ">=6.9.0"
@@ -315,13 +317,13 @@
}
},
"node_modules/@babel/highlight": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
- "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.18.6",
- "chalk": "^2.0.0",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
"js-tokens": "^4.0.0"
},
"engines": {
@@ -329,9 +331,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.20.13",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.13.tgz",
- "integrity": "sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -530,33 +532,33 @@
}
},
"node_modules/@babel/template": {
- "version": "7.18.10",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
- "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==",
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.18.6",
- "@babel/parser": "^7.18.10",
- "@babel/types": "^7.18.10"
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.19.3",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz",
- "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==",
- "dev": true,
- "dependencies": {
- "@babel/code-frame": "^7.18.6",
- "@babel/generator": "^7.19.3",
- "@babel/helper-environment-visitor": "^7.18.9",
- "@babel/helper-function-name": "^7.19.0",
- "@babel/helper-hoist-variables": "^7.18.6",
- "@babel/helper-split-export-declaration": "^7.18.6",
- "@babel/parser": "^7.19.3",
- "@babel/types": "^7.19.3",
+ "version": "7.23.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
+ "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -565,13 +567,13 @@
}
},
"node_modules/@babel/types": {
- "version": "7.20.7",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz",
- "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"dependencies": {
- "@babel/helper-string-parser": "^7.19.4",
- "@babel/helper-validator-identifier": "^7.19.1",
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -1569,8 +1571,9 @@
}
},
"node_modules/@jridgewell/resolve-uri": {
- "version": "3.0.4",
- "integrity": "sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
@@ -1610,18 +1613,19 @@
}
},
"node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.4.10",
- "integrity": "sha512-Ht8wIW5v165atIX1p+JvKR5ONzUyF4Ac8DZIQ5kZs9zrb6M8SJNXpx1zn04rn65VjBMygRoMXcyYwNK0fT7bEg==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.15",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz",
- "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==",
+ "version": "0.3.20",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
+ "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
"dev": true,
"dependencies": {
- "@jridgewell/resolve-uri": "^3.0.3",
- "@jridgewell/sourcemap-codec": "^1.4.10"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@mdn/browser-compat-data": {
@@ -13589,12 +13593,13 @@
}
},
"@babel/code-frame": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
- "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"requires": {
- "@babel/highlight": "^7.18.6"
+ "@babel/highlight": "^7.22.13",
+ "chalk": "^2.4.2"
}
},
"@babel/compat-data": {
@@ -13627,13 +13632,14 @@
}
},
"@babel/generator": {
- "version": "7.19.3",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.19.3.tgz",
- "integrity": "sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"requires": {
- "@babel/types": "^7.19.3",
+ "@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
},
"dependencies": {
@@ -13663,28 +13669,28 @@
}
},
"@babel/helper-environment-visitor": {
- "version": "7.18.9",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
- "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true
},
"@babel/helper-function-name": {
- "version": "7.19.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz",
- "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"requires": {
- "@babel/template": "^7.18.10",
- "@babel/types": "^7.19.0"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
}
},
"@babel/helper-hoist-variables": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
- "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"requires": {
- "@babel/types": "^7.18.6"
+ "@babel/types": "^7.22.5"
}
},
"@babel/helper-module-imports": {
@@ -13728,24 +13734,24 @@
}
},
"@babel/helper-split-export-declaration": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
- "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"requires": {
- "@babel/types": "^7.18.6"
+ "@babel/types": "^7.22.5"
}
},
"@babel/helper-string-parser": {
- "version": "7.19.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
- "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
"dev": true
},
"@babel/helper-validator-identifier": {
- "version": "7.19.1",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
- "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true
},
"@babel/helper-validator-option": {
@@ -13766,20 +13772,20 @@
}
},
"@babel/highlight": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
- "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"requires": {
- "@babel/helper-validator-identifier": "^7.18.6",
- "chalk": "^2.0.0",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
"js-tokens": "^4.0.0"
}
},
"@babel/parser": {
- "version": "7.20.13",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.13.tgz",
- "integrity": "sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true
},
"@babel/plugin-syntax-async-generators": {
@@ -13918,42 +13924,42 @@
}
},
"@babel/template": {
- "version": "7.18.10",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
- "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==",
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.18.6",
- "@babel/parser": "^7.18.10",
- "@babel/types": "^7.18.10"
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
}
},
"@babel/traverse": {
- "version": "7.19.3",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.19.3.tgz",
- "integrity": "sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ==",
- "dev": true,
- "requires": {
- "@babel/code-frame": "^7.18.6",
- "@babel/generator": "^7.19.3",
- "@babel/helper-environment-visitor": "^7.18.9",
- "@babel/helper-function-name": "^7.19.0",
- "@babel/helper-hoist-variables": "^7.18.6",
- "@babel/helper-split-export-declaration": "^7.18.6",
- "@babel/parser": "^7.19.3",
- "@babel/types": "^7.19.3",
+ "version": "7.23.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
+ "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
}
},
"@babel/types": {
- "version": "7.20.7",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.7.tgz",
- "integrity": "sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"requires": {
- "@babel/helper-string-parser": "^7.19.4",
- "@babel/helper-validator-identifier": "^7.19.1",
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
}
},
@@ -14694,8 +14700,9 @@
}
},
"@jridgewell/resolve-uri": {
- "version": "3.0.4",
- "integrity": "sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true
},
"@jridgewell/set-array": {
@@ -14728,18 +14735,19 @@
}
},
"@jridgewell/sourcemap-codec": {
- "version": "1.4.10",
- "integrity": "sha512-Ht8wIW5v165atIX1p+JvKR5ONzUyF4Ac8DZIQ5kZs9zrb6M8SJNXpx1zn04rn65VjBMygRoMXcyYwNK0fT7bEg==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"@jridgewell/trace-mapping": {
- "version": "0.3.15",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz",
- "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==",
+ "version": "0.3.20",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
+ "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
"dev": true,
"requires": {
- "@jridgewell/resolve-uri": "^3.0.3",
- "@jridgewell/sourcemap-codec": "^1.4.10"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"@mdn/browser-compat-data": {
From 2a5b76ddfb146a9c0af85e02bdeda520235fde35 Mon Sep 17 00:00:00 2001
From: Brian Choromanski
Date: Thu, 19 Oct 2023 15:09:19 -0400
Subject: [PATCH 002/505] Overriding default webpack performance config to
reduce warnings
---
webpack/webpack.common.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js
index e1a3e66c09..21ff358294 100644
--- a/webpack/webpack.common.js
+++ b/webpack/webpack.common.js
@@ -185,6 +185,12 @@ module.exports = env => {
stream: env.stream
}),
new configDiffPlugin()
- ]
+ ],
+ performance: {
+ hints: false,
+ maxEntrypointSize: 512000,
+ maxAssetSize: 512000
+ }
+
};
};
\ No newline at end of file
From 6f54c8a7313e3d7afc15830065b5dc73f143657f Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 31 Oct 2023 01:16:36 -0400
Subject: [PATCH 003/505] Make highlight bigger on timeline when skip to
highlight button hovered
---
src/content.ts | 9 +++++++--
src/js-components/skipButtonControlBar.ts | 17 ++++++++++++++---
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/src/content.ts b/src/content.ts
index de53700514..03afcb16e9 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -302,8 +302,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
reskipSponsorTime(sponsorTimes.find((segment) => segment.UUID === request.UUID), true);
break;
case "selectSegment":
- selectedSegment = request.UUID;
- updatePreviewBar();
+ selectSegment(request.UUID);
break;
case "submitVote":
vote(request.type, request.UUID).then((response) => sendResponse(response));
@@ -1071,6 +1070,7 @@ function setupSkipButtonControlBar() {
openNotice: true,
forceAutoSkip: true
}),
+ selectSegment,
onMobileYouTube: isOnMobileYouTube()
});
}
@@ -1349,6 +1349,11 @@ function updatePreviewBarPositionMobile(parent: HTMLElement) {
}
}
+function selectSegment(UUID: SegmentUUID): void {
+ selectedSegment = UUID;
+ updatePreviewBar();
+}
+
function updatePreviewBar(): void {
if (previewBar === null) return;
diff --git a/src/js-components/skipButtonControlBar.ts b/src/js-components/skipButtonControlBar.ts
index a4cf31a52a..b14eed1863 100644
--- a/src/js-components/skipButtonControlBar.ts
+++ b/src/js-components/skipButtonControlBar.ts
@@ -1,11 +1,12 @@
import Config from "../config";
-import { SponsorTime } from "../types";
+import { SegmentUUID, SponsorTime } from "../types";
import { getSkippingText } from "../utils/categoryUtils";
import { AnimationUtils } from "../utils/animationUtils";
import { keybindToString } from "../../maze-utils/src/config";
export interface SkipButtonControlBarProps {
skip: (segment: SponsorTime) => void;
+ selectSegment: (UUID: SegmentUUID) => void;
onMobileYouTube: boolean;
}
@@ -54,8 +55,18 @@ export class SkipButtonControlBar {
this.container.appendChild(this.skipIcon);
this.container.appendChild(this.textContainer);
this.container.addEventListener("click", () => this.toggleSkip());
- this.container.addEventListener("mouseenter", () => this.stopTimer());
- this.container.addEventListener("mouseleave", () => this.startTimer());
+ this.container.addEventListener("mouseenter", () => {
+ this.stopTimer();
+
+ if (this.segment) {
+ props.selectSegment(this.segment.UUID);
+ }
+ });
+ this.container.addEventListener("mouseleave", () => {
+ this.startTimer();
+
+ props.selectSegment(null);
+ });
if (this.onMobileYouTube) {
this.container.addEventListener("touchstart", (e) => this.handleTouchStart(e));
this.container.addEventListener("touchmove", (e) => this.handleTouchMove(e));
From 65c72d38eaa531e0951147b64ef26f3d9719acf7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 1 Nov 2023 00:19:59 +0000
Subject: [PATCH 004/505] Update Invidious List
---
ci/invidiouslist.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ci/invidiouslist.json b/ci/invidiouslist.json
index d012c62436..e752567ba3 100644
--- a/ci/invidiouslist.json
+++ b/ci/invidiouslist.json
@@ -1 +1 @@
-["www.youtubekids.com","anontube.lvkaszus.pl","inv.bp.projectsegfau.lt","inv.makerlab.tech","inv.pistasjis.net","inv.tux.pizza","inv.zzls.xyz","invidious.asir.dev","invidious.flokinet.to","invidious.io.lol","invidious.lunar.icu","invidious.no-logs.com","invidious.privacydev.net","invidious.private.coffee","invidious.protokolla.fi","invidious.slipfox.xyz","invidious.tiekoetter.com","iv.ggtyler.dev","iv.melmac.space","iv.nboeck.de","onion.tube","vid.priv.au","vid.puffyan.us","yewtu.be","yt.artemislena.eu","yt.drgnz.club","yt.oelrichsgarcia.de"]
\ No newline at end of file
+["www.youtubekids.com","anontube.lvkaszus.pl","inv.citw.lgbt","inv.in.projectsegfau.lt","inv.tux.pizza","inv.zzls.xyz","invidious.asir.dev","invidious.drgns.space","invidious.fdn.fr","invidious.flokinet.to","invidious.io.lol","invidious.lunar.icu","invidious.nerdvpn.de","invidious.no-logs.com","invidious.perennialte.ch","invidious.privacydev.net","invidious.private.coffee","invidious.projectsegfau.lt","invidious.protokolla.fi","invidious.slipfox.xyz","iv.datura.network","iv.ggtyler.dev","iv.melmac.space","iv.nboeck.de","onion.tube","vid.priv.au","vid.puffyan.us","yewtu.be","yt.artemislena.eu","yt.cdaut.de","yt.drgnz.club","yt.oelrichsgarcia.de"]
\ No newline at end of file
From 9c2007e0cf99fe65b53fcc3c11a102297717a63c Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 1 Nov 2023 15:53:40 -0400
Subject: [PATCH 005/505] Rate limit saving times to make scrolling the edit
box less laggy
---
src/components/SponsorTimeEditComponent.tsx | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 22e10d4207..191f8ce75e 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -590,7 +590,24 @@ class SponsorTimeEditComponent extends React.Component {
+ this.saveEditTimes();
+ }, timeSinceLastEdit)
+ }
+
+ return;
+ }
+
+ this.lastEditTime = Date.now();
+ this.editTimeTimeout = null;
+
const sponsorTimesSubmitting = this.props.contentContainer().sponsorTimesSubmitting;
const category = this.categoryOptionRef.current.value as Category
From 4ffa019c688993d03dd36a560ce9cce8785f88d6 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 1 Nov 2023 16:08:52 -0400
Subject: [PATCH 006/505] Scroll down when new segment added to notice
---
src/components/SubmissionNoticeComponent.tsx | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx
index e81c2bdf4f..c10472e170 100644
--- a/src/components/SubmissionNoticeComponent.tsx
+++ b/src/components/SubmissionNoticeComponent.tsx
@@ -38,6 +38,8 @@ class SubmissionNoticeComponent extends React.Component this.lastSegmentCount) {
+ this.lastSegmentCount = currentSegmentCount;
+
+ const scrollElement = this.noticeRef.current.getElement().current.querySelector("#sponsorSkipNoticeMiddleRowSubmissionNotice");
+ scrollElement.scrollTo({
+ top: scrollElement.scrollHeight + 1000
+ });
+ }
+ }
+
render(): React.ReactElement {
const sortButton =
Date: Thu, 2 Nov 2023 14:25:29 -0400
Subject: [PATCH 007/505] Another fix for flashing on Firefox when skipping
some segments at the end of the video
---
src/content.ts | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/content.ts b/src/content.ts
index 03afcb16e9..9fbe4cb687 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -98,6 +98,8 @@ utils.wait(() => Config.isReady(), 5000, 10).then(() => {
});
const skipBuffer = 0.003;
+// If this close to the end, skip to the end
+const endTimeSkipBuffer = 0.5;
//was sponsor data found when doing SponsorsLookup
let sponsorDataFound = false;
@@ -622,7 +624,8 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
updateActiveSegment(currentTime);
- if (getVideo().paused) return;
+ if (getVideo().paused
+ || (getVideo().currentTime >= getVideo().duration - 0.01 && getVideo().duration > 1)) return;
const skipInfo = getNextSkipIndex(currentTime, includeIntersectingSegments, includeNonIntersectingSegments);
const currentSkip = skipInfo.array[skipInfo.index];
@@ -701,8 +704,12 @@ async function startSponsorSchedule(includeIntersectingSegments = false, current
forcedSkipTime = skipTime[0] + 0.001;
} else {
forcedSkipTime = skipTime[1];
- forcedIncludeIntersectingSegments = true;
forcedIncludeNonIntersectingSegments = false;
+
+ // Only if not at the end of the video
+ if (Math.abs(skipTime[1] - getVideo().duration) > endTimeSkipBuffer) {
+ forcedIncludeIntersectingSegments = true;
+ }
}
} else {
forcedSkipTime = forceVideoTime + 0.001;
@@ -1665,7 +1672,7 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u
// MacOS will loop otherwise #1027
// Sometimes playlists loop too #1804
v.currentTime = v.duration - 0.001;
- } else if (v.duration > 1 && Math.abs(skipTime[1] - v.duration) < 0.5
+ } else if (v.duration > 1 && Math.abs(skipTime[1] - v.duration) < endTimeSkipBuffer
&& isFirefoxOrSafari() && !isSafari()) {
v.currentTime = v.duration;
} else {
From 7bf3237b7271872f05bf1e8f4f964c581ad1e685 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 2 Nov 2023 14:34:09 -0400
Subject: [PATCH 008/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 3ff20d9a8b..8434a93598 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 3ff20d9a8b3628788fa95a31fea78e751c8fe1c2
+Subproject commit 8434a93598bc5306db8a86517f5e00d7321d27fc
From dc2c7cc42547d8062a92d89a33243d3fec7aca72 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 2 Nov 2023 14:34:51 -0400
Subject: [PATCH 009/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 678b4631be..7d1f36886a 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.4.25",
+ "version": "5.4.26",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 9a71e8bb8c1e85fbacdfcd4a0816b3398e793a80 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 6 Nov 2023 19:33:05 -0500
Subject: [PATCH 010/505] Disable dearrow promotion
---
src/config.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/config.ts b/src/config.ts
index 4dab0dab2e..e820160d9e 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -316,7 +316,7 @@ const syncDefaults = {
showSegmentFailedToFetchWarning: true,
allowScrollingToEdit: true,
deArrowInstalled: false,
- showDeArrowPromotion: true,
+ showDeArrowPromotion: false,
showZoomToFillError2: true,
categoryPillColors: {},
From cfe314742dca3c8902ba8af12421354e1de30ce9 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 7 Nov 2023 15:34:53 -0500
Subject: [PATCH 011/505] Rename Preview/Recap to Preview/Recap/Hook
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 8434a93598..7c71786bb3 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 8434a93598bc5306db8a86517f5e00d7321d27fc
+Subproject commit 7c71786bb3d27f9ff6d62d2575f17b4bfee89b34
From 14d50b9e70133bae0012a8d86da5b2e440fa0297 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 7 Nov 2023 20:49:25 -0500
Subject: [PATCH 012/505] Add dearrow link to install page and add close button
---
public/_locales | 2 +-
public/help/index.html | 14 ++++++++++++++
public/help/styles.css | 29 +++++++++++++++++++++++++++++
public/options/options.css | 12 ++++++++++++
public/options/options.html | 2 ++
src/config.ts | 2 ++
src/help.ts | 27 +++++++++++++++++++++++++++
src/options.ts | 11 ++++++++++-
8 files changed, 97 insertions(+), 2 deletions(-)
diff --git a/public/_locales b/public/_locales
index 7c71786bb3..322a245df5 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 7c71786bb3d27f9ff6d62d2575f17b4bfee89b34
+Subproject commit 322a245df5b39875a0e30725b7b2980ed008aef1
diff --git a/public/help/index.html b/public/help/index.html
index f3ac8212c7..d2e848f448 100644
--- a/public/help/index.html
+++ b/public/help/index.html
@@ -34,6 +34,20 @@
Come contribute, make some suggestions and help out on Discord or on Matrix.
+
+
+
+
+
+
+
+
+
+
__MSG_helpPageReviewOptions__
diff --git a/public/help/styles.css b/public/help/styles.css
index 99ff809d39..9c4720d00e 100644
--- a/public/help/styles.css
+++ b/public/help/styles.css
@@ -322,4 +322,33 @@ svg {
cursor: default;
background-color: var(--disabled);
color: grey;
+}
+
+.dearrow-link {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-decoration: none;
+
+ font-size: 16px;
+}
+
+.dearrow-link img {
+ width: 35px;
+ padding: 10px
+}
+
+.dearrow-link .close-button {
+ opacity: 0;
+ width: 15px;
+ filter: invert(0.3);
+ transition: opacity 0.2s;
+}
+
+.dearrow-link:hover .close-button {
+ opacity: 1;
+}
+
+.hidden {
+ display: none;
}
\ No newline at end of file
diff --git a/public/options/options.css b/public/options/options.css
index 4ff811de38..13cad69d49 100644
--- a/public/options/options.css
+++ b/public/options/options.css
@@ -717,4 +717,16 @@ svg {
.dearrow-link > img {
width: 40px;
margin-right: 4px;
+}
+
+.dearrow-link .close-button {
+ opacity: 0;
+ width: 15px;
+ filter: invert(0.3);
+ transition: opacity 0.2s;
+ margin-left: 10px;
+}
+
+.dearrow-link:hover .close-button {
+ opacity: 1;
}
\ No newline at end of file
diff --git a/public/options/options.html b/public/options/options.html
index 5e9f32de87..6c09cfd9de 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -75,6 +75,8 @@
__MSG_DeArrowPromotionMessage__
+
+
diff --git a/src/config.ts b/src/config.ts
index e820160d9e..95a36421b0 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -75,6 +75,7 @@ interface SBConfig {
allowScrollingToEdit: boolean;
deArrowInstalled: boolean;
showDeArrowPromotion: boolean;
+ showDeArrowInSettings: boolean;
showZoomToFillError2: boolean;
// Used to cache calculated text color info
@@ -317,6 +318,7 @@ const syncDefaults = {
allowScrollingToEdit: true,
deArrowInstalled: false,
showDeArrowPromotion: false,
+ showDeArrowInSettings: true,
showZoomToFillError2: true,
categoryPillColors: {},
diff --git a/src/help.ts b/src/help.ts
index 3b8c636bd3..67296473f3 100644
--- a/src/help.ts
+++ b/src/help.ts
@@ -3,6 +3,7 @@ import Config from "./config";
import { showDonationLink } from "./utils/configUtils";
import { waitFor } from "../maze-utils/src";
+import { isDeArrowInstalled } from "./utils/crossExtension";
if (document.readyState === "complete") {
init();
@@ -10,6 +11,32 @@ if (document.readyState === "complete") {
document.addEventListener("DOMContentLoaded", init);
}
+// DeArrow promotion
+waitFor(() => Config.isReady()).then(() => {
+ if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
+ isDeArrowInstalled().then((installed) => {
+ if (!installed) {
+ const deArrowPromotion = document.getElementById("dearrow-link");
+ deArrowPromotion.classList.remove("hidden");
+
+ deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);
+
+ const text = deArrowPromotion.querySelector("#dearrow-link-text");
+ text.textContent = `${chrome.i18n.getMessage("DeArrowPromotionMessage2").split("?")[0]}? ${chrome.i18n.getMessage("DeArrowPromotionMessage3")}`;
+
+ const closeButton = deArrowPromotion.querySelector(".close-button");
+ closeButton.addEventListener("click", (e) => {
+ e.preventDefault();
+
+ deArrowPromotion.classList.add("hidden");
+ Config.config.showDeArrowPromotion = false;
+ Config.config.showDeArrowInSettings = false;
+ });
+ }
+ });
+ }
+});
+
async function init() {
localizeHtmlPage();
diff --git a/src/options.ts b/src/options.ts
index 965c984036..8acdd86e59 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -74,13 +74,22 @@ async function init() {
}
// DeArrow promotion
- if (Config.config.showNewFeaturePopups && Config.config.showUpsells) {
+ if (Config.config.showNewFeaturePopups && Config.config.showUpsells && Config.config.showDeArrowInSettings) {
isDeArrowInstalled().then((installed) => {
if (!installed) {
const deArrowPromotion = document.getElementById("deArrowPromotion");
deArrowPromotion.classList.remove("hidden");
deArrowPromotion.addEventListener("click", () => Config.config.showDeArrowPromotion = false);
+
+ const closeButton = deArrowPromotion.querySelector(".close-button");
+ closeButton.addEventListener("click", (e) => {
+ e.preventDefault();
+
+ deArrowPromotion.classList.add("hidden");
+ Config.config.showDeArrowPromotion = false;
+ Config.config.showDeArrowInSettings = false;
+ });
}
});
}
From 6d37180d005f8f1c7691e0567ea4802425ca7569 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 7 Nov 2023 21:05:39 -0500
Subject: [PATCH 013/505] Add option to hide clutter in popup
---
public/_locales | 2 +-
public/options/options.html | 12 ++++++++++++
public/popup.css | 1 +
public/popup.html | 4 ++--
src/config.ts | 2 ++
src/popup.ts | 14 ++++++++++++++
6 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/public/_locales b/public/_locales
index 322a245df5..6ff5f86e9a 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 322a245df5b39875a0e30725b7b2980ed008aef1
+Subproject commit 6ff5f86e9aca64c2ad51aa13e39db1a040506f9d
diff --git a/public/options/options.html b/public/options/options.html
index 6c09cfd9de..52a5812332 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -359,6 +359,18 @@
__MSG_showTimeWithSkipsDescription__
+
+
+
+
+
+
+
-
-
+
diff --git a/src/config.ts b/src/config.ts
index 95a36421b0..f13cd3ad76 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -77,6 +77,7 @@ interface SBConfig {
showDeArrowPromotion: boolean;
showDeArrowInSettings: boolean;
showZoomToFillError2: boolean;
+ cleanPopup: boolean;
// Used to cache calculated text color info
categoryPillColors: {
@@ -320,6 +321,7 @@ const syncDefaults = {
showDeArrowPromotion: false,
showDeArrowInSettings: true,
showZoomToFillError2: true,
+ cleanPopup: false,
categoryPillColors: {},
diff --git a/src/popup.ts b/src/popup.ts
index 234096fee2..41fb9210d2 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -108,6 +108,10 @@ async function runThePopup(messageListener?: MessageListener): Promise
{
const PageElements: PageElements = {};
[
+ "sbPopupLogo",
+ "sbYourWorkBox",
+ "videoInfo",
+ "sbFooter",
"sponsorBlockPopupBody",
"sponsorblockPopup",
"sponsorStart",
@@ -198,6 +202,16 @@ async function runThePopup(messageListener?: MessageListener): Promise {
}
PageElements.sbDonate.addEventListener("click", () => Config.config.donateClicked = Config.config.donateClicked + 1);
+ if (Config.config.cleanPopup) {
+ PageElements.sbPopupLogo.classList.add("hidden");
+ PageElements.sbYourWorkBox.classList.add("hidden");
+ PageElements.sbFooter.classList.add("hidden");
+ PageElements.sponsorTimesDonateContainer.classList.add("hidden");
+ PageElements.mainControls.classList.add("hidden");
+
+ PageElements.videoInfo.style.marginTop = "10px";
+ }
+
if (Config.config.testingServer) {
PageElements.sbBetaServerWarning.classList.remove("hidden");
PageElements.sbBetaServerWarning.addEventListener("click", function () {
From e722ded58a928989bb583ae266acf765c129592c Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 16:07:59 -0500
Subject: [PATCH 014/505] Add dearrow promo based on title and remove old one
Also refactor requests out to seperate file
---
maze-utils | 2 +-
public/_locales | 2 +-
public/content.css | 7 ++
src/components/SponsorTimeEditComponent.tsx | 6 +-
src/config.ts | 4 +-
src/content.ts | 57 ++++-------------
src/dearrowPromotion.ts | 71 +++++++++++++++++++++
src/options.ts | 3 +-
src/popup.ts | 5 +-
src/utils.ts | 46 -------------
src/utils/requests.ts | 47 ++++++++++++++
src/utils/videoLabels.ts | 3 +-
src/utils/warnings.ts | 9 ++-
13 files changed, 155 insertions(+), 107 deletions(-)
create mode 100644 src/dearrowPromotion.ts
create mode 100644 src/utils/requests.ts
diff --git a/maze-utils b/maze-utils
index 92d368b051..6bdc9402c6 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 92d368b051c1af360ab9db45215df274b71de8f5
+Subproject commit 6bdc9402c6cf2a8c97e53e1c360744e12afd919f
diff --git a/public/_locales b/public/_locales
index 6ff5f86e9a..9ba877c006 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 6ff5f86e9aca64c2ad51aa13e39db1a040506f9d
+Subproject commit 9ba877c006a9a78774e56713cc170f355d81a4ab
diff --git a/public/content.css b/public/content.css
index 39051417b4..dc2b1ba163 100644
--- a/public/content.css
+++ b/public/content.css
@@ -742,6 +742,7 @@ input::-webkit-inner-spin-button {
color: white;
font-size: 12px;
z-index: 10000;
+ font-weight: normal;
}
.sponsorBlockTooltip a {
@@ -764,6 +765,12 @@ input::-webkit-inner-spin-button {
right: 50%;
}
+.sponsorBlockTooltip.sbTriangle.sbTopTriangle::after {
+ bottom: 100%;
+ top: unset;
+ border-color: transparent transparent rgba(28, 28, 28, 0.7) transparent;
+}
+
.sponsorBlockLockedColor {
color: #ffc83d !important;
}
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 191f8ce75e..1b470a781f 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -2,14 +2,12 @@ import * as React from "react";
import * as CompileConfig from "../../config.json";
import Config from "../config";
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 "../../maze-utils/src/formating";
-
-const utils = new Utils();
+import { asyncRequestToServer } from "../utils/requests";
export interface SponsorTimeEditProps {
index: number;
@@ -727,7 +725,7 @@ class SponsorTimeEditComponent extends React.Component Config.isReady(), 5000, 10).then(() => {
addCSS();
setCategoryColorCSSVariables();
- // DeArrow promotion
- setTimeout(async () => {
- if (document.URL === "https://www.youtube.com/"
- && Config.config.showDeArrowPromotion
- && Config.config.showUpsells
- && Config.config.showNewFeaturePopups
- && (Config.config.skipCount > 30 || !Config.config.trackViewCount)
- && Math.random() < 0.05) {
-
- if (!await isDeArrowInstalled()) {
- const element = await waitForElement("#contents") as HTMLElement;
- if (element) {
- Config.config.showDeArrowPromotion = false;
-
- new Tooltip({
- text: chrome.i18n.getMessage("DeArrowPromotionMessage2"),
- linkOnClick: () => window.open("https://dearrow.ajay.app"),
- referenceNode: element,
- prependElement: element.firstElementChild as HTMLElement,
- timeout: 15000,
- positionRealtive: false,
- containerAbsolute: true,
- bottomOffset: "inherit",
- topOffset: "-82px",
- leftOffset: "0",
- rightOffset: "0",
- displayTriangle: false,
- center: true,
- opacity: 1
- });
- }
- } else {
- Config.config.showDeArrowPromotion = false;
- }
- }
- }, 5000);
-
runCompatibilityChecks();
});
@@ -440,6 +403,8 @@ function resetValues() {
for (let i = 0; i < skipNotices.length; i++) {
skipNotices.pop()?.close();
}
+
+ hideDeArrowPromotion();
}
function videoIDChange(): void {
@@ -480,6 +445,8 @@ function videoIDChange(): void {
// Clear unsubmitted segments from the previous video
sponsorTimesSubmitting = [];
updateSponsorTimesSubmitting();
+
+ tryShowingDeArrowPromotion().catch(logWarn);
}
function handleMobileControlsMutations(): void {
@@ -1112,7 +1079,7 @@ async function sponsorsLookup(keepOldSubmissions = true) {
if (hashParams.requiredSegment) extraRequestData.requiredSegment = hashParams.requiredSegment;
const hashPrefix = (await getHash(getVideoID(), 1)).slice(0, 4) as VideoID & HashedValue;
- const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
+ const response = await asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
categories,
actionTypes: getEnabledActionTypes(),
userAgent: `${chrome.runtime.id}`,
@@ -1252,7 +1219,7 @@ function getEnabledActionTypes(forceFullVideo = false): ActionType[] {
async function lockedCategoriesLookup(): Promise {
const hashPrefix = (await getHash(getVideoID(), 1)).slice(0, 4);
- const response = await utils.asyncRequestToServer("GET", "/api/lockCategories/" + hashPrefix);
+ const response = await asyncRequestToServer("GET", "/api/lockCategories/" + hashPrefix);
if (response.ok) {
try {
@@ -1646,7 +1613,7 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
counted = true;
}
- if (fullSkip) utils.asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
+ if (fullSkip) asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
}
}
}
@@ -2282,7 +2249,7 @@ async function sendSubmitMessage() {
}
}
- const response = await utils.asyncRequestToServer("POST", "/api/skipSegments", {
+ const response = await asyncRequestToServer("POST", "/api/skipSegments", {
videoID: getVideoID(),
userID: Config.config.userID,
segments: sponsorTimesSubmitting,
diff --git a/src/dearrowPromotion.ts b/src/dearrowPromotion.ts
new file mode 100644
index 0000000000..208c627f73
--- /dev/null
+++ b/src/dearrowPromotion.ts
@@ -0,0 +1,71 @@
+import { waitFor } from "../maze-utils/src";
+import { getYouTubeTitleNode } from "../maze-utils/src/elements";
+import { getHash } from "../maze-utils/src/hash";
+import { getVideoID, isOnInvidious, isOnMobileYouTube } from "../maze-utils/src/video";
+import Config from "./config";
+import { Tooltip } from "./render/Tooltip";
+import { isDeArrowInstalled } from "./utils/crossExtension";
+import { isVisible } from "./utils/pageUtils";
+import { asyncRequestToServer } from "./utils/requests";
+
+let tooltip: Tooltip = null;
+export async function tryShowingDeArrowPromotion() {
+ if (Config.config.showDeArrowPromotion
+ && !isOnMobileYouTube()
+ && !isOnInvidious()
+ && document.URL.includes("watch")
+ && Config.config.showUpsells
+ && Config.config.showNewFeaturePopups
+ && (Config.config.skipCount > 30 || !Config.config.trackViewCount)) {
+
+ if (!await isDeArrowInstalled()) {
+ try {
+ const element = await waitFor(() => getYouTubeTitleNode(), 5000, 500, (e) => isVisible(e)) as HTMLElement;
+ if (element && element.innerText && badTitle(element.innerText)) {
+ const hashPrefix = (await getHash(getVideoID(), 1)).slice(0, 4);
+ const deArrowData = await asyncRequestToServer("GET", "/api/branding/" + hashPrefix);
+ if (!deArrowData.ok) return;
+
+ const deArrowDataJson = JSON.parse(deArrowData.responseText);
+ const title = deArrowDataJson?.[getVideoID()]?.titles?.[0];
+ if (title && title.title && (title.locked || title.votes > 0)) {
+ Config.config.showDeArrowPromotion = false;
+
+ tooltip = new Tooltip({
+ text: chrome.i18n.getMessage("DeArrowTitleReplacementSuggestion") + "\n\n" + title.title,
+ linkOnClick: () => {
+ window.open("https://dearrow.ajay.app");
+ Config.config.shownDeArrowPromotion = true;
+ },
+ referenceNode: element,
+ prependElement: element.firstElementChild as HTMLElement,
+ timeout: 15000,
+ positionRealtive: false,
+ containerAbsolute: true,
+ bottomOffset: "inherit",
+ topOffset: "55px",
+ leftOffset: "0",
+ rightOffset: "0",
+ topTriangle: true,
+ center: true,
+ opacity: 1
+ });
+ }
+ }
+ } catch { } // eslint-disable-line no-empty
+ } else {
+ Config.config.showDeArrowPromotion = false;
+ }
+ }
+}
+
+/**
+ * Two upper case words (at least 2 letters long)
+ */
+function badTitle(title: string): boolean {
+ return !!title.match(/\p{Lu}{2,} \p{Lu}{2,}[.!? ]/u);
+}
+
+export function hideDeArrowPromotion(): void {
+ if (tooltip) tooltip.close();
+}
\ No newline at end of file
diff --git a/src/options.ts b/src/options.ts
index 8acdd86e59..6b0885389e 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -18,6 +18,7 @@ import { StorageChangesObject } from "../maze-utils/src/config";
import { getHash } from "../maze-utils/src/hash";
import { isFirefoxOrSafari } from "../maze-utils/src";
import { isDeArrowInstalled } from "./utils/crossExtension";
+import { asyncRequestToServer } from "./utils/requests";
const utils = new Utils();
let embed = false;
@@ -567,7 +568,7 @@ function activatePrivateTextChange(element: HTMLElement) {
switch (option) {
case "userID":
if (Config.config[option]) {
- utils.asyncRequestToServer("GET", "/api/userInfo", {
+ asyncRequestToServer("GET", "/api/userInfo", {
publicUserID: getHash(Config.config[option]),
values: ["warnings", "banned"]
}).then((result) => {
diff --git a/src/popup.ts b/src/popup.ts
index 41fb9210d2..21267afe2b 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -27,6 +27,7 @@ import GenericNotice from "./render/GenericNotice";
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
import { StorageChangesObject } from "../maze-utils/src/config";
import { getHash } from "../maze-utils/src/hash";
+import { asyncRequestToServer, sendRequestToServer } from "./utils/requests";
const utils = new Utils();
@@ -295,7 +296,7 @@ async function runThePopup(messageListener?: MessageListener): Promise {
const values = ["userName", "viewCount", "minutesSaved", "vip", "permissions"];
- utils.asyncRequestToServer("GET", "/api/userInfo", {
+ asyncRequestToServer("GET", "/api/userInfo", {
publicUserID: await getHash(Config.config.userID),
values
}).then((res) => {
@@ -818,7 +819,7 @@ async function runThePopup(messageListener?: MessageListener): Promise {
PageElements.setUsernameStatus.style.display = "unset";
PageElements.setUsernameStatus.innerText = chrome.i18n.getMessage("Loading");
- utils.sendRequestToServer("POST", "/api/setUsername?userID=" + Config.config.userID + "&username=" + PageElements.usernameInput.value, function (response) {
+ sendRequestToServer("POST", "/api/setUsername?userID=" + Config.config.userID + "&username=" + PageElements.usernameInput.value, function (response) {
if (response.status == 200) {
//submitted
PageElements.submitUsername.style.display = "none";
diff --git a/src/utils.ts b/src/utils.ts
index 7b3a3841c5..c96a7772aa 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -2,10 +2,8 @@ import Config, { VideoDownvotes } from "./config";
import { CategorySelection, SponsorTime, BackgroundScriptContainer, Registration, VideoID, SponsorHideType, CategorySkipOption } from "./types";
import { getHash, HashedValue } from "../maze-utils/src/hash";
-import * as CompileConfig from "../config.json";
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
import { findValidElementFromSelector } from "../maze-utils/src/dom";
-import { FetchResponse, sendRequestToCustomServer } from "../maze-utils/src/background-request-proxy"
import { isSafari } from "../maze-utils/src/config";
export default class Utils {
@@ -240,50 +238,6 @@ export default class Utils {
return permissionRegex;
}
- /**
- * Sends a request to a custom server
- *
- * @param type The request type. "GET", "POST", etc.
- * @param address The address to add to the SponsorBlock server address
- * @param callback
- */
- asyncRequestToCustomServer(type: string, url: string, data = {}): Promise {
- return sendRequestToCustomServer(type, url, data);
- }
-
- /**
- * Sends a request to the SponsorBlock server with address added as a query
- *
- * @param type The request type. "GET", "POST", etc.
- * @param address The address to add to the SponsorBlock server address
- * @param callback
- */
- async asyncRequestToServer(type: string, address: string, data = {}): Promise {
- const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
-
- return await (this.asyncRequestToCustomServer(type, serverAddress + address, data));
- }
-
- /**
- * Sends a request to the SponsorBlock server with address added as a query
- *
- * @param type The request type. "GET", "POST", etc.
- * @param address The address to add to the SponsorBlock server address
- * @param callback
- */
- sendRequestToServer(type: string, address: string, callback?: (response: FetchResponse) => void): void {
- const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
-
- // Ask the background script to do the work
- chrome.runtime.sendMessage({
- message: "sendRequest",
- type,
- url: serverAddress + address
- }, (response) => {
- callback(response);
- });
- }
-
findReferenceNode(): HTMLElement {
const selectors = [
"#player-container-id", // Mobile YouTube
diff --git a/src/utils/requests.ts b/src/utils/requests.ts
new file mode 100644
index 0000000000..8c160eb00e
--- /dev/null
+++ b/src/utils/requests.ts
@@ -0,0 +1,47 @@
+import Config from "../config";
+import * as CompileConfig from "../../config.json";
+import { FetchResponse, sendRequestToCustomServer } from "../../maze-utils/src/background-request-proxy";
+
+/**
+ * Sends a request to a custom server
+ *
+ * @param type The request type. "GET", "POST", etc.
+ * @param address The address to add to the SponsorBlock server address
+ * @param callback
+ */
+export function asyncRequestToCustomServer(type: string, url: string, data = {}): Promise {
+ return sendRequestToCustomServer(type, url, data);
+}
+
+/**
+ * Sends a request to the SponsorBlock server with address added as a query
+ *
+ * @param type The request type. "GET", "POST", etc.
+ * @param address The address to add to the SponsorBlock server address
+ * @param callback
+ */
+export async function asyncRequestToServer(type: string, address: string, data = {}): Promise {
+ const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
+
+ return await (asyncRequestToCustomServer(type, serverAddress + address, data));
+}
+
+/**
+ * Sends a request to the SponsorBlock server with address added as a query
+ *
+ * @param type The request type. "GET", "POST", etc.
+ * @param address The address to add to the SponsorBlock server address
+ * @param callback
+ */
+export function sendRequestToServer(type: string, address: string, callback?: (response: FetchResponse) => void): void {
+ const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
+
+ // Ask the background script to do the work
+ chrome.runtime.sendMessage({
+ message: "sendRequest",
+ type,
+ url: serverAddress + address
+ }, (response) => {
+ callback(response);
+ });
+}
\ No newline at end of file
diff --git a/src/utils/videoLabels.ts b/src/utils/videoLabels.ts
index 731bfd3378..82af788cd8 100644
--- a/src/utils/videoLabels.ts
+++ b/src/utils/videoLabels.ts
@@ -2,6 +2,7 @@ import { Category, CategorySkipOption, VideoID } from "../types";
import { getHash } from "../../maze-utils/src/hash";
import Utils from "../utils";
import { logWarn } from "./logger";
+import { asyncRequestToServer } from "./requests";
const utils = new Utils();
@@ -20,7 +21,7 @@ async function getLabelHashBlock(hashPrefix: string): Promise {
- const userInfo = await utils.asyncRequestToServer("GET", "/api/userInfo", {
+ const userInfo = await asyncRequestToServer("GET", "/api/userInfo", {
publicUserID: await getHash(Config.config.userID),
values: ["warningReason"]
});
if (userInfo.ok) {
const warningReason = JSON.parse(userInfo.responseText)?.warningReason;
- const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
+ const userNameData = await asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : "";
const publicUserID = await getHash(Config.config.userID);
@@ -43,7 +42,7 @@ export async function openWarningDialog(contentContainer: ContentContainer): Pro
{
name: chrome.i18n.getMessage("warningConfirmButton"),
listener: async () => {
- const result = await utils.asyncRequestToServer("POST", "/api/warnUser", {
+ const result = await asyncRequestToServer("POST", "/api/warnUser", {
userID: Config.config.userID,
enabled: false
});
From 133ea360d7b757b3b0be45b36d54b6d14d90b332 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:13:38 -0500
Subject: [PATCH 015/505] Fix error when submitting with required segments
---
src/content.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index 2804dc4ccd..91ca3f7174 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1353,7 +1353,7 @@ function updatePreviewBar(): void {
showLarger: segment.actionType === ActionType.Poi,
description: segment.description,
source: segment.source,
- requiredSegment: requiredSegment && (segment.UUID === requiredSegment || segment.UUID.startsWith(requiredSegment)),
+ requiredSegment: requiredSegment && (segment.UUID === requiredSegment || segment.UUID?.startsWith(requiredSegment)),
selectedSegment: selectedSegment && segment.UUID === selectedSegment
});
});
From 72c62d0fa41ac9c44a2135739012e9e5ced75b5f Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:19:28 -0500
Subject: [PATCH 016/505] Deduplicate different quotes when comparing chapter
names
---
src/utils/exporter.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/exporter.ts b/src/utils/exporter.ts
index a5871b658c..50a333af58 100644
--- a/src/utils/exporter.ts
+++ b/src/utils/exporter.ts
@@ -106,5 +106,5 @@ export function exportTimesAsHashParam(segments: SponsorTime[]): string {
export function normalizeChapterName(description: string): string {
- return description.toLowerCase().replace(/\.|:|-/g, "").replace(/\s+/g, " ");
+ return description.toLowerCase().replace(/[.:-'’`‛‘"‟”]/g, "").replace(/\s+/g, " ");
}
\ No newline at end of file
From a522e3065c55134112282d00617fee2805b43204 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:22:41 -0500
Subject: [PATCH 017/505] Fix regex being treated as a range
---
src/utils/exporter.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/exporter.ts b/src/utils/exporter.ts
index 50a333af58..40d0f2575c 100644
--- a/src/utils/exporter.ts
+++ b/src/utils/exporter.ts
@@ -106,5 +106,5 @@ export function exportTimesAsHashParam(segments: SponsorTime[]): string {
export function normalizeChapterName(description: string): string {
- return description.toLowerCase().replace(/[.:-'’`‛‘"‟”]/g, "").replace(/\s+/g, " ");
+ return description.toLowerCase().replace(/[.:'’`‛‘"‟”-]/ug, "").replace(/\s+/g, " ");
}
\ No newline at end of file
From bdcb2d05c7f230123c64393f615c4437a9348db7 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:23:37 -0500
Subject: [PATCH 018/505] Make submission and skip notices slightly larger
---
public/shared.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/shared.css b/public/shared.css
index 005d350072..5fd1c9d28c 100644
--- a/public/shared.css
+++ b/public/shared.css
@@ -14,7 +14,7 @@
}
.sponsorSkipNoticeParent {
- min-width: 375px;
+ min-width: 390px;
max-width: 50%;
}
From 09e7c4147920efe9949096c6c5a2128cd158387f Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:24:44 -0500
Subject: [PATCH 019/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 9ba877c006..b31f76dd29 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 9ba877c006a9a78774e56713cc170f355d81a4ab
+Subproject commit b31f76dd29e8d12cf6e58e74a75709a4944a6eae
From 52bd85b8506a6c7620e9125b9f84d73ed91367b5 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 8 Nov 2023 18:24:51 -0500
Subject: [PATCH 020/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 7d1f36886a..90dff43094 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.4.26",
+ "version": "5.4.27",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From c016107572c5f7f766709ea0d81e5f2d70965185 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu, 9 Nov 2023 22:18:01 +0000
Subject: [PATCH 021/505] Bump chromedriver from 110.0.0 to 119.0.1
Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 110.0.0 to 119.0.1.
- [Commits](https://github.com/giggio/node-chromedriver/compare/110.0.0...119.0.1)
---
updated-dependencies:
- dependency-name: chromedriver
dependency-type: direct:development
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 82 ++++++++++++++++++++++++-----------------------
package.json | 2 +-
2 files changed, 43 insertions(+), 41 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4e98614353..727291f799 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,7 +41,7 @@
"@types/wicg-mediasession": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
- "chromedriver": "^110.0.0",
+ "chromedriver": "^119.0.1",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.35.0",
@@ -1739,9 +1739,9 @@
}
},
"node_modules/@testim/chrome-version": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz",
- "integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
+ "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==",
"dev": true
},
"node_modules/@tootallnate/once": {
@@ -3195,9 +3195,9 @@
"dev": true
},
"node_modules/axios": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz",
- "integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz",
+ "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==",
"dev": true,
"dependencies": {
"follow-redirects": "^1.15.0",
@@ -3933,25 +3933,25 @@
}
},
"node_modules/chromedriver": {
- "version": "110.0.0",
- "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-110.0.0.tgz",
- "integrity": "sha512-Le6q8xrA/3fAt+g8qiN0YjsYxINIhQMC6wj9X3W5L77uN4NspEzklDrqYNwBcEVn7PcAEJ73nLlS7mTyZRspHA==",
+ "version": "119.0.1",
+ "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
+ "integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
- "@testim/chrome-version": "^1.1.3",
- "axios": "^1.2.1",
- "compare-versions": "^5.0.1",
+ "@testim/chrome-version": "^1.1.4",
+ "axios": "^1.6.0",
+ "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0",
- "tcp-port-used": "^1.0.1"
+ "tcp-port-used": "^1.0.2"
},
"bin": {
"chromedriver": "bin/chromedriver"
},
"engines": {
- "node": ">=14"
+ "node": ">=18"
}
},
"node_modules/ci-info": {
@@ -4089,9 +4089,9 @@
}
},
"node_modules/compare-versions": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.1.tgz",
- "integrity": "sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
+ "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==",
"dev": true
},
"node_modules/concat-map": {
@@ -5979,9 +5979,9 @@
"dev": true
},
"node_modules/follow-redirects": {
- "version": "1.15.2",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
- "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
+ "version": "1.15.3",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
+ "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
"dev": true,
"funding": [
{
@@ -10826,6 +10826,7 @@
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true
},
@@ -14833,9 +14834,9 @@
}
},
"@testim/chrome-version": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.3.tgz",
- "integrity": "sha512-g697J3WxV/Zytemz8aTuKjTGYtta9+02kva3C1xc7KXB8GdbfE1akGJIsZLyY/FSh2QrnE+fiB7vmWU3XNcb6A==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@testim/chrome-version/-/chrome-version-1.1.4.tgz",
+ "integrity": "sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==",
"dev": true
},
"@tootallnate/once": {
@@ -15976,9 +15977,9 @@
"dev": true
},
"axios": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.2.6.tgz",
- "integrity": "sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ==",
+ "version": "1.6.1",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz",
+ "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==",
"dev": true,
"requires": {
"follow-redirects": "^1.15.0",
@@ -16491,18 +16492,18 @@
}
},
"chromedriver": {
- "version": "110.0.0",
- "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-110.0.0.tgz",
- "integrity": "sha512-Le6q8xrA/3fAt+g8qiN0YjsYxINIhQMC6wj9X3W5L77uN4NspEzklDrqYNwBcEVn7PcAEJ73nLlS7mTyZRspHA==",
+ "version": "119.0.1",
+ "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
+ "integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
"dev": true,
"requires": {
- "@testim/chrome-version": "^1.1.3",
- "axios": "^1.2.1",
- "compare-versions": "^5.0.1",
+ "@testim/chrome-version": "^1.1.4",
+ "axios": "^1.6.0",
+ "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0",
- "tcp-port-used": "^1.0.1"
+ "tcp-port-used": "^1.0.2"
}
},
"ci-info": {
@@ -16612,9 +16613,9 @@
"dev": true
},
"compare-versions": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.1.tgz",
- "integrity": "sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
+ "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==",
"dev": true
},
"concat-map": {
@@ -17995,9 +17996,9 @@
"dev": true
},
"follow-redirects": {
- "version": "1.15.2",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
- "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
+ "version": "1.15.3",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
+ "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
"dev": true
},
"for-each": {
@@ -21547,6 +21548,7 @@
},
"proxy-from-env": {
"version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"dev": true
},
diff --git a/package.json b/package.json
index 1c4f20e272..02c50624a5 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"@types/wicg-mediasession": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
- "chromedriver": "^110.0.0",
+ "chromedriver": "^119.0.1",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.35.0",
From 5ffbc9cabc7325294dcf59c63f38f86b4530425d Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 20 Nov 2023 20:15:41 -0500
Subject: [PATCH 022/505] Add support for userstyles in the popup
It takes userstyles from stylus or enhancer for YouTube and copies them to the popup in an iframe
---
src/content.ts | 33 +++++++++++++++++++++++++++++++--
src/popup.ts | 6 ++++++
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/src/content.ts b/src/content.ts
index 91ca3f7174..b353fb85fe 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2016,7 +2016,6 @@ function openInfoMenu() {
//hide info button
if (playerButtons.info) playerButtons.info.button.style.display = "none";
-
const popup = document.createElement("div");
popup.id = "sponsorBlockPopupContainer";
@@ -2024,7 +2023,37 @@ function openInfoMenu() {
frame.width = "374";
frame.height = "500";
frame.style.borderRadius = "12px";
- frame.addEventListener("load", () => frame.contentWindow.postMessage("", "*"));
+ frame.addEventListener("load", async () => {
+ frame.contentWindow.postMessage("", "*");
+
+ // To support userstyles applying to the popup
+ const stylusStyle = document.querySelector(".stylus");
+ if (stylusStyle) {
+ frame.contentWindow.postMessage({
+ type: "style",
+ css: stylusStyle.textContent
+ }, "*");
+ }
+
+ const enhancerStyle = document.getElementById("efyt-theme");
+ if (enhancerStyle) {
+ const enhancerStyleVariables = document.getElementById("efyt-theme-variables");
+ if (enhancerStyleVariables) {
+ const enhancerCss = await fetch(enhancerStyle.getAttribute("href")).then((response) => response.text());
+ const enhancerVariablesCss = await fetch(enhancerStyleVariables.getAttribute("href")).then((response) => response.text());
+
+ if (enhancerCss && enhancerVariablesCss) {
+ frame.contentWindow.postMessage({
+ type: "style",
+ // Image needs needs to reference the full url now
+ css: enhancerCss.replace("./images/youtube-deep-dark/IconSponsorBlocker256px.png",
+ "https://raw.githubusercontent.com/RaitaroH/YouTube-DeepDark/master/YT_Images/IconSponsorBlocker256px.png")
+ + enhancerVariablesCss
+ }, "*");
+ }
+ }
+ }
+ });
frame.src = chrome.extension.getURL("popup.html");
popup.appendChild(frame);
diff --git a/src/popup.ts b/src/popup.ts
index 21267afe2b..a6157dea28 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -72,6 +72,12 @@ window.addEventListener("message", async (e): Promise => {
if (e.source !== window.parent) return;
if (e.origin.endsWith('.youtube.com')) {
allowPopup = true;
+
+ if (e.data && e.data?.type === "style") {
+ const style = document.createElement("style");
+ style.textContent = e.data.css;
+ document.head.appendChild(style);
+ }
}
});
From 2c67db44a016c8792f3f5e6cfe3a4b31d528ccb3 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 27 Nov 2023 00:36:16 -0500
Subject: [PATCH 023/505] Add button in dearrow prompt to quickly disable
future prompts
---
maze-utils | 2 +-
src/dearrowPromotion.ts | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/maze-utils b/maze-utils
index 6bdc9402c6..2aa3c0bc23 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 6bdc9402c6cf2a8c97e53e1c360744e12afd919f
+Subproject commit 2aa3c0bc23c2100ef7eb4963aa116e4182a7f162
diff --git a/src/dearrowPromotion.ts b/src/dearrowPromotion.ts
index 208c627f73..13fa828834 100644
--- a/src/dearrowPromotion.ts
+++ b/src/dearrowPromotion.ts
@@ -37,6 +37,7 @@ export async function tryShowingDeArrowPromotion() {
window.open("https://dearrow.ajay.app");
Config.config.shownDeArrowPromotion = true;
},
+ secondButtonText: chrome.i18n.getMessage("hideNewFeatureUpdates"),
referenceNode: element,
prependElement: element.firstElementChild as HTMLElement,
timeout: 15000,
From d62d362f2e276f2c3fb1c18209ef0343edc96814 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 27 Nov 2023 00:40:17 -0500
Subject: [PATCH 024/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 90dff43094..ed81f4c3dd 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.4.27",
+ "version": "5.4.28",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 1e5bd80471f7fb75be02fa9d88ca988f8fc44776 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 27 Nov 2023 01:04:06 -0500
Subject: [PATCH 025/505] Add warning about extension storage being disable
Fixes issues with Tor and Mullvad browser
Fixes #1894
---
maze-utils | 2 +-
public/_locales | 2 +-
src/background.ts | 3 ++-
src/config.ts | 6 +++++-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/maze-utils b/maze-utils
index 2aa3c0bc23..eb921d9475 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 2aa3c0bc23c2100ef7eb4963aa116e4182a7f162
+Subproject commit eb921d947595c06341ebb53dbce1d6ea67cb88d2
diff --git a/public/_locales b/public/_locales
index b31f76dd29..017d0436c7 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit b31f76dd29e8d12cf6e58e74a75709a4944a6eae
+Subproject commit 017d0436c7e0b034a44f494d68eec2541b7dd623
diff --git a/src/background.ts b/src/background.ts
index d7d9581935..99df62dbf9 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -121,7 +121,7 @@ chrome.runtime.onInstalled.addListener(function () {
const userID = Config.config.userID;
// If there is no userID, then it is the first install.
- if (!userID){
+ if (!userID && !Config.local.alreadyInstalled){
//open up the install page
chrome.tabs.create({url: chrome.extension.getURL("/help/index.html")});
@@ -129,6 +129,7 @@ chrome.runtime.onInstalled.addListener(function () {
const newUserID = generateUserID();
//save this UUID
Config.config.userID = newUserID;
+ Config.local.alreadyInstalled = true;
// Don't show update notification
Config.config.categoryPillUpdate = true;
diff --git a/src/config.ts b/src/config.ts
index a753a36fd4..09a3ebfb15 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -137,6 +137,9 @@ interface SBStorage {
/* VideoID prefixes to UUID prefixes */
downvotedSegments: Record;
navigationApiAvailable: boolean;
+
+ // Used when sync storage disbaled
+ alreadyInstalled: boolean;
}
class ConfigClass extends ProtoConfig {
@@ -456,7 +459,8 @@ const syncDefaults = {
const localDefaults = {
downvotedSegments: {},
- navigationApiAvailable: null
+ navigationApiAvailable: null,
+ alreadyInstalled: false
};
const Config = new ConfigClass(syncDefaults, localDefaults, migrateOldSyncFormats);
From 5b614f5dee6a74f90d031ba20323fed62e7c05b8 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 27 Nov 2023 01:58:58 -0500
Subject: [PATCH 026/505] Revert chrome driver version to fix tests
---
package-lock.json | 44 ++++++++++++++++++++++----------------------
package.json | 2 +-
2 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index db3f35dfc3..ad27c35c69 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,7 +41,7 @@
"@types/wicg-mediasession": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
- "chromedriver": "^119.0.1",
+ "chromedriver": "^110.0.0",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.35.0",
@@ -3937,25 +3937,25 @@
}
},
"node_modules/chromedriver": {
- "version": "119.0.1",
- "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
- "integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
+ "version": "110.0.0",
+ "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-110.0.0.tgz",
+ "integrity": "sha512-Le6q8xrA/3fAt+g8qiN0YjsYxINIhQMC6wj9X3W5L77uN4NspEzklDrqYNwBcEVn7PcAEJ73nLlS7mTyZRspHA==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
- "@testim/chrome-version": "^1.1.4",
- "axios": "^1.6.0",
- "compare-versions": "^6.1.0",
+ "@testim/chrome-version": "^1.1.3",
+ "axios": "^1.2.1",
+ "compare-versions": "^5.0.1",
"extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0",
- "tcp-port-used": "^1.0.2"
+ "tcp-port-used": "^1.0.1"
},
"bin": {
"chromedriver": "bin/chromedriver"
},
"engines": {
- "node": ">=18"
+ "node": ">=14"
}
},
"node_modules/ci-info": {
@@ -4093,9 +4093,9 @@
}
},
"node_modules/compare-versions": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
- "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==",
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz",
+ "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==",
"dev": true
},
"node_modules/concat-map": {
@@ -16500,18 +16500,18 @@
}
},
"chromedriver": {
- "version": "119.0.1",
- "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-119.0.1.tgz",
- "integrity": "sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==",
+ "version": "110.0.0",
+ "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-110.0.0.tgz",
+ "integrity": "sha512-Le6q8xrA/3fAt+g8qiN0YjsYxINIhQMC6wj9X3W5L77uN4NspEzklDrqYNwBcEVn7PcAEJ73nLlS7mTyZRspHA==",
"dev": true,
"requires": {
- "@testim/chrome-version": "^1.1.4",
- "axios": "^1.6.0",
- "compare-versions": "^6.1.0",
+ "@testim/chrome-version": "^1.1.3",
+ "axios": "^1.2.1",
+ "compare-versions": "^5.0.1",
"extract-zip": "^2.0.1",
"https-proxy-agent": "^5.0.1",
"proxy-from-env": "^1.1.0",
- "tcp-port-used": "^1.0.2"
+ "tcp-port-used": "^1.0.1"
}
},
"ci-info": {
@@ -16621,9 +16621,9 @@
"dev": true
},
"compare-versions": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz",
- "integrity": "sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==",
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz",
+ "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==",
"dev": true
},
"concat-map": {
diff --git a/package.json b/package.json
index 02c50624a5..1c4f20e272 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"@types/wicg-mediasession": "^1.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
- "chromedriver": "^119.0.1",
+ "chromedriver": "^110.0.0",
"concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.35.0",
From 47662808a399b69cfab829849f2fea1e1303eb93 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 28 Nov 2023 01:06:49 -0500
Subject: [PATCH 027/505] Fix full video segments ending up in skip notices
---
src/content.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index b353fb85fe..8323b833b7 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1554,7 +1554,8 @@ function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments:
&& segment.segment[1] > minimum && shouldSkip(segment)))) // Only include intersecting skippable segments
&& (!hideHiddenSponsors || segment.hidden === SponsorHideType.Visible)
&& segment.segment.length === 2
- && segment.actionType !== ActionType.Poi;
+ && segment.actionType !== ActionType.Poi
+ && segment.actionType !== ActionType.Full;
const possibleTimes = sponsorTimes.map((sponsorTime) => ({
...sponsorTime,
From 863e01101bbc7a7212539a38793bed5be76762cd Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 30 Nov 2023 15:21:55 -0500
Subject: [PATCH 028/505] Fix minimum supported versions
---
manifest/firefox-manifest-extra.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/manifest/firefox-manifest-extra.json b/manifest/firefox-manifest-extra.json
index b6ffb5245d..9f9468bc10 100644
--- a/manifest/firefox-manifest-extra.json
+++ b/manifest/firefox-manifest-extra.json
@@ -2,10 +2,10 @@
"browser_specific_settings": {
"gecko": {
"id": "sponsorBlocker@ajay.app",
- "strict_min_version": "48.0"
+ "strict_min_version": "56.0"
},
"gecko_android": {
- "strict_min_version": "79.0"
+ "strict_min_version": "113.0"
}
},
"background": {
From 0a4728ec5ed044048a3005c0f2c4865d13b0b093 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 3 Dec 2023 14:28:59 -0500
Subject: [PATCH 029/505] Remove 429 error
---
maze-utils | 2 +-
public/_locales | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/maze-utils b/maze-utils
index eb921d9475..04699c3634 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit eb921d947595c06341ebb53dbce1d6ea67cb88d2
+Subproject commit 04699c3634f2dc0661db8c87afe5c6882ddd28fc
diff --git a/public/_locales b/public/_locales
index 017d0436c7..b5f7f0089b 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 017d0436c7e0b034a44f494d68eec2541b7dd623
+Subproject commit b5f7f0089b0971d7f226edf0044d3cb858407890
From a8cd2357e70886f390525d989d06d9a5c563162d Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 13 Dec 2023 19:38:38 -0500
Subject: [PATCH 030/505] Add retry logic to popup info
---
src/popup.ts | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/popup.ts b/src/popup.ts
index a6157dea28..562fbfcbcf 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -94,6 +94,8 @@ async function runThePopup(messageListener?: MessageListener): Promise {
type PageElements = { [key: string]: HTMLElement } & InputPageElements
let stopLoadingAnimation = null;
+ // For loading video info from the page
+ let loadRetryCount = 0;
//the start and end time pairs (2d)
let sponsorTimes: SponsorTime[] = [];
@@ -409,9 +411,18 @@ async function runThePopup(messageListener?: MessageListener): Promise {
currentVideoID = result.videoID;
loadTabData(tabs, updating);
- } else if (result === undefined && chrome.runtime.lastError) {
- //this isn't a YouTube video then, or at least the content script is not loaded
+ } else {
+ // Handle error if it exists
+ chrome.runtime.lastError;
+
+ // This isn't a YouTube video then, or at least the content script is not loaded
displayNoVideo();
+
+ // Try again in some time if a failure
+ loadRetryCount++;
+ if (loadRetryCount < 6) {
+ setTimeout(() => getSegmentsFromContentScript(false), 100 * loadRetryCount);
+ }
}
});
}
From 2865ea77fec808bcd1baec05ff0c7f355b0cc4de Mon Sep 17 00:00:00 2001
From: Ajay
Date: Fri, 22 Dec 2023 00:23:36 -0500
Subject: [PATCH 031/505] Fix scrolling fast on edit time not saving properly
---
src/components/SponsorTimeEditComponent.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 1b470a781f..80b71f1c8c 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -593,11 +593,12 @@ class SponsorTimeEditComponent extends React.Component {
this.saveEditTimes();
- }, timeSinceLastEdit)
+ }, rateLimitTime - timeSinceLastEdit)
}
return;
From 5ac19eecd4f13a08e7064d781f83cbdb7a53d3d5 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Fri, 22 Dec 2023 10:44:21 -0500
Subject: [PATCH 032/505] Allow dragging around notices
---
src/components/NoticeComponent.tsx | 78 +++++++++++++++++++-
src/components/SkipNoticeComponent.tsx | 1 +
src/components/SubmissionNoticeComponent.tsx | 3 +-
3 files changed, 79 insertions(+), 3 deletions(-)
diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx
index 0e3526d15f..78471341ba 100644
--- a/src/components/NoticeComponent.tsx
+++ b/src/components/NoticeComponent.tsx
@@ -41,6 +41,13 @@ export interface NoticeProps {
children?: React.ReactNode;
}
+interface MouseDownInfo {
+ x: number;
+ y: number;
+ right: number;
+ bottom: number;
+}
+
export interface NoticeState {
maxCountdownTime: () => number;
@@ -50,8 +57,16 @@ export interface NoticeState {
mouseHovering: boolean;
startFaded: boolean;
+
+ mouseDownInfo: MouseDownInfo | null;
+ mouseMoved: boolean;
+ right: number;
+ bottom: number;
}
+// Limits for dragging notice around
+const bounds = [10, 100, 10, 10];
+
class NoticeComponent extends React.Component {
countdownInterval: NodeJS.Timeout;
@@ -61,6 +76,8 @@ class NoticeComponent extends React.Component {
parentRef: React.RefObject;
+ handleMouseMoveBinded: (e: MouseEvent) => void = this.handleMouseMove.bind(this);
+
constructor(props: NoticeProps) {
super(props);
@@ -87,7 +104,12 @@ class NoticeComponent extends React.Component {
countdownMode: CountdownMode.Timer,
mouseHovering: false,
- startFaded: this.props.startFaded ?? false
+ startFaded: this.props.startFaded ?? false,
+
+ mouseDownInfo: null,
+ mouseMoved: false,
+ right: bounds[0],
+ bottom: bounds[1]
}
}
@@ -98,6 +120,9 @@ class NoticeComponent extends React.Component {
render(): React.ReactElement {
const noticeStyle: React.CSSProperties = {
zIndex: this.props.zIndex || (1000 + this.amountOfPreviousNotices),
+ right: this.state.right,
+ bottom: this.state.bottom,
+ userSelect: this.state.mouseDownInfo && this.state.mouseMoved ? "none" : "auto",
...(this.props.style ?? {})
}
@@ -107,7 +132,29 @@ class NoticeComponent extends React.Component {
+ (this.props.showInSecondSlot ? " secondSkipNotice" : "")
+ (this.props.extraClass ? ` ${this.props.extraClass}` : "")}
onMouseEnter={(e) => this.onMouseEnter(e) }
- onMouseLeave={() => this.timerMouseLeave()}
+ onMouseLeave={() => {
+ this.timerMouseLeave();
+ }}
+ onMouseDown={(e) => {
+ document.addEventListener("mousemove", this.handleMouseMoveBinded);
+
+ this.setState({
+ mouseDownInfo: {
+ x: e.clientX,
+ y: e.clientY,
+ right: this.state.right,
+ bottom: this.state.bottom
+ },
+ mouseMoved: false
+ });
+ }}
+ onMouseUp={() => {
+ document.removeEventListener("mousemove", this.handleMouseMoveBinded);
+
+ this.setState({
+ mouseDownInfo: null
+ });
+ }}
ref={this.parentRef}
style={noticeStyle} >
{
getElement(): React.RefObject {
return this.parentRef;
}
+
+ componentWillUnmount(): void {
+ document.removeEventListener("mousemove", this.handleMouseMoveBinded);
+ }
+
+ // For dragging around notice
+ handleMouseMove(e: MouseEvent): void {
+ if (this.state.mouseDownInfo && e.buttons === 1) {
+ const [mouseX, mouseY] = [e.clientX, e.clientY];
+
+ const deltaX = mouseX - this.state.mouseDownInfo.x;
+ const deltaY = mouseY - this.state.mouseDownInfo.y;
+
+ console.log(deltaX, deltaY)
+
+ if (deltaX > 0 || deltaY > 0) this.setState({ mouseMoved: true });
+
+ const element = this.parentRef.current;
+ const parent = element.parentElement.parentElement;
+ this.setState({
+ right: Math.min(parent.clientWidth - element.clientWidth - bounds[2], Math.max(bounds[0], this.state.mouseDownInfo.right - deltaX)),
+ bottom: Math.min(parent.clientHeight - element.clientHeight - bounds[3], Math.max(bounds[1], this.state.mouseDownInfo.bottom - deltaY))
+ });
+ } else {
+ document.removeEventListener("mousemove", this.handleMouseMoveBinded);
+ }
+ }
}
export default NoticeComponent;
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx
index d03e135e63..5557edcb96 100644
--- a/src/components/SkipNoticeComponent.tsx
+++ b/src/components/SkipNoticeComponent.tsx
@@ -316,6 +316,7 @@ class SkipNoticeComponent extends React.Component
+
+
+
+
+
diff --git a/src/components/options/KeybindDialogComponent.tsx b/src/components/options/KeybindDialogComponent.tsx
index 057a3b05e3..f67c82b588 100644
--- a/src/components/options/KeybindDialogComponent.tsx
+++ b/src/components/options/KeybindDialogComponent.tsx
@@ -143,6 +143,7 @@ class KeybindDialogComponent extends React.Component {
createButton("startSegment", "sponsorStart", () => startOrEndTimingNewSegment(), "PlayerStartIconSponsorBlocker.svg");
createButton("cancelSegment", "sponsorCancel", () => cancelCreatingSegment(), "PlayerCancelSegmentIconSponsorBlocker.svg");
createButton("delete", "clearTimes", () => clearSponsorTimes(), "PlayerDeleteIconSponsorBlocker.svg");
- createButton("submit", "OpenSubmissionMenu", () => submitSponsorTimes(), "PlayerUploadIconSponsorBlocker.svg");
+ createButton("submit", "OpenSubmissionMenu", () => openSubmissionMenu(), "PlayerUploadIconSponsorBlocker.svg");
createButton("info", "openPopup", () => openInfoMenu(), "PlayerInfoIconSponsorBlocker.svg");
const controlsContainer = getControls();
@@ -2227,10 +2227,14 @@ function resetSponsorSubmissionNotice(callRef = true) {
submissionNotice = null;
}
-function submitSponsorTimes() {
+function closeSubmissionMenu() {
+ submissionNotice?.close();
+ submissionNotice = null;
+}
+
+function openSubmissionMenu() {
if (submissionNotice !== null){
- submissionNotice.close();
- submissionNotice = null;
+ closeSubmissionMenu();
return;
}
@@ -2240,6 +2244,15 @@ function submitSponsorTimes() {
}
+function submitSegments() {
+ if (sponsorTimesSubmitting !== undefined
+ && sponsorTimesSubmitting.length > 0
+ && submissionNotice !== null) {
+ submissionNotice.submit();
+ }
+
+}
+
//send the message to the background js
//called after all the checks have been made that it's okay to do so
async function sendSubmitMessage() {
@@ -2446,7 +2459,8 @@ function hotkeyListener(e: KeyboardEvent): void {
const skipKey = Config.config.skipKeybind;
const skipToHighlightKey = Config.config.skipToHighlightKeybind;
const startSponsorKey = Config.config.startSponsorKeybind;
- const submitKey = Config.config.submitKeybind;
+ const submitKey = Config.config.actuallySubmitKeybind;
+ const openSubmissionMenuKey = Config.config.submitKeybind;
const nextChapterKey = Config.config.nextChapterKeybind;
const previousChapterKey = Config.config.previousChapterKeybind;
@@ -2466,7 +2480,10 @@ function hotkeyListener(e: KeyboardEvent): void {
startOrEndTimingNewSegment();
return;
} else if (keybindEquals(key, submitKey)) {
- submitSponsorTimes();
+ submitSegments();
+ return;
+ } else if (keybindEquals(key, openSubmissionMenuKey)) {
+ openSubmissionMenu();
return;
} else if (keybindEquals(key, nextChapterKey)) {
if (sponsorTimes.length > 0) e.stopPropagation();
@@ -2485,7 +2502,7 @@ function hotkeyListener(e: KeyboardEvent): void {
} else if (key.key == startSponsorKey?.key && startSponsorKey.code == null && !keybindEquals(Config.syncDefaults.startSponsorKeybind, startSponsorKey)) {
startOrEndTimingNewSegment();
} else if (key.key == submitKey?.key && submitKey.code == null && !keybindEquals(Config.syncDefaults.submitKeybind, submitKey)) {
- submitSponsorTimes();
+ openSubmissionMenu();
}
}
diff --git a/src/render/SubmissionNotice.tsx b/src/render/SubmissionNotice.tsx
index 295d8e2b01..671dde6b28 100644
--- a/src/render/SubmissionNotice.tsx
+++ b/src/render/SubmissionNotice.tsx
@@ -52,6 +52,10 @@ class SubmissionNotice {
this.noticeElement.remove();
}
+
+ submit(): void {
+ this.noticeRef.current?.submit?.();
+ }
}
export default SubmissionNotice;
\ No newline at end of file
From 8496e32cfefddda85605c02ad8e241e559c12041 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Fri, 22 Dec 2023 11:48:21 -0500
Subject: [PATCH 034/505] Add keybind for closing skip notices
Fixes #1915
---
public/_locales | 2 +-
public/options/options.html | 5 +++++
src/components/options/KeybindDialogComponent.tsx | 7 ++++---
src/config.ts | 2 ++
src/content.ts | 7 +++++++
5 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/public/_locales b/public/_locales
index 01bf91daef..0c9f999894 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 01bf91daef4ed4d3f9ed02096b8186799dc73731
+Subproject commit 0c9f99989481a29522dcd338e821295f15eeb136
diff --git a/public/options/options.html b/public/options/options.html
index 5a9c78e19d..545b0fdc28 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -433,6 +433,11 @@
+
+
+
+
+
diff --git a/src/components/options/KeybindDialogComponent.tsx b/src/components/options/KeybindDialogComponent.tsx
index f67c82b588..2fdd728d80 100644
--- a/src/components/options/KeybindDialogComponent.tsx
+++ b/src/components/options/KeybindDialogComponent.tsx
@@ -141,10 +141,11 @@ class KeybindDialogComponent extends React.Component
Date: Fri, 22 Dec 2023 11:52:42 -0500
Subject: [PATCH 035/505] Fix second skip notice slot not working
---
public/content.css | 5 -----
src/components/NoticeComponent.tsx | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/public/content.css b/public/content.css
index dc2b1ba163..285ba11d26 100644
--- a/public/content.css
+++ b/public/content.css
@@ -320,11 +320,6 @@ div:hover > .sponsorBlockChapterBar {
padding-bottom: 7.8%;
}
-/* if two are very close to eachother */
-.secondSkipNotice {
- bottom: 290px;
-}
-
.noticeLeftIcon {
display: flex;
align-items: center;
diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx
index 78471341ba..2687640f95 100644
--- a/src/components/NoticeComponent.tsx
+++ b/src/components/NoticeComponent.tsx
@@ -109,7 +109,7 @@ class NoticeComponent extends React.Component {
mouseDownInfo: null,
mouseMoved: false,
right: bounds[0],
- bottom: bounds[1]
+ bottom: props.showInSecondSlot ? 290 : bounds[1]
}
}
From 67c2a5bae76e8c81a6075f4becacead42568c18e Mon Sep 17 00:00:00 2001
From: Ajay
Date: Fri, 22 Dec 2023 12:58:40 -0500
Subject: [PATCH 036/505] Add timestamp to multi segment vote box
---
src/components/SkipNoticeComponent.tsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx
index 5557edcb96..7487bdc500 100644
--- a/src/components/SkipNoticeComponent.tsx
+++ b/src/components/SkipNoticeComponent.tsx
@@ -14,6 +14,7 @@ import PencilSvg from "../svg-icons/pencil_svg";
import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { generateUserID } from "../../maze-utils/src/setup";
import { keybindToString } from "../../maze-utils/src/config";
+import { getFormattedTime } from "../../maze-utils/src/formating";
enum SkipButtonState {
Undo, // Unskip
@@ -388,7 +389,8 @@ class SkipNoticeComponent extends React.Component this.performAction(i)}
key={"submission" + i + this.segments[i].category + this.idSuffix}>
- {(i + 1) + ". " + chrome.i18n.getMessage("category_" + this.segments[i].category)}
+ {`${(i + 1)}. ${chrome.i18n.getMessage("category_" +
+ this.segments[i].category)} (${getFormattedTime(this.segments[i].segment[0])})`}
);
}
From 58d503636324b29269957410e060571e387c24b9 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Fri, 22 Dec 2023 13:04:28 -0500
Subject: [PATCH 037/505] Make unskipping by keybind easier for multiple
segment notices by focusing by default
Clicking tab will focus the next button allowing you to unskip the next segment
---
src/components/SkipNoticeComponent.tsx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx
index 7487bdc500..f571035e1f 100644
--- a/src/components/SkipNoticeComponent.tsx
+++ b/src/components/SkipNoticeComponent.tsx
@@ -388,6 +388,7 @@ class SkipNoticeComponent extends React.Component this.performAction(i)}
+ autoFocus={i == 0}
key={"submission" + i + this.segments[i].category + this.idSuffix}>
{`${(i + 1)}. ${chrome.i18n.getMessage("category_" +
this.segments[i].category)} (${getFormattedTime(this.segments[i].segment[0])})`}
@@ -459,6 +460,15 @@ class SkipNoticeComponent extends React.Component
Date: Sat, 23 Dec 2023 13:16:19 -0500
Subject: [PATCH 038/505] Move unsubmitted segments to local storage to remove
limits
Also add a way to export local storage
Fixes #1933
---
maze-utils | 2 +-
public/_locales | 2 +-
public/options/options.html | 25 ++++++++++
src/components/SkipNoticeComponent.tsx | 4 +-
src/components/SponsorTimeEditComponent.tsx | 6 +--
src/components/SubmissionNoticeComponent.tsx | 2 +-
.../options/UnsubmittedVideoListComponent.tsx | 4 +-
.../options/UnsubmittedVideoListItem.tsx | 8 ++--
.../options/UnsubmittedVideosComponent.tsx | 6 +--
src/config.ts | 31 +++++++-----
src/content.ts | 20 ++++----
src/options.ts | 48 +++++++++++++------
src/popup.ts | 10 ++--
13 files changed, 109 insertions(+), 59 deletions(-)
diff --git a/maze-utils b/maze-utils
index 04699c3634..69d771d0f3 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 04699c3634f2dc0661db8c87afe5c6882ddd28fc
+Subproject commit 69d771d0f3b96951c970a9eacb046b808907bb1c
diff --git a/public/_locales b/public/_locales
index 0c9f999894..7f2d4e63dc 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 0c9f99989481a29522dcd338e821295f15eeb136
+Subproject commit 7f2d4e63dc53facfeed96aae1086c2bc3329b519
diff --git a/public/options/options.html b/public/options/options.html
index 545b0fdc28..01a3b345cf 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -512,6 +512,31 @@ __MSG_exportOptions__
+
+
__MSG_exportOtherData__
+
+
+
+ __MSG_exportOptionsCopy__
+
+
+ __MSG_exportOptionsDownload__
+
+
+
+
+
+
+
+
+
+ __MSG_setOptions__
+
+
+
+
+
+
+
+
+
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 81f437537c..c6369e2e04 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -8,6 +8,7 @@ import SelectorComponent, { SelectorOption } from "./SelectorComponent";
import { DEFAULT_CATEGORY } from "../utils/categoryUtils";
import { getFormattedTime, getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
import { asyncRequestToServer } from "../utils/requests";
+import { defaultPreviewTime } from "../utils/constants";
export interface SponsorTimeEditProps {
index: number;
@@ -671,7 +672,7 @@ class SponsorTimeEditComponent extends React.Component
this.lastSegmentCount) {
this.lastSegmentCount = currentSegmentCount;
- const scrollElement = this.noticeRef.current.getElement().current.querySelector("#sponsorSkipNoticeMiddleRowSubmissionNotice");
- scrollElement.scrollTo({
- top: scrollElement.scrollHeight + 1000
- });
+ this.scrollToBottom();
}
}
+ scrollToBottom() {
+ const scrollElement = this.noticeRef.current.getElement().current.querySelector("#sponsorSkipNoticeMiddleRowSubmissionNotice");
+ scrollElement.scrollTo({
+ top: scrollElement.scrollHeight + 1000
+ });
+ }
+
render(): React.ReactElement {
const sortButton =
0) {
submissionNotice = new SubmissionNotice(skipNoticeContentContainer, sendSubmitMessage);
}
+}
+function previewRecentSegment() {
+ if (sponsorTimesSubmitting !== undefined && sponsorTimesSubmitting.length > 0) {
+ previewTime(sponsorTimesSubmitting[sponsorTimesSubmitting.length - 1].segment[0] - defaultPreviewTime);
+
+ if (submissionNotice) {
+ submissionNotice.scrollToBottom();
+ }
+ }
}
function submitSegments() {
@@ -2444,6 +2454,7 @@ function hotkeyListener(e: KeyboardEvent): void {
const closeSkipNoticeKey = Config.config.closeSkipNoticeKeybind;
const startSponsorKey = Config.config.startSponsorKeybind;
const submitKey = Config.config.actuallySubmitKeybind;
+ const previewKey = Config.config.previewKeybind;
const openSubmissionMenuKey = Config.config.submitKeybind;
const nextChapterKey = Config.config.nextChapterKeybind;
const previousChapterKey = Config.config.previousChapterKeybind;
@@ -2475,6 +2486,9 @@ function hotkeyListener(e: KeyboardEvent): void {
} else if (keybindEquals(key, openSubmissionMenuKey)) {
openSubmissionMenu();
return;
+ } else if (keybindEquals(key, previewKey)) {
+ previewRecentSegment();
+ return;
} else if (keybindEquals(key, nextChapterKey)) {
if (sponsorTimes.length > 0) e.stopPropagation();
nextChapter();
diff --git a/src/render/SubmissionNotice.tsx b/src/render/SubmissionNotice.tsx
index 671dde6b28..5e9fbfbda6 100644
--- a/src/render/SubmissionNotice.tsx
+++ b/src/render/SubmissionNotice.tsx
@@ -56,6 +56,10 @@ class SubmissionNotice {
submit(): void {
this.noticeRef.current?.submit?.();
}
+
+ scrollToBottom(): void {
+ this.noticeRef.current?.scrollToBottom?.();
+ }
}
export default SubmissionNotice;
\ No newline at end of file
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index dd44676a5a..afceb710c1 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -157,4 +157,6 @@ export function getGuidelineInfo(category: Category): TextBox[] {
text: chrome.i18n.getMessage(`generic_guideline2`)
}];
}
-}
\ No newline at end of file
+}
+
+export const defaultPreviewTime = 2;
\ No newline at end of file
From 5d77a083646cea5cf132a253f01f45c8a7f41dfd Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 15 Jan 2024 00:45:44 -0500
Subject: [PATCH 051/505] Require previewing before submitting
---
public/_locales | 2 +-
src/content.ts | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/public/_locales b/public/_locales
index baf39106e0..b1cbf592a9 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit baf39106e0471e89dd85c17871017dc38b991343
+Subproject commit b1cbf592a9781ba0f17ad12bf7be47e108c578df
diff --git a/src/content.ts b/src/content.ts
index bf4b252c37..58a48f05ee 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -35,7 +35,7 @@ import { openWarningDialog } from "./utils/warnings";
import { isFirefoxOrSafari, waitFor } from "../maze-utils/src";
import { getErrorMessage, getFormattedTime } from "../maze-utils/src/formating";
import { getChannelIDInfo, getVideo, getIsAdPlaying, getIsLivePremiere, setIsAdPlaying, checkVideoIDChange, getVideoID, getYouTubeVideoID, setupVideoModule, checkIfNewVideoID, isOnInvidious, isOnMobileYouTube } from "../maze-utils/src/video";
-import { Keybind, StorageChangesObject, isSafari, keybindEquals } from "../maze-utils/src/config";
+import { Keybind, StorageChangesObject, isSafari, keybindEquals, keybindToString } from "../maze-utils/src/config";
import { findValidElement } from "../maze-utils/src/dom"
import { getHash, HashedValue } from "../maze-utils/src/hash";
import { generateUserID } from "../maze-utils/src/setup";
@@ -78,6 +78,7 @@ let activeSkipKeybindElement: ToggleSkippable = null;
let retryFetchTimeout: NodeJS.Timeout = null;
let shownSegmentFailedToFetchWarning = false;
let selectedSegment: SegmentUUID | null = null;
+let previewedSegment = false;
// JSON video info
let videoInfo: VideoInfo = null;
@@ -372,6 +373,7 @@ function resetValues() {
lastCheckTime = 0;
lastCheckVideoTime = -1;
retryCount = 0;
+ previewedSegment = false;
sponsorTimes = [];
existingChaptersImported = false;
@@ -1579,6 +1581,7 @@ function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments:
* @param time
*/
function previewTime(time: number, unpause = true) {
+ previewedSegment = true;
getVideo().currentTime = time;
// Unpause the video if needed
@@ -2263,6 +2266,11 @@ async function sendSubmitMessage() {
return;
}
+ if (!previewedSegment) {
+ alert(`${chrome.i18n.getMessage("previewSegmentRequired")} ${keybindToString(Config.config.previewKeybind)}`);
+ return;
+ }
+
// Add loading animation
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker.svg");
const stopAnimation = AnimationUtils.applyLoadingAnimation(playerButtons.submit.button, 1, () => updateEditButtonsOnPlayer());
From 3bd769d3188239216ebd866dbcee4da4edcdf823 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 16 Jan 2024 00:03:47 -0500
Subject: [PATCH 052/505] Add compatibility with Vinegar extension on Safari
---
maze-utils | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maze-utils b/maze-utils
index 0475b26c5d..27db39e39b 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 0475b26c5d975a334377ba16ae6cb4ab2c251f57
+Subproject commit 27db39e39b922b4e09f557ea7cb8eec88f6d475c
From 9e2eedcfd4b963fb7442d6cedebda581274760a8 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 16 Jan 2024 00:05:06 -0500
Subject: [PATCH 053/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index b1cbf592a9..840b5c3ca2 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit b1cbf592a9781ba0f17ad12bf7be47e108c578df
+Subproject commit 840b5c3ca2a67f95a2d2d9d20087014058fb8a24
From 2bf6cf663b58fa46d2e5ce23823a38f8c2865b6a Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 16 Jan 2024 00:05:19 -0500
Subject: [PATCH 054/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index ed81f4c3dd..a9f563b70b 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.4.28",
+ "version": "5.5",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 814df465218d453184b7ffbc654c76078fb7a14c Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 16 Jan 2024 18:21:44 -0500
Subject: [PATCH 055/505] Don't warn about using the word intro in chapter
names
---
src/components/SponsorTimeEditComponent.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index c6369e2e04..7f30f0cc51 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -34,7 +34,7 @@ export interface SponsorTimeEditState {
chapterNameSelectorHovering: boolean;
}
-const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => name !== "chapter")
+const categoryNamesGrams: string[] = [].concat(...CompileConfig.categoryList.filter((name) => !["chapter", "intro"].includes(name))
.map((name) => chrome.i18n.getMessage("category_" + name).split(/\/|\s|-/)));
class SponsorTimeEditComponent extends React.Component {
From e489d0f91369229c5f4753fe6db5cc4f85131f58 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 16 Jan 2024 18:37:37 -0500
Subject: [PATCH 056/505] Fix german title not being shortened
---
webpack/webpack.common.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js
index e1a3e66c09..189681c6cf 100644
--- a/webpack/webpack.common.js
+++ b/webpack/webpack.common.js
@@ -160,7 +160,7 @@ module.exports = env => {
if (path.match(/(\/|\\)_locales(\/|\\).+/)) {
const parsed = JSON.parse(content.toString());
if (env.browser.toLowerCase() === "safari") {
- parsed.fullName.message = parsed.fullName.message.match(/^.+(?= -)/)?.[0] || parsed.fullName.message;
+ parsed.fullName.message = parsed.fullName.message.match(/^.+(?= [-–])/)?.[0] || parsed.fullName.message;
if (parsed.fullName.message.length > 50) {
parsed.fullName.message = parsed.fullName.message.slice(0, 47) + "...";
}
From 74aebd32a70b1077770e46c0cb48329df8f27657 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 13:31:45 -0500
Subject: [PATCH 057/505] Prevent zooming when trying to scroll to edit times
---
src/components/SubmissionNoticeComponent.tsx | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx
index a49e3dda67..cd51be0106 100644
--- a/src/components/SubmissionNoticeComponent.tsx
+++ b/src/components/SubmissionNoticeComponent.tsx
@@ -69,6 +69,13 @@ class SubmissionNoticeComponent extends React.Component
Date: Sun, 21 Jan 2024 13:37:29 -0500
Subject: [PATCH 058/505] Only prevent scrolling while editing
---
src/components/SponsorTimeEditComponent.tsx | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 7f30f0cc51..4c8b164104 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -81,13 +81,15 @@ class SponsorTimeEditComponent extends React.Component {
+ e.stopPropagation();
});
// Prevent scrolling while changing times
- document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', function (event) {
- event.preventDefault();
+ document.getElementById("sponsorTimesContainer" + this.idSuffix).addEventListener('wheel', (e) => {
+ if (this.state.editing) {
+ e.preventDefault();
+ }
}, {passive: false});
// Add as a config listener
From 8dfd06919b09a353def609cdca5c48a74a34d8ca Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 13:40:01 -0500
Subject: [PATCH 059/505] Only require a preview for skip and mute segments
---
src/content.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index 58a48f05ee..9e744ebb30 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2266,7 +2266,9 @@ async function sendSubmitMessage() {
return;
}
- if (!previewedSegment) {
+ if (!previewedSegment
+ && !sponsorTimesSubmitting.every((segment) =>
+ [ActionType.Full, ActionType.Chapter, ActionType.Poi].includes(segment.actionType))) {
alert(`${chrome.i18n.getMessage("previewSegmentRequired")} ${keybindToString(Config.config.previewKeybind)}`);
return;
}
From 783326afcaf24be91d1aa02e2f1c015342f32754 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 13:51:32 -0500
Subject: [PATCH 060/505] Use runtime.getURL
---
src/background.ts | 4 ++--
src/components/CategoryPillComponent.tsx | 4 ++--
src/components/NoticeComponent.tsx | 2 +-
src/components/SponsorTimeEditComponent.tsx | 2 +-
src/components/SubmissionNoticeComponent.tsx | 4 ++--
src/content.ts | 14 +++++++-------
src/render/RectangleTooltip.tsx | 2 +-
7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/background.ts b/src/background.ts
index 99df62dbf9..161ee45a25 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -123,7 +123,7 @@ chrome.runtime.onInstalled.addListener(function () {
// If there is no userID, then it is the first install.
if (!userID && !Config.local.alreadyInstalled){
//open up the install page
- chrome.tabs.create({url: chrome.extension.getURL("/help/index.html")});
+ chrome.tabs.create({url: chrome.runtime.getURL("/help/index.html")});
//generate a userID
const newUserID = generateUserID();
@@ -137,7 +137,7 @@ chrome.runtime.onInstalled.addListener(function () {
if (Config.config.supportInvidious) {
if (!(await utils.containsInvidiousPermission())) {
- chrome.tabs.create({url: chrome.extension.getURL("/permissions/index.html")});
+ chrome.tabs.create({url: chrome.runtime.getURL("/permissions/index.html")});
}
}
}, 1500);
diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx
index 1d39a400e6..c72dc18e72 100644
--- a/src/components/CategoryPillComponent.tsx
+++ b/src/components/CategoryPillComponent.tsx
@@ -53,7 +53,7 @@ class CategoryPillComponent extends React.Component
+ src={chrome.runtime.getURL("icons/IconSponsorBlocker256px.png")}>
{
@@ -86,7 +86,7 @@ class CategoryPillComponent extends React.Component {
this.setState({ show: false });
diff --git a/src/components/NoticeComponent.tsx b/src/components/NoticeComponent.tsx
index e41c3fa73d..56a9637891 100644
--- a/src/components/NoticeComponent.tsx
+++ b/src/components/NoticeComponent.tsx
@@ -207,7 +207,7 @@ class NoticeComponent extends React.Component {
{/* Close button */}
-
this.close()}>
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 4c8b164104..0564293a26 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -223,7 +223,7 @@ class SponsorTimeEditComponent extends React.Component
diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx
index cd51be0106..7ddc3e0ee4 100644
--- a/src/components/SubmissionNoticeComponent.tsx
+++ b/src/components/SubmissionNoticeComponent.tsx
@@ -107,7 +107,7 @@ class SubmissionNoticeComponent extends React.Component
this.sortSegments()}
title={chrome.i18n.getMessage("sortSegments")}
key="sortButton"
- src={chrome.extension.getURL("icons/sort.svg")}>
+ src={chrome.runtime.getURL("icons/sort.svg")}>
;
const exportButton =
this.exportSegments()}
title={chrome.i18n.getMessage("exportSegments")}
key="exportButton"
- src={chrome.extension.getURL("icons/export.svg")}>
+ src={chrome.runtime.getURL("icons/export.svg")}>
;
return (
void, image
newButton.draggable = isDraggable;
newButtonImage.id = baseID + "Image";
newButtonImage.className = "playerButtonImage";
- newButtonImage.src = chrome.extension.getURL("icons/" + imageName);
+ newButtonImage.src = chrome.runtime.getURL("icons/" + imageName);
// Append image to button
newButton.appendChild(newButtonImage);
@@ -1867,10 +1867,10 @@ function updateEditButtonsOnPlayer(): void {
if (buttonsEnabled) {
if (creatingSegment) {
- playerButtons.startSegment.image.src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker.svg");
+ playerButtons.startSegment.image.src = chrome.runtime.getURL("icons/PlayerStopIconSponsorBlocker.svg");
playerButtons.startSegment.button.setAttribute("title", chrome.i18n.getMessage("sponsorEnd"));
} else {
- playerButtons.startSegment.image.src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker.svg");
+ playerButtons.startSegment.image.src = chrome.runtime.getURL("icons/PlayerStartIconSponsorBlocker.svg");
playerButtons.startSegment.button.setAttribute("title", chrome.i18n.getMessage("sponsorStart"));
}
}
@@ -2048,7 +2048,7 @@ function openInfoMenu() {
}
}
});
- frame.src = chrome.extension.getURL("popup.html");
+ frame.src = chrome.runtime.getURL("popup.html");
popup.appendChild(frame);
const elemHasChild = (elements: NodeListOf): Element => {
@@ -2274,7 +2274,7 @@ async function sendSubmitMessage() {
}
// Add loading animation
- playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadIconSponsorBlocker.svg");
+ playerButtons.submit.image.src = chrome.runtime.getURL("icons/PlayerUploadIconSponsorBlocker.svg");
const stopAnimation = AnimationUtils.applyLoadingAnimation(playerButtons.submit.button, 1, () => updateEditButtonsOnPlayer());
//check if a sponsor exceeds the duration of the video
@@ -2349,7 +2349,7 @@ async function sendSubmitMessage() {
} else {
// Show that the upload failed
playerButtons.submit.button.style.animation = "unset";
- playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker.svg");
+ playerButtons.submit.image.src = chrome.runtime.getURL("icons/PlayerUploadFailedIconSponsorBlocker.svg");
if (response.status === 403 && response.responseText.startsWith("Submission rejected due to a tip from a moderator.")) {
openWarningDialog(skipNoticeContentContainer);
@@ -2533,7 +2533,7 @@ function addCSS() {
fileref.rel = "stylesheet";
fileref.type = "text/css";
- fileref.href = chrome.extension.getURL(file);
+ fileref.href = chrome.runtime.getURL(file);
head.appendChild(fileref);
}
diff --git a/src/render/RectangleTooltip.tsx b/src/render/RectangleTooltip.tsx
index 1b357fa859..d325688a1b 100644
--- a/src/render/RectangleTooltip.tsx
+++ b/src/render/RectangleTooltip.tsx
@@ -59,7 +59,7 @@ export class RectangleTooltip {
className="sponsorBlockRectangleTooltip" >
})
+ src={chrome.runtime.getURL("icons/IconSponsorBlocker256px.png")}>
{this.text + (props.link ? ". " : "")}
From 4e9e6282f66259090d414a8aebd7557a27ca7877 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 14:26:16 -0500
Subject: [PATCH 061/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 840b5c3ca2..8f84082dde 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 840b5c3ca2a67f95a2d2d9d20087014058fb8a24
+Subproject commit 8f84082dde73c132ee9378cbab1c5c4ba00eb7a4
From ade4654ae0249ae6f120f008eb68296df04b2e76 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 14:26:27 -0500
Subject: [PATCH 062/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index a9f563b70b..73e6537b94 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5",
+ "version": "5.5.1",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From c996680a585a2c8e8a9bbebf841e70b884c7f063 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 15:57:22 -0500
Subject: [PATCH 063/505] Fix category selection changes not saving
---
src/components/options/CategorySkipOptionsComponent.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/options/CategorySkipOptionsComponent.tsx b/src/components/options/CategorySkipOptionsComponent.tsx
index b82b0a5231..d9d89cf0ad 100644
--- a/src/components/options/CategorySkipOptionsComponent.tsx
+++ b/src/components/options/CategorySkipOptionsComponent.tsx
@@ -158,7 +158,7 @@ class CategorySkipOptionsComponent extends React.Component
Date: Sun, 21 Jan 2024 15:57:35 -0500
Subject: [PATCH 064/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 73e6537b94..f7a83fee69 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.1",
+ "version": "5.5.2",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 1f96e3b1174b27cc75c7bdd79e5f1c9116e9b108 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 20:35:00 -0500
Subject: [PATCH 065/505] Improve precision of hover preview
Also fixes issue with YouTube "most-replayed" messing it up
---
src/js-components/previewBar.ts | 72 ++++++++++++++-------------------
1 file changed, 30 insertions(+), 42 deletions(-)
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index a2522f0858..ff498a285e 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -11,7 +11,6 @@ import { ActionType, Category, SegmentContainer, SponsorHideType, SponsorSourceT
import { partition } from "../utils/arrayUtils";
import { DEFAULT_CATEGORY, shortCategoryName } from "../utils/categoryUtils";
import { normalizeChapterName } from "../utils/exporter";
-import { getFormattedTimeToSeconds } from "../../maze-utils/src/formating";
import { findValidElement } from "../../maze-utils/src/dom";
import { addCleanupListener } from "../../maze-utils/src/cleanup";
@@ -125,34 +124,11 @@ class PreviewBar {
mouseOnSeekBar = false;
});
- const observer = new MutationObserver((mutations) => {
+ seekBar.addEventListener("mousemove", (e: MouseEvent) => {
if (!mouseOnSeekBar || !this.categoryTooltip || !this.categoryTooltipContainer) return;
- // Only care about mutations to time tooltip
- if (!mutations.some((mutation) => (mutation.target as HTMLElement).classList.contains("ytp-tooltip-text"))) {
- return;
- }
-
- const tooltipTextElements = tooltipTextWrapper.querySelectorAll(".ytp-tooltip-text");
- let timeInSeconds: number | null = null;
- let noYoutubeChapters = false;
-
- for (const tooltipTextElement of tooltipTextElements) {
- if (tooltipTextElement.classList.contains('ytp-tooltip-text-no-title')) noYoutubeChapters = true;
-
- const tooltipText = tooltipTextElement.textContent;
- if (tooltipText === null || tooltipText.length === 0) continue;
-
- timeInSeconds = getFormattedTimeToSeconds(tooltipText);
-
- if (timeInSeconds !== null) break;
- }
-
- if (timeInSeconds === null) {
- originalTooltip.style.removeProperty("display");
-
- return;
- }
+ let noYoutubeChapters = !!tooltipTextWrapper.querySelector(".ytp-tooltip-text.ytp-tooltip-text-no-title");
+ const timeInSeconds = this.decimalToTime((e.clientX - seekBar.getBoundingClientRect().x) / seekBar.clientWidth);
// Find the segment at that location, using the shortest if multiple found
const [normalSegments, chapterSegments] =
@@ -198,15 +174,6 @@ class PreviewBar {
this.chapterTooltip.style.textAlign = titleTooltip.style.textAlign;
}
});
-
- observer.observe(tooltipTextWrapper, {
- childList: true,
- subtree: true,
- });
-
- addCleanupListener(() => {
- observer.disconnect();
- });
}
private setTooltipTitle(segment: PreviewBarSegment, tooltip: HTMLElement): void {
@@ -920,6 +887,17 @@ class PreviewBar {
}
timeToDecimal(time: number): number {
+ return this.decimalTimeConverter(time, true);
+ }
+
+ decimalToTime(decimal: number): number {
+ return this.decimalTimeConverter(decimal, false);
+ }
+
+ /**
+ * Decimal to time or time to decimal
+ */
+ decimalTimeConverter(value: number, isTime: boolean): number {
if (this.originalChapterBarBlocks?.length > 1 && this.existingChapters.length === this.originalChapterBarBlocks?.length) {
// Parent element to still work when display: none
const totalPixels = this.originalChapterBar.parentElement.clientWidth;
@@ -929,8 +907,9 @@ class PreviewBar {
const chapterElement = this.originalChapterBarBlocks[i];
const widthPixels = parseFloat(chapterElement.style.width.replace("px", ""));
- if (time >= this.existingChapters[i].segment[1]) {
- const marginPixels = chapterElement.style.marginRight ? parseFloat(chapterElement.style.marginRight.replace("px", "")) : 0;
+ const marginPixels = chapterElement.style.marginRight ? parseFloat(chapterElement.style.marginRight.replace("px", "")) : 0;
+ if ((isTime && value >= this.existingChapters[i].segment[1])
+ || (!isTime && value >= (pixelOffset + widthPixels + marginPixels) / totalPixels)) {
pixelOffset += widthPixels + marginPixels;
lastCheckedChapter = i;
} else {
@@ -944,13 +923,22 @@ class PreviewBar {
const latestWidth = parseFloat(this.originalChapterBarBlocks[lastCheckedChapter + 1].style.width.replace("px", ""));
const latestChapterDuration = latestChapter.segment[1] - latestChapter.segment[0];
- const percentageInCurrentChapter = (time - latestChapter.segment[0]) / latestChapterDuration;
- const sizeOfCurrentChapter = latestWidth / totalPixels;
- return Math.min(1, ((pixelOffset / totalPixels) + (percentageInCurrentChapter * sizeOfCurrentChapter)));
+ if (isTime) {
+ const percentageInCurrentChapter = (value - latestChapter.segment[0]) / latestChapterDuration;
+ const sizeOfCurrentChapter = latestWidth / totalPixels;
+ return Math.min(1, ((pixelOffset / totalPixels) + (percentageInCurrentChapter * sizeOfCurrentChapter)));
+ } else {
+ const percentageInCurrentChapter = (value * totalPixels - pixelOffset) / latestWidth;
+ return Math.max(0, latestChapter.segment[0] + (percentageInCurrentChapter * latestChapterDuration));
+ }
}
}
- return Math.min(1, time / this.videoDuration);
+ if (isTime) {
+ return Math.min(1, value / this.videoDuration);
+ } else {
+ return Math.max(0, value * this.videoDuration);
+ }
}
/*
From feae86f6eaa4619d16d74b48fdfbbc2f09f336ee Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sun, 21 Jan 2024 20:42:40 -0500
Subject: [PATCH 066/505] Don't throw errors on extension live-update
---
src/js-components/previewBar.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index ff498a285e..ef5d104505 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -125,7 +125,7 @@ class PreviewBar {
});
seekBar.addEventListener("mousemove", (e: MouseEvent) => {
- if (!mouseOnSeekBar || !this.categoryTooltip || !this.categoryTooltipContainer) return;
+ if (!mouseOnSeekBar || !this.categoryTooltip || !this.categoryTooltipContainer || !chrome.runtime?.id) return;
let noYoutubeChapters = !!tooltipTextWrapper.querySelector(".ytp-tooltip-text.ytp-tooltip-text-no-title");
const timeInSeconds = this.decimalToTime((e.clientX - seekBar.getBoundingClientRect().x) / seekBar.clientWidth);
From 985910cbf63cf7ab548853e0dc525e9eeda0f088 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 23 Jan 2024 14:20:24 -0500
Subject: [PATCH 067/505] Count previewed unsubmitted segments previewed
manually
---
src/content.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/content.ts b/src/content.ts
index 6d656e27d4..bf39ed89b2 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1608,6 +1608,9 @@ function sendTelemetryAndCount(skippingSegments: SponsorTime[], secondsSkipped:
}
if (fullSkip) asyncRequestToServer("POST", "/api/viewedVideoSponsorTime?UUID=" + segment.UUID);
+ } else if (!previewedSegment && sponsorTimesSubmitting.some((s) => s.segment === segment.segment)) {
+ // Count that as a previewed segment
+ previewedSegment = true;
}
}
}
From a662c3e04f3c61dc53f88d6b99d440bc33c6269a Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 23 Jan 2024 14:22:54 -0500
Subject: [PATCH 068/505] Reloading after creating segments shouldn't require
previewing
---
src/content.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/content.ts b/src/content.ts
index bf39ed89b2..d4581486be 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1986,6 +1986,9 @@ function updateSponsorTimesSubmitting(getFromConfig = true) {
}
if (sponsorTimesSubmitting.length > 0) {
+ // Assume they already previewed a segment
+ previewedSegment = true;
+
importExistingChapters(true);
}
}
From 516d624f166967f3afedc39a385ff4685770197f Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 23 Jan 2024 14:25:07 -0500
Subject: [PATCH 069/505] Don't require preview for segments ending at end of
the video
Fixes #1959
---
src/content.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index d4581486be..2b8e3213c6 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2274,7 +2274,8 @@ async function sendSubmitMessage() {
if (!previewedSegment
&& !sponsorTimesSubmitting.every((segment) =>
- [ActionType.Full, ActionType.Chapter, ActionType.Poi].includes(segment.actionType))) {
+ [ActionType.Full, ActionType.Chapter, ActionType.Poi].includes(segment.actionType)
+ || segment.segment[1] >= getVideo()?.duration)) {
alert(`${chrome.i18n.getMessage("previewSegmentRequired")} ${keybindToString(Config.config.previewKeybind)}`);
return;
}
From c69a5743791e60f8c4b56aabf370a3402ca61c1c Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 23 Jan 2024 14:27:01 -0500
Subject: [PATCH 070/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 8f84082dde..fee1745f70 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 8f84082dde73c132ee9378cbab1c5c4ba00eb7a4
+Subproject commit fee1745f701ba9909cf9f5c3d1e9ccfc954c9bbb
From 88dc8db6e7f197d14136e2a5485713185d529b8f Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 23 Jan 2024 14:27:05 -0500
Subject: [PATCH 071/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index f7a83fee69..44e2dfa8b6 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.2",
+ "version": "5.5.3",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 16f27e5c5cd3a8f99773fd232dd8f1689ecc9bbd Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 24 Jan 2024 16:21:31 -0500
Subject: [PATCH 072/505] Move animation utils to maze utils
---
maze-utils | 2 +-
src/components/CategoryPillComponent.tsx | 2 +-
src/components/ChapterVoteComponent.tsx | 2 +-
src/content.ts | 2 +-
src/js-components/skipButtonControlBar.ts | 2 +-
src/popup.ts | 2 +-
src/utils/animationUtils.ts | 78 -----------------------
7 files changed, 6 insertions(+), 84 deletions(-)
delete mode 100644 src/utils/animationUtils.ts
diff --git a/maze-utils b/maze-utils
index 27db39e39b..65609595a9 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 27db39e39b922b4e09f557ea7cb8eec88f6d475c
+Subproject commit 65609595a9af1cdc66ab49e765d3759cf5a56ca3
diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx
index c72dc18e72..36e31b472b 100644
--- a/src/components/CategoryPillComponent.tsx
+++ b/src/components/CategoryPillComponent.tsx
@@ -6,7 +6,7 @@ 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 { AnimationUtils } from "../../maze-utils/src/animationUtils";
import { Tooltip } from "../render/Tooltip";
import { getErrorMessage } from "../../maze-utils/src/formating";
diff --git a/src/components/ChapterVoteComponent.tsx b/src/components/ChapterVoteComponent.tsx
index d50878a603..677a966d17 100644
--- a/src/components/ChapterVoteComponent.tsx
+++ b/src/components/ChapterVoteComponent.tsx
@@ -6,7 +6,7 @@ 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 { AnimationUtils } from "../../maze-utils/src/animationUtils";
import { Tooltip } from "../render/Tooltip";
import { getErrorMessage } from "../../maze-utils/src/formating";
diff --git a/src/content.ts b/src/content.ts
index 2b8e3213c6..71434eb7af 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -26,7 +26,7 @@ import { SkipButtonControlBar } from "./js-components/skipButtonControlBar";
import { getStartTimeFromUrl } from "./utils/urlParser";
import { getControls, getExistingChapters, getHashParams, isPlayingPlaylist, isVisible } from "./utils/pageUtils";
import { CategoryPill } from "./render/CategoryPill";
-import { AnimationUtils } from "./utils/animationUtils";
+import { AnimationUtils } from "../maze-utils/src/animationUtils";
import { GenericUtils } from "./utils/genericUtils";
import { logDebug, logWarn } from "./utils/logger";
import { importTimes } from "./utils/exporter";
diff --git a/src/js-components/skipButtonControlBar.ts b/src/js-components/skipButtonControlBar.ts
index 321e4cf65c..b5c18386df 100644
--- a/src/js-components/skipButtonControlBar.ts
+++ b/src/js-components/skipButtonControlBar.ts
@@ -1,7 +1,7 @@
import Config from "../config";
import { SegmentUUID, SponsorTime } from "../types";
import { getSkippingText } from "../utils/categoryUtils";
-import { AnimationUtils } from "../utils/animationUtils";
+import { AnimationUtils } from "../../maze-utils/src/animationUtils";
import { keybindToString } from "../../maze-utils/src/config";
import { isMobileControlsOpen } from "../utils/mobileUtils";
diff --git a/src/popup.ts b/src/popup.ts
index e1e5757fde..86e79f5468 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -19,7 +19,7 @@ import {
VoteResponse,
} from "./messageTypes";
import { showDonationLink } from "./utils/configUtils";
-import { AnimationUtils } from "./utils/animationUtils";
+import { AnimationUtils } from "../maze-utils/src/animationUtils";
import { shortCategoryName } from "./utils/categoryUtils";
import { localizeHtmlPage } from "../maze-utils/src/setup";
import { exportTimes } from "./utils/exporter";
diff --git a/src/utils/animationUtils.ts b/src/utils/animationUtils.ts
deleted file mode 100644
index 08a59ce016..0000000000
--- a/src/utils/animationUtils.ts
+++ /dev/null
@@ -1,78 +0,0 @@
- /**
- * Starts a spinning animation and returns a function to be called when it should be stopped
- * The callback will be called when the animation is finished
- * It waits until a full rotation is complete
- */
-function applyLoadingAnimation(element: HTMLElement, time: number, callback?: () => void): () => Promise {
- element.style.animation = `rotate ${time}s 0s infinite`;
-
- return async () => new Promise((resolve) => {
- // Make the animation finite
- element.style.animation = `rotate ${time}s`;
-
- // When the animation is over, hide the button
- const animationEndListener = () => {
- if (callback) callback();
-
- element.style.animation = "none";
-
- element.removeEventListener("animationend", animationEndListener);
-
- resolve();
- };
-
- element.addEventListener("animationend", animationEndListener);
- });
-}
-
-function setupCustomHideAnimation(element: Element, container: Element, enabled = true, rightSlide = true): { hide: () => void; show: () => void } {
- if (enabled) element.classList.add("autoHiding");
- element.classList.add("sbhidden");
- element.classList.add("animationDone");
- if (!rightSlide) element.classList.add("autoHideLeft");
-
- let mouseEntered = false;
-
- return {
- hide: () => {
- mouseEntered = false;
- if (element.classList.contains("autoHiding")) {
- element.classList.add("sbhidden");
- }
- },
- show: () => {
- mouseEntered = true;
- element.classList.remove("animationDone");
-
- // Wait for next event loop
- setTimeout(() => {
- if (mouseEntered) element.classList.remove("sbhidden")
- }, 10);
- }
- };
-}
-
-function setupAutoHideAnimation(element: Element, container: Element, enabled = true, rightSlide = true): void {
- const { hide, show } = this.setupCustomHideAnimation(element, container, enabled, rightSlide);
-
- container.addEventListener("mouseleave", () => hide());
- container.addEventListener("mouseenter", () => show());
-}
-
-function enableAutoHideAnimation(element: Element): void {
- element.classList.add("autoHiding");
- element.classList.add("sbhidden");
-}
-
-function disableAutoHideAnimation(element: Element): void {
- element.classList.remove("autoHiding");
- element.classList.remove("sbhidden");
-}
-
-export const AnimationUtils = {
- applyLoadingAnimation,
- setupAutoHideAnimation,
- setupCustomHideAnimation,
- enableAutoHideAnimation,
- disableAutoHideAnimation
-};
\ No newline at end of file
From e7d55d2bac9575624c24e9272bbc1bf890b3b4d3 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 25 Jan 2024 19:38:10 -0500
Subject: [PATCH 073/505] Fix preview bar end time sometimes being inaccurate
---
src/js-components/previewBar.ts | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index ef5d104505..5e002fb9b9 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -274,6 +274,7 @@ class PreviewBar {
return (b[1] - b[0]) - (a[1] - a[0]);
});
for (const segment of sortedSegments) {
+ if (segment.actionType === ActionType.Chapter) continue;
const bar = this.createBar(segment);
this.container.appendChild(bar);
@@ -313,7 +314,7 @@ class PreviewBar {
bar.style.left = this.timeToPercentage(startTime);
if (duration > 0) {
- bar.style.right = this.timeToPercentage(this.videoDuration - endTime);
+ bar.style.right = this.timeToRightPercentage(endTime);
}
if (this.chapterFilter(barSegment) && segment[1] < this.videoDuration) {
bar.style.marginRight = `${this.chapterMargin}px`;
@@ -886,6 +887,10 @@ class PreviewBar {
return `${this.timeToDecimal(time) * 100}%`
}
+ timeToRightPercentage(time: number): string {
+ return `${(1 - this.timeToDecimal(time)) * 100}%`
+ }
+
timeToDecimal(time: number): number {
return this.decimalTimeConverter(time, true);
}
From 926423db5c5e44ce10906dd59f1269c34a57549d Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 30 Jan 2024 23:12:03 -0500
Subject: [PATCH 074/505] Fix compatibility with vinegar on Safari
---
maze-utils | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maze-utils b/maze-utils
index 65609595a9..08d3f65d35 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 65609595a9af1cdc66ab49e765d3759cf5a56ca3
+Subproject commit 08d3f65d3541fbb9198e565e2185edf4a27c16b0
From b533c6c1c81cefd87830a9aa7ab087704e2bbc19 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 30 Jan 2024 23:12:28 -0500
Subject: [PATCH 075/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index fee1745f70..a922227851 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit fee1745f701ba9909cf9f5c3d1e9ccfc954c9bbb
+Subproject commit a922227851e24f8f29d6406af09c80e69411b7c3
From fdf1a6acf916d516675b3fd909a2ac04ef4b8590 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 30 Jan 2024 23:12:36 -0500
Subject: [PATCH 076/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 44e2dfa8b6..f176a6d4b8 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.3",
+ "version": "5.5.4",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 7cb413db15c89e678785f1ded3f9fdf2ff07f47b Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 31 Jan 2024 18:58:06 -0500
Subject: [PATCH 077/505] Don't display preview bar while scrubbing on mobile
Should help with #1962
---
src/content.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index 71434eb7af..51b96aeba1 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -454,7 +454,9 @@ function videoIDChange(): void {
}
function handleMobileControlsMutations(): void {
- if (!chrome.runtime?.id) return;
+ // Don't update while scrubbing
+ if (!chrome.runtime?.id
+ || document.querySelector(".YtProgressBarProgressBarPlayheadDotInDragging")) return;
updateVisibilityOfPlayerControlsButton();
From c0bc068a18e0423f69a987c5bcf37bd5b42f1ad7 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 31 Jan 2024 19:06:16 -0500
Subject: [PATCH 078/505] Handle exceptions for voting
Maybe fixes #1961
---
src/background.ts | 46 +++++++++++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/src/background.ts b/src/background.ts
index 161ee45a25..812482af73 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -222,27 +222,35 @@ async function submitVote(type: number, UUID: string, category: string) {
const typeSection = (type !== undefined) ? "&type=" + type : "&category=" + category;
- //publish this vote
- const response = await asyncRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + typeSection);
-
- if (response.ok) {
- return {
- successType: 1,
- responseText: await response.text()
- };
- } else if (response.status == 405) {
- //duplicate vote
- return {
- successType: 0,
- statusCode: response.status,
- responseText: await response.text()
- };
- } else {
- //error while connect
+ try {
+ const response = await asyncRequestToServer("POST", "/api/voteOnSponsorTime?UUID=" + UUID + "&userID=" + userID + typeSection);
+
+ if (response.ok) {
+ return {
+ successType: 1,
+ responseText: await response.text()
+ };
+ } else if (response.status == 405) {
+ //duplicate vote
+ return {
+ successType: 0,
+ statusCode: response.status,
+ responseText: await response.text()
+ };
+ } else {
+ //error while connect
+ return {
+ successType: -1,
+ statusCode: response.status,
+ responseText: await response.text()
+ };
+ }
+ } catch (e) {
+ console.error(e);
return {
successType: -1,
- statusCode: response.status,
- responseText: await response.text()
+ statusCode: -1,
+ responseText: ""
};
}
}
From e0fe0fad671364cfb94df3bde5a9a17b23b25003 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 1 Feb 2024 13:31:19 -0500
Subject: [PATCH 079/505] Don't close submission menu if submission didn't go
through
Fxies submission menu closing for warning about previewing a segment
---
src/components/SubmissionNoticeComponent.tsx | 10 ++++++----
src/content.ts | 12 ++++++++----
src/render/SubmissionNotice.tsx | 4 ++--
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx
index 7ddc3e0ee4..2cf394f190 100644
--- a/src/components/SubmissionNoticeComponent.tsx
+++ b/src/components/SubmissionNoticeComponent.tsx
@@ -14,7 +14,7 @@ export interface SubmissionNoticeProps {
// Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer;
- callback: () => unknown;
+ callback: () => Promise;
closeListener: () => void;
}
@@ -239,9 +239,11 @@ class SubmissionNoticeComponent extends React.Component {
+ if (success) {
+ this.cancel();
+ }
+ });
}
sortSegments(): void {
diff --git a/src/content.ts b/src/content.ts
index 51b96aeba1..ee328d92a7 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2265,13 +2265,13 @@ function submitSegments() {
//send the message to the background js
//called after all the checks have been made that it's okay to do so
-async function sendSubmitMessage() {
+async function sendSubmitMessage(): Promise {
// check if all segments are full video
const onlyFullVideo = sponsorTimesSubmitting.every((segment) => segment.actionType === ActionType.Full);
// Block if submitting on a running livestream or premiere
if (!onlyFullVideo && (getIsLivePremiere() || isVisible(document.querySelector(".ytp-live-badge")))) {
alert(chrome.i18n.getMessage("liveOrPremiere"));
- return;
+ return false;
}
if (!previewedSegment
@@ -2279,7 +2279,7 @@ async function sendSubmitMessage() {
[ActionType.Full, ActionType.Chapter, ActionType.Poi].includes(segment.actionType)
|| segment.segment[1] >= getVideo()?.duration)) {
alert(`${chrome.i18n.getMessage("previewSegmentRequired")} ${keybindToString(Config.config.previewKeybind)}`);
- return;
+ return false;
}
// Add loading animation
@@ -2305,7 +2305,7 @@ async function sendSubmitMessage() {
const confirmShort = chrome.i18n.getMessage("shortCheck") + "\n\n" +
getSegmentsMessage(sponsorTimesSubmitting);
- if(!confirm(confirmShort)) return;
+ if(!confirm(confirmShort)) return false;
}
}
}
@@ -2355,6 +2355,8 @@ async function sendSubmitMessage() {
if (fullVideoSegment) {
categoryPill?.setSegment(fullVideoSegment);
}
+
+ return true;
} else {
// Show that the upload failed
playerButtons.submit.button.style.animation = "unset";
@@ -2366,6 +2368,8 @@ async function sendSubmitMessage() {
alert(getErrorMessage(response.status, response.responseText));
}
}
+
+ return false;
}
//get the message that visually displays the video times
diff --git a/src/render/SubmissionNotice.tsx b/src/render/SubmissionNotice.tsx
index 5e9fbfbda6..c0159cc09e 100644
--- a/src/render/SubmissionNotice.tsx
+++ b/src/render/SubmissionNotice.tsx
@@ -11,7 +11,7 @@ class SubmissionNotice {
// Contains functions and variables from the content script needed by the skip notice
contentContainer: () => unknown;
- callback: () => unknown;
+ callback: () => Promise;
noticeRef: React.MutableRefObject;
@@ -19,7 +19,7 @@ class SubmissionNotice {
root: Root;
- constructor(contentContainer: ContentContainer, callback: () => unknown) {
+ constructor(contentContainer: ContentContainer, callback: () => Promise) {
this.noticeRef = React.createRef();
this.contentContainer = contentContainer;
From 0cca1c3566862bcefb7c82eaf6f2b22008ed6404 Mon Sep 17 00:00:00 2001
From: HanYaodong
Date: Fri, 2 Feb 2024 19:31:22 +0800
Subject: [PATCH 080/505] Fix license info in README
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index d4589bdde8..63e17e13ec 100644
--- a/README.md
+++ b/README.md
@@ -75,4 +75,4 @@ Icons made by:
### License
-This project is licensed under GNU LGPL v3 or any later version
+This project is licensed under GNU GPL v3 or any later version
From 5d871d5fe76217e3f962ec464bb7d8a84d426056 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 13 Feb 2024 21:32:23 -0500
Subject: [PATCH 081/505] Fix hidden mute segments sometimes still muting
---
src/content.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/content.ts b/src/content.ts
index ee328d92a7..934b9d6705 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -772,6 +772,7 @@ function getVirtualTime(): number {
function inMuteSegment(currentTime: number, includeOverlap: boolean): boolean {
const checkFunction = (segment) => segment.actionType === ActionType.Mute
+ && segment.hidden === SponsorHideType.Visible
&& segment.segment[0] <= currentTime
&& (segment.segment[1] > currentTime || (includeOverlap && segment.segment[1] + 0.02 > currentTime));
return sponsorTimes?.some(checkFunction) || sponsorTimesSubmitting.some(checkFunction);
From 3382d8a5006430d248763dbaa93b2183367a5f76 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 13 Feb 2024 21:52:10 -0500
Subject: [PATCH 082/505] Fix chapter names not appearing
---
src/content.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/content.ts b/src/content.ts
index 934b9d6705..8413b76bf3 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2396,6 +2396,8 @@ function getSegmentsMessage(sponsorTimes: SponsorTime[]): string {
}
function updateActiveSegment(currentTime: number): void {
+ previewBar?.updateChapterText(sponsorTimes, sponsorTimesSubmitting, currentTime);
+
chrome.runtime.sendMessage({
message: "time",
time: currentTime
From 0b7a2fd197a2b961f3a7a2c00819f2c4022bbcc0 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 13 Feb 2024 22:32:37 -0500
Subject: [PATCH 083/505] Fix adding custom Invidious instances on Firefox
Fixes #815
---
src/background.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/background.ts b/src/background.ts
index 812482af73..23914f4693 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -160,8 +160,8 @@ async function registerFirefoxContentScript(options: Registration) {
ids: [options.id]
}).catch(() => []);
- if (existingRegistrations.length > 0
- && existingRegistrations[0].matches.every((match) => options.matches.includes(match))) {
+ if (existingRegistrations && existingRegistrations.length > 0
+ && options.matches.every((match) => existingRegistrations[0].matches.includes(match))) {
// No need to register another script, already registered
return;
}
From 7c661f8e67488ded17a406940a9bec0f948bd154 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 13 Feb 2024 22:33:11 -0500
Subject: [PATCH 084/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index a922227851..96f860dc1d 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit a922227851e24f8f29d6406af09c80e69411b7c3
+Subproject commit 96f860dc1d05882090f5931db699b0fe5ef6b8ce
From 9d04482d190dcc54ce62d6be97cb2f6e6950fc5b Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 13 Feb 2024 22:35:44 -0500
Subject: [PATCH 085/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index f176a6d4b8..6cb5e61f91 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.4",
+ "version": "5.5.5",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From e7f4be2d57d94b6e0593aaff7449593cf69ff7c5 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 21 Feb 2024 14:32:44 -0500
Subject: [PATCH 086/505] Don't require preview for starting segments
---
src/content.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/content.ts b/src/content.ts
index 8413b76bf3..504ba8d59c 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2278,7 +2278,8 @@ async function sendSubmitMessage(): Promise {
if (!previewedSegment
&& !sponsorTimesSubmitting.every((segment) =>
[ActionType.Full, ActionType.Chapter, ActionType.Poi].includes(segment.actionType)
- || segment.segment[1] >= getVideo()?.duration)) {
+ || segment.segment[1] >= getVideo()?.duration
+ || segment.segment[0] === 0)) {
alert(`${chrome.i18n.getMessage("previewSegmentRequired")} ${keybindToString(Config.config.previewKeybind)}`);
return false;
}
From 6566c129c7a24b2dfe976770a6b17613d68bbbb7 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sat, 24 Feb 2024 18:53:26 -0500
Subject: [PATCH 087/505] Fix issue with BlockTube version 0.4.1
---
maze-utils | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maze-utils b/maze-utils
index 08d3f65d35..9fbde12534 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 08d3f65d3541fbb9198e565e2185edf4a27c16b0
+Subproject commit 9fbde125340f664ae6bca1e6374f72851fbcdbad
From e6db5b43ff1310fd760fc13efb35bb67155d57be Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sat, 24 Feb 2024 18:54:11 -0500
Subject: [PATCH 088/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 96f860dc1d..3f17e35086 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 96f860dc1d05882090f5931db699b0fe5ef6b8ce
+Subproject commit 3f17e350861638b1c58da3cf2381ec681dd9ed7b
From 5f8447ec6be56dd24bc45d3c5f6399499946a022 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Sat, 24 Feb 2024 18:54:19 -0500
Subject: [PATCH 089/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 6cb5e61f91..88ffa6b8f6 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.5",
+ "version": "5.5.6",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 1909e66c87fad875ac22683e524071fc88fb97dc Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 27 Feb 2024 22:13:58 -0500
Subject: [PATCH 090/505] Move category pill to top if on description on right
layout
---
public/content.css | 12 ++++++++++++
src/components/CategoryPillComponent.tsx | 10 ++++++++--
src/render/CategoryPill.tsx | 12 ++++++++++--
3 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/public/content.css b/public/content.css
index 285ba11d26..7dd3c33f88 100644
--- a/public/content.css
+++ b/public/content.css
@@ -780,6 +780,18 @@ input::-webkit-inner-spin-button {
line-height: 1.5em;
}
+/* Description on right layout */
+#title > #categoryPillParent {
+ font-size: 2rem;
+ font-weight: bold;
+ display: flex;
+ justify-content: center;
+ line-height: 2.8rem;
+}
+#title > #categoryPillParent > #categoryPill.cbPillOpen {
+ margin-bottom: 5px;
+}
+
#categoryPillParent {
height: fit-content;
margin-top: auto;
diff --git a/src/components/CategoryPillComponent.tsx b/src/components/CategoryPillComponent.tsx
index 36e31b472b..e4c5a3ed87 100644
--- a/src/components/CategoryPillComponent.tsx
+++ b/src/components/CategoryPillComponent.tsx
@@ -23,12 +23,14 @@ export interface CategoryPillState {
}
class CategoryPillComponent extends React.Component {
-
+ mainRef: React.MutableRefObject;
tooltip?: Tooltip;
constructor(props: CategoryPillProps) {
super(props);
+ this.mainRef = React.createRef();
+
this.state = {
segment: null,
show: false,
@@ -43,13 +45,17 @@ class CategoryPillComponent extends React.Component this.toggleOpen(e)}
onMouseEnter={() => this.openTooltip()}
- onMouseLeave={() => this.closeTooltip()}>
+ onMouseLeave={() => this.closeTooltip()}
+ ref={this.mainRef}>
{
- const referenceNode =
+ let referenceNode =
await waitFor(() => getYouTubeTitleNode());
+ // Experimental YouTube layout with description on right
+ const isOnDescriptionOnRightLayout = document.querySelector("#title #description");
+ if (isOnDescriptionOnRightLayout) {
+ referenceNode = referenceNode.parentElement;
+ }
+
if (referenceNode && !referenceNode.contains(this.container)) {
if (!this.container) {
this.container = document.createElement('span');
@@ -91,7 +97,9 @@ export class CategoryPill {
parent.appendChild(this.container);
referenceNode.prepend(parent);
- referenceNode.style.display = "flex";
+ if (!isOnDescriptionOnRightLayout) {
+ referenceNode.style.display = "flex";
+ }
}
}
From 88526aa46ee73eebb58e2e0ff64ec1d2413ef8b5 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Tue, 27 Feb 2024 22:16:53 -0500
Subject: [PATCH 091/505] Fix missing key in tooltip and update maze utils
---
maze-utils | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/maze-utils b/maze-utils
index 9fbde12534..8c0385deb5 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 9fbde125340f664ae6bca1e6374f72851fbcdbad
+Subproject commit 8c0385deb54414bf5436e4a1a59e1a87f3a5f41e
From 742eb7ef57e1de436553eed20c45bf9542a86369 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 28 Feb 2024 01:13:57 -0500
Subject: [PATCH 092/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 88ffa6b8f6..9ad1f384ae 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.6",
+ "version": "5.5.7",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 154bb1749d7fa111cef024a3d29d3f8f3cdf021c Mon Sep 17 00:00:00 2001
From: HanYaodong
Date: Thu, 29 Feb 2024 12:36:06 +0800
Subject: [PATCH 093/505] Stop refresh animation on popup when not on youtube
page
---
src/content.ts | 7 ++++++-
src/popup.ts | 6 ++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/content.ts b/src/content.ts
index 504ba8d59c..f89fb369f2 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -258,7 +258,12 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
break;
case "refreshSegments":
// update video on refresh if videoID invalid
- if (!getVideoID()) checkVideoIDChange();
+ if (!getVideoID()) {
+ checkVideoIDChange().then(() => {
+ // if still no video ID found, return an empty info to the popup
+ if (!getVideoID()) chrome.runtime.sendMessage({ message: "infoUpdated" });
+ });
+ }
// fetch segments
sponsorsLookup(false);
diff --git a/src/popup.ts b/src/popup.ts
index 86e79f5468..f954f1682f 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -465,8 +465,8 @@ async function runThePopup(messageListener?: MessageListener): Promise {
return;
}
- //if request is undefined, then the page currently being browsed is not YouTube
- if (request != undefined) {
+ // if request has no field other than message, then the page currently being browsed is not YouTube
+ if (request.found != undefined) {
//remove loading text
PageElements.mainControls.style.display = "block";
if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
@@ -490,6 +490,8 @@ async function runThePopup(messageListener?: MessageListener): Promise {
PageElements.issueReporterImportExport.classList.remove("hidden");
}
+ } else {
+ displayNoVideo();
}
//see if whitelist button should be swapped
From e9b7abd219e8116aa8ada68687a88e6a7b089fc2 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 7 Mar 2024 17:20:23 -0500
Subject: [PATCH 094/505] Fix rate-limiting when setting options from options
page
---
maze-utils | 2 +-
src/options.ts | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/maze-utils b/maze-utils
index 8c0385deb5..036086403f 160000
--- a/maze-utils
+++ b/maze-utils
@@ -1 +1 @@
-Subproject commit 8c0385deb54414bf5436e4a1a59e1a87f3a5f41e
+Subproject commit 036086403f675b8fea0e22065f26ba534e351562
diff --git a/src/options.ts b/src/options.ts
index 6e96328827..e983498f32 100644
--- a/src/options.ts
+++ b/src/options.ts
@@ -286,7 +286,7 @@ async function init() {
break;
case "resetToDefault":
Config.resetToDefault();
- window.location.reload();
+ setTimeout(() => window.location.reload(), 200);
break;
}
});
@@ -632,8 +632,7 @@ async function setTextOption(option: string, element: HTMLElement, value: string
await invidiousOnClick(checkbox, "supportInvidious");
}
- window.location.reload();
-
+ setTimeout(() => window.location.reload(), 200);
} catch (e) {
alert(chrome.i18n.getMessage("incorrectlyFormattedOptions"));
}
From f55f2606a729047267a90eb0036f13bdf18053f2 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 7 Mar 2024 17:21:50 -0500
Subject: [PATCH 095/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index 9ad1f384ae..af795c7dff 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.7",
+ "version": "5.5.8",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From 6c710363567e76dcfc58cc1189c18ab66968351c Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 7 Mar 2024 17:22:22 -0500
Subject: [PATCH 096/505] update translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index 3f17e35086..01ee778967 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 3f17e350861638b1c58da3cf2381ec681dd9ed7b
+Subproject commit 01ee7789673ac009fe1ea10be66fda7698534c4c
From 25b53754bab47cee6d63ed58fa3ce2cbdf504c79 Mon Sep 17 00:00:00 2001
From: HanYaodong
Date: Sat, 9 Mar 2024 23:38:09 +0800
Subject: [PATCH 097/505] Stop refresh animation on popup when content script
is not injected
---
src/content.ts | 8 ++++----
src/messageTypes.ts | 7 ++++++-
src/popup.ts | 13 +++++++++++--
3 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/content.ts b/src/content.ts
index f89fb369f2..a7b8c45b06 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -259,11 +259,11 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
case "refreshSegments":
// update video on refresh if videoID invalid
if (!getVideoID()) {
- checkVideoIDChange().then(() => {
- // if still no video ID found, return an empty info to the popup
- if (!getVideoID()) chrome.runtime.sendMessage({ message: "infoUpdated" });
- });
+ checkVideoIDChange();
}
+ // if popup rescieves no response, or the videoID is invalid,
+ // it will assume the page is not a video page and stop the refresh animation
+ sendResponse({ hasVideo: getVideoID() != null });
// fetch segments
sponsorsLookup(false);
diff --git a/src/messageTypes.ts b/src/messageTypes.ts
index 339bfafe22..191166a00e 100644
--- a/src/messageTypes.ts
+++ b/src/messageTypes.ts
@@ -103,7 +103,8 @@ export type MessageResponse =
| IsChannelWhitelistedResponse
| Record // empty object response {}
| VoteResponse
- | ImportSegmentsResponse;
+ | ImportSegmentsResponse
+ | RefreshSegmentsResponse;
export interface VoteResponse {
successType: number;
@@ -115,6 +116,10 @@ interface ImportSegmentsResponse {
importedSegments: SponsorTime[];
}
+export interface RefreshSegmentsResponse {
+ hasVideo: boolean;
+}
+
export interface TimeUpdateMessage {
message: "time";
time: number;
diff --git a/src/popup.ts b/src/popup.ts
index f954f1682f..b986a2ed6b 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -15,6 +15,7 @@ import {
Message,
MessageResponse,
PopupMessage,
+ RefreshSegmentsResponse,
SponsorStartResponse,
VoteResponse,
} from "./messageTypes";
@@ -982,9 +983,17 @@ async function runThePopup(messageListener?: MessageListener): Promise {
stopLoadingAnimation = AnimationUtils.applyLoadingAnimation(PageElements.refreshSegmentsButton, 0.3);
}
- function refreshSegments() {
+ async function refreshSegments() {
startLoadingAnimation();
- sendTabMessage({ message: 'refreshSegments' });
+ const response = await sendTabMessageAsync({ message: 'refreshSegments' }) as RefreshSegmentsResponse;
+
+ if (response == null || !response.hasVideo) {
+ if (stopLoadingAnimation != null) {
+ stopLoadingAnimation();
+ stopLoadingAnimation = null;
+ }
+ displayNoVideo();
+ }
}
function skipSegment(actionType: ActionType, UUID: SegmentUUID, element?: HTMLElement): void {
From a1505bcf205c609e7ddd65b941562e26ceecd19f Mon Sep 17 00:00:00 2001
From: HanYaodong
Date: Sat, 9 Mar 2024 23:47:48 +0800
Subject: [PATCH 098/505] Refractor popup infoFound() empty message detection
---
src/popup.ts | 48 ++++++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/src/popup.ts b/src/popup.ts
index b986a2ed6b..2f3a0d7a97 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -460,39 +460,35 @@ async function runThePopup(messageListener?: MessageListener): Promise {
stopLoadingAnimation = null;
}
- if (chrome.runtime.lastError) {
+ if (chrome.runtime.lastError || request == undefined || request.found == undefined) {
//This page doesn't have the injected content script, or at least not yet
+ // Or if the request is empty, meaning the current page is not YouTube or a video page
displayNoVideo();
return;
}
- // if request has no field other than message, then the page currently being browsed is not YouTube
- if (request.found != undefined) {
- //remove loading text
- PageElements.mainControls.style.display = "block";
- if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
- PageElements.whitelistButton.classList.remove("hidden");
- PageElements.loadingIndicator.style.display = "none";
-
- downloadedTimes = request.sponsorTimes ?? [];
- displayDownloadedSponsorTimes(downloadedTimes, request.time);
- if (request.found) {
- PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsorFound");
- PageElements.issueReporterImportExport.classList.remove("hidden");
- } else if (request.status == 404 || request.status == 200) {
- PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsor404");
- PageElements.issueReporterImportExport.classList.remove("hidden");
+ //remove loading text
+ PageElements.mainControls.style.display = "block";
+ if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden");
+ PageElements.whitelistButton.classList.remove("hidden");
+ PageElements.loadingIndicator.style.display = "none";
+
+ downloadedTimes = request.sponsorTimes ?? [];
+ displayDownloadedSponsorTimes(downloadedTimes, request.time);
+ if (request.found) {
+ PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsorFound");
+ PageElements.issueReporterImportExport.classList.remove("hidden");
+ } else if (request.status == 404 || request.status == 200) {
+ PageElements.videoFound.innerHTML = chrome.i18n.getMessage("sponsor404");
+ PageElements.issueReporterImportExport.classList.remove("hidden");
+ } else {
+ if (request.status) {
+ PageElements.videoFound.innerHTML = chrome.i18n.getMessage("connectionError") + request.status;
} else {
- if (request.status) {
- PageElements.videoFound.innerHTML = chrome.i18n.getMessage("connectionError") + request.status;
- } else {
- PageElements.videoFound.innerHTML = chrome.i18n.getMessage("segmentsStillLoading");
- }
-
- PageElements.issueReporterImportExport.classList.remove("hidden");
+ PageElements.videoFound.innerHTML = chrome.i18n.getMessage("segmentsStillLoading");
}
- } else {
- displayNoVideo();
+
+ PageElements.issueReporterImportExport.classList.remove("hidden");
}
//see if whitelist button should be swapped
From 2dca0d75263abf0b8a85a0401695138b456680fc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 16 Mar 2024 23:28:04 +0000
Subject: [PATCH 099/505] Bump follow-redirects from 1.15.4 to 1.15.6
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)
---
updated-dependencies:
- dependency-name: follow-redirects
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
---
package-lock.json | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index ada131593c..c5c5db5f3b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6110,9 +6110,9 @@
"dev": true
},
"node_modules/follow-redirects": {
- "version": "1.15.4",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
- "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
+ "version": "1.15.6",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
+ "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"dev": true,
"funding": [
{
@@ -18369,9 +18369,9 @@
"dev": true
},
"follow-redirects": {
- "version": "1.15.4",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
- "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
+ "version": "1.15.6",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
+ "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"dev": true
},
"for-each": {
From de094cb11f69b3b19dfb4dc3ce317cbd132eff32 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 18 Mar 2024 19:45:35 -0400
Subject: [PATCH 100/505] Add option to store downvotes when done in private
tabs
---
public/_locales | 2 +-
public/options/options.html | 14 +++++++++++++-
src/config.ts | 2 ++
src/utils.ts | 3 ++-
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/public/_locales b/public/_locales
index 01ee778967..afc1c61dce 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit 01ee7789673ac009fe1ea10be66fda7698534c4c
+Subproject commit afc1c61dcea11bb9723105ff7730951ec9303d91
diff --git a/public/options/options.html b/public/options/options.html
index 146b79567e..b8746c5dda 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -634,7 +634,19 @@ __MSG_exportOtherData__
__MSG_whatTrackDownvotes__
-
+
+
+
+
+
+
+
+
__MSG_copyDebugInformation__
diff --git a/src/config.ts b/src/config.ts
index 81f41997ea..85847a5e63 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -29,6 +29,7 @@ interface SBConfig {
trackViewCount: boolean;
trackViewCountInPrivate: boolean;
trackDownvotes: boolean;
+ trackDownvotesInPrivate: boolean;
dontShowNotice: boolean;
noticeVisibilityMode: NoticeVisbilityMode;
hideVideoPlayerControls: boolean;
@@ -290,6 +291,7 @@ const syncDefaults = {
trackViewCount: true,
trackViewCountInPrivate: true,
trackDownvotes: true,
+ trackDownvotesInPrivate: false,
dontShowNotice: false,
noticeVisibilityMode: NoticeVisbilityMode.FadedForAutoSkip,
hideVideoPlayerControls: false,
diff --git a/src/utils.ts b/src/utils.ts
index c96a7772aa..7c3f985eeb 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -281,7 +281,8 @@ export default class Utils {
}
async addHiddenSegment(videoID: VideoID, segmentUUID: string, hidden: SponsorHideType) {
- if (chrome.extension.inIncognitoContext || !Config.config.trackDownvotes) return;
+ if ((chrome.extension.inIncognitoContext && !Config.config.trackDownvotesInPrivate)
+ || !Config.config.trackDownvotes) return;
const hashedVideoID = (await getHash(videoID, 1)).slice(0, 4) as VideoID & HashedValue;
const UUIDHash = await getHash(segmentUUID, 1);
From 6732850b4186b74aae73fdce894d9e71699728dd Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 18 Mar 2024 20:58:07 -0400
Subject: [PATCH 101/505] Fix chapters not changing when skipping is disabled
---
src/js-components/previewBar.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index 5e002fb9b9..db452bfaf0 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -748,6 +748,7 @@ class PreviewBar {
updateChapterText(segments: SponsorTime[], submittingSegments: SponsorTime[], currentTime: number): SponsorTime[] {
if (!Config.config.showSegmentNameInChapterBar
+ || Config.config.disableSkipping
|| ((!segments || segments.length <= 0) && submittingSegments?.length <= 0)) {
const chaptersContainer = this.getChaptersContainer();
if (chaptersContainer) {
From d8057fb5475af94dadf535fe9d4b43012bba5372 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 18 Mar 2024 21:03:09 -0400
Subject: [PATCH 102/505] bump translations
---
public/_locales | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/_locales b/public/_locales
index afc1c61dce..9cfc718fd2 160000
--- a/public/_locales
+++ b/public/_locales
@@ -1 +1 @@
-Subproject commit afc1c61dcea11bb9723105ff7730951ec9303d91
+Subproject commit 9cfc718fd28a312088eac165d52fd67251b83893
From de830cda4868f2398fc1cb70da748cb56763be6a Mon Sep 17 00:00:00 2001
From: Ajay
Date: Mon, 18 Mar 2024 21:03:23 -0400
Subject: [PATCH 103/505] bump version
---
manifest/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest/manifest.json b/manifest/manifest.json
index af795c7dff..81e4783a38 100644
--- a/manifest/manifest.json
+++ b/manifest/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
- "version": "5.5.8",
+ "version": "5.5.9",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",
From e14b3c76f9a5698aa09ae1f02c77e08077c195ad Mon Sep 17 00:00:00 2001
From: Ajay
Date: Wed, 27 Mar 2024 16:14:10 -0400
Subject: [PATCH 104/505] Improve submission box padding
---
src/components/SponsorTimeEditComponent.tsx | 71 +++++++++++----------
1 file changed, 36 insertions(+), 35 deletions(-)
diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx
index 0564293a26..527dbbe2e3 100644
--- a/src/components/SponsorTimeEditComponent.tsx
+++ b/src/components/SponsorTimeEditComponent.tsx
@@ -272,48 +272,49 @@ class SponsorTimeEditComponent extends React.Component
): ""}
-
-
{/* Editing Tools */}
-
-
- {(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(this.state.selectedActionType))
- && this.state.selectedActionType !== ActionType.Chapter ? (
-
- {(!isNaN(segment[1]) && this.state.selectedActionType != ActionType.Full) ? (
-
- ): ""}
);
}
From e1d656f43f8b3cfb40e1c521e4103d61db756872 Mon Sep 17 00:00:00 2001
From: Ajay
Date: Thu, 4 Apr 2024 13:54:47 -0400
Subject: [PATCH 105/505] Make notice visibility option not appear when notice
disabled
---
public/options/options.html | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/public/options/options.html b/public/options/options.html
index b8746c5dda..b9258f33c1 100644
--- a/public/options/options.html
+++ b/public/options/options.html
@@ -219,20 +219,22 @@
__MSG_showSkipNotice__
-
-
-
-
-
+
+
+
+
+
+
+
-
+