Add support for live updating in chrome

This commit is contained in:
Ajay
2023-07-29 01:41:57 -04:00
parent 90bb9a4d02
commit dc91ee76ca
7 changed files with 87 additions and 24 deletions

View File

@@ -7,6 +7,7 @@ import { Category, SegmentUUID, SponsorTime } from "../types";
import { Tooltip } from "./Tooltip";
import { waitFor } from "../maze-utils";
import { getYouTubeTitleNode } from "../maze-utils/elements";
import { addCleanupListener } from "../maze-utils/cleanup";
const id = "categoryPill";
@@ -24,6 +25,12 @@ export class CategoryPill {
constructor() {
this.ref = React.createRef();
addCleanupListener(() => {
if (this.mutationObserver) {
this.mutationObserver.disconnect();
}
});
}
async attachToPage(onMobileYouTube: boolean, onInvidious: boolean,