mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Moved notice on youtube music to area that is not click hijacking
This commit is contained in:
@@ -2,19 +2,19 @@ import * as React from "react";
|
|||||||
import * as ReactDOM from "react-dom";
|
import * as ReactDOM from "react-dom";
|
||||||
|
|
||||||
import SkipNoticeComponent from "../components/SkipNoticeComponent";
|
import SkipNoticeComponent from "../components/SkipNoticeComponent";
|
||||||
import { SponsorTime } from "../types";
|
import { SponsorTime, ContentContainer } from "../types";
|
||||||
|
|
||||||
class SkipNotice {
|
class SkipNotice {
|
||||||
segments: SponsorTime[];
|
segments: SponsorTime[];
|
||||||
autoSkip: boolean;
|
autoSkip: boolean;
|
||||||
// Contains functions and variables from the content script needed by the skip notice
|
// Contains functions and variables from the content script needed by the skip notice
|
||||||
contentContainer: () => any;
|
contentContainer: ContentContainer;
|
||||||
|
|
||||||
noticeElement: HTMLDivElement;
|
noticeElement: HTMLDivElement;
|
||||||
|
|
||||||
skipNoticeRef: React.MutableRefObject<SkipNoticeComponent>;
|
skipNoticeRef: React.MutableRefObject<SkipNoticeComponent>;
|
||||||
|
|
||||||
constructor(segments: SponsorTime[], autoSkip: boolean = false, contentContainer) {
|
constructor(segments: SponsorTime[], autoSkip: boolean = false, contentContainer: ContentContainer) {
|
||||||
this.segments = segments;
|
this.segments = segments;
|
||||||
this.autoSkip = autoSkip;
|
this.autoSkip = autoSkip;
|
||||||
this.contentContainer = contentContainer;
|
this.contentContainer = contentContainer;
|
||||||
@@ -35,6 +35,10 @@ class SkipNotice {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// YouTube Music
|
||||||
|
if (new URL(document.URL).host === "music.youtube.com") {
|
||||||
|
referenceNode = document.querySelector("#main-panel.ytmusic-player-page");
|
||||||
|
}
|
||||||
|
|
||||||
let amountOfPreviousNotices = document.getElementsByClassName("sponsorSkipNotice").length;
|
let amountOfPreviousNotices = document.getElementsByClassName("sponsorSkipNotice").length;
|
||||||
//this is the suffix added at the end of every id
|
//this is the suffix added at the end of every id
|
||||||
|
|||||||
Reference in New Issue
Block a user