aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render/SkipNotice.tsx
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-08-31 11:10:33 -0400
committerAjay Ramachandran <[email protected]>2020-08-31 11:10:33 -0400
commitabe6c280a06f1878e9faf6be2905e1be8649913a (patch)
tree52d3c1f52552b7169bc977e09985c8ef7cba63ab /src/render/SkipNotice.tsx
parentcdf6aa5e65588c8b7c457baf8e946614841f5a49 (diff)
downloadSponsorBlock-abe6c280a06f1878e9faf6be2905e1be8649913a.tar.gz
SponsorBlock-abe6c280a06f1878e9faf6be2905e1be8649913a.zip
Moved notice on youtube music to area that is not click hijacking
Diffstat (limited to 'src/render/SkipNotice.tsx')
-rw-r--r--src/render/SkipNotice.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/render/SkipNotice.tsx b/src/render/SkipNotice.tsx
index 81f4c026..d01e08fa 100644
--- a/src/render/SkipNotice.tsx
+++ b/src/render/SkipNotice.tsx
@@ -2,19 +2,19 @@ import * as React from "react";
import * as ReactDOM from "react-dom";
import SkipNoticeComponent from "../components/SkipNoticeComponent";
-import { SponsorTime } from "../types";
+import { SponsorTime, ContentContainer } from "../types";
class SkipNotice {
segments: SponsorTime[];
autoSkip: boolean;
// Contains functions and variables from the content script needed by the skip notice
- contentContainer: () => any;
+ contentContainer: ContentContainer;
noticeElement: HTMLDivElement;
skipNoticeRef: React.MutableRefObject<SkipNoticeComponent>;
- constructor(segments: SponsorTime[], autoSkip: boolean = false, contentContainer) {
+ constructor(segments: SponsorTime[], autoSkip: boolean = false, contentContainer: ContentContainer) {
this.segments = segments;
this.autoSkip = autoSkip;
this.contentContainer = contentContainer;
@@ -35,6 +35,10 @@ class SkipNotice {
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;
//this is the suffix added at the end of every id