mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-29 05:40:52 +03:00
Converted options page to TypeScript
This commit is contained in:
@@ -49,8 +49,8 @@ var previewBar = null;
|
||||
//the player controls on the YouTube player
|
||||
var controls = null;
|
||||
|
||||
// Direct Links
|
||||
videoIDChange(getYouTubeVideoID(document.URL));
|
||||
// Direct Links after the config is loaded
|
||||
utils.wait(() => SB.config !== null).then(() => videoIDChange(getYouTubeVideoID(document.URL)));
|
||||
|
||||
//the last time looked at (used to see if this time is in the interval)
|
||||
var lastTime = -1;
|
||||
@@ -417,7 +417,7 @@ function sponsorsLookup(id: string, channelIDPromise = null) {
|
||||
function getYouTubeVideoID(url: string) {
|
||||
// For YouTube TV support
|
||||
if(url.startsWith("https://www.youtube.com/tv#/")) url = url.replace("#", "");
|
||||
|
||||
|
||||
//Attempt to parse url
|
||||
let urlObject = null;
|
||||
try {
|
||||
@@ -433,7 +433,7 @@ function getYouTubeVideoID(url: string) {
|
||||
} else if (!["www.youtube.com", "www.youtube-nocookie.com"].includes(urlObject.host)) {
|
||||
if (!SB.config) {
|
||||
// Call this later, in case this is an Invidious tab
|
||||
this.wait(() => SB.config !== null).then(() => this.videoIDChange(this.getYouTubeVideoID(url)));
|
||||
utils.wait(() => SB.config !== null).then(() => videoIDChange(getYouTubeVideoID(url)));
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user