mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-19 05:58:37 +03:00
add noFallThrough, inplicitReturn, update packages
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user