mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
add noFallThrough, inplicitReturn, update packages
This commit is contained in:
2976
package-lock.json
generated
2976
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@@ -8,23 +8,23 @@
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chrome": "^0.0.197",
|
||||
"@types/chrome": "^0.0.199",
|
||||
"@types/firefox-webext-browser": "^94.0.1",
|
||||
"@types/jest": "^29.1.2",
|
||||
"@types/jest": "^29.2.0",
|
||||
"@types/react": "^18.0.21",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"@types/selenium-webdriver": "^4.1.5",
|
||||
"@types/selenium-webdriver": "^4.1.6",
|
||||
"@types/wicg-mediasession": "^1.1.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.39.0",
|
||||
"@typescript-eslint/parser": "^5.39.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.40.1",
|
||||
"@typescript-eslint/parser": "^5.40.1",
|
||||
"chromedriver": "^106.0.1",
|
||||
"concurrently": "^7.4.0",
|
||||
"copy-webpack-plugin": "^11.0.0",
|
||||
"eslint": "^8.24.0",
|
||||
"eslint-plugin-react": "^7.31.8",
|
||||
"eslint": "^8.25.0",
|
||||
"eslint-plugin-react": "^7.31.10",
|
||||
"fork-ts-checker-webpack-plugin": "^7.2.13",
|
||||
"jest": "^29.1.2",
|
||||
"jest-environment-jsdom": "^29.1.2",
|
||||
"jest": "^29.2.1",
|
||||
"jest-environment-jsdom": "^29.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"schema-utils": "^4.0.0",
|
||||
"selenium-webdriver": "^4.5.0",
|
||||
@@ -33,7 +33,7 @@
|
||||
"ts-loader": "^9.4.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "4.8",
|
||||
"web-ext": "^7.2.0",
|
||||
"web-ext": "^7.3.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-merge": "^5.8.0"
|
||||
|
||||
@@ -59,16 +59,16 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
|
||||
switch(request.message) {
|
||||
case "openConfig":
|
||||
chrome.tabs.create({url: chrome.runtime.getURL('options/options.html' + (request.hash ? '#' + request.hash : ''))});
|
||||
return;
|
||||
return true;
|
||||
case "openHelp":
|
||||
chrome.tabs.create({url: chrome.runtime.getURL('help/index.html')});
|
||||
return;
|
||||
return true;
|
||||
case "openUpsell":
|
||||
chrome.tabs.create({url: chrome.runtime.getURL('upsell/index.html')});
|
||||
return;
|
||||
return true;
|
||||
case "openPage":
|
||||
chrome.tabs.create({url: chrome.runtime.getURL(request.url)});
|
||||
return;
|
||||
return true;
|
||||
case "sendRequest":
|
||||
sendRequestToCustomServer(request.type, request.url, request.data).then(async (response) => {
|
||||
callback({
|
||||
@@ -112,6 +112,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) {
|
||||
popupPort[sender.tab.id]?.postMessage(request);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -373,6 +373,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
getSubmissionChooser(): JSX.Element[] {
|
||||
|
||||
@@ -2093,7 +2093,7 @@ async function voteAsync(type: number, UUID: SegmentUUID, category?: Category):
|
||||
const sponsorIndex = utils.getSponsorIndexFromUUID(sponsorTimes, UUID);
|
||||
|
||||
// Don't vote for preview sponsors
|
||||
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) return;
|
||||
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) Promise.resolve();
|
||||
|
||||
// See if the local time saved count and skip count should be saved
|
||||
if (type === 0 && sponsorSkipped[sponsorIndex] || type === 1 && !sponsorSkipped[sponsorIndex]) {
|
||||
|
||||
@@ -744,7 +744,7 @@ class PreviewBar {
|
||||
chaptersContainer.style.display = "none";
|
||||
}
|
||||
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
segments ??= [];
|
||||
|
||||
@@ -67,9 +67,13 @@ class MessageHandler {
|
||||
|
||||
// To prevent clickjacking
|
||||
let allowPopup = window === window.top;
|
||||
window.addEventListener("message", async (e) => {
|
||||
window.addEventListener("message", async (e): Promise<void> => {
|
||||
if (e.source !== window.parent) return;
|
||||
if (e.origin.endsWith('.youtube.com')) return allowPopup = true;
|
||||
if (e.origin.endsWith('.youtube.com')) {
|
||||
allowPopup = true;
|
||||
return
|
||||
}
|
||||
else return;
|
||||
});
|
||||
|
||||
//make this a function to allow this to run on the content page
|
||||
|
||||
@@ -319,6 +319,7 @@ export default class Utils {
|
||||
return selection;
|
||||
}
|
||||
}
|
||||
return { name: "None", option: 0} as CategorySelection;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -148,5 +148,13 @@ export function getGuidelineInfo(category: Category): TextBox[] {
|
||||
icon: "icons/check-smaller.svg",
|
||||
text: chrome.i18n.getMessage(`category_${category}_guideline3`)
|
||||
}];
|
||||
default:
|
||||
return [{
|
||||
icon: "icons/segway.png",
|
||||
text: chrome.i18n.getMessage(`generic_guideline1`)
|
||||
}, {
|
||||
icon: "icons/right-arrow.svg",
|
||||
text: chrome.i18n.getMessage(`generic_guideline2`)
|
||||
}];
|
||||
}
|
||||
}
|
||||
@@ -22,5 +22,7 @@ export function urlTimeToSeconds(time: string): number {
|
||||
return hours * 3600 + minutes * 60 + seconds;
|
||||
} else if (/\d+/.test(time)) {
|
||||
return parseInt(time, 10);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"sourceMap": false,
|
||||
"outDir": "dist/js",
|
||||
"noEmitOnError": false,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "dist/js",
|
||||
"noEmitOnError": false,
|
||||
|
||||
Reference in New Issue
Block a user