MCPcopy Index your code
hub / github.com/RutvijDv/Meet-Script / callStarts

Function callStarts

content.js:51–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51function callStarts() {
52 const subtitleDiv = document.querySelector("div[jscontroller='TEjq6e']");
53 MEET_CODE = window.location.pathname;
54 MEET_CODE = MEET_CODE.substr(1, MEET_CODE.length - 1);
55 chrome.storage.sync.get(["meet_code", "script"], function (result) {
56
57 if (result.meet_code && result.meet_code == MEET_CODE) {
58 script = result.script;
59 }
60 chrome.storage.sync.set({
61 script: script
62 })
63 })
64 // To notify the first time
65 IS_SUBTITLE_ON = subtitleDiv.style.display === "none" ? false : true;
66 if (IS_SUBTITLE_ON) whenSubtitleOn();
67 else whenSubtitleOff();
68
69 const subtitleOnOff = new MutationObserver(() => {
70 IS_SUBTITLE_ON = subtitleDiv.style.display === "none" ? false : true;
71 if (IS_SUBTITLE_ON) whenSubtitleOn();
72 else whenSubtitleOff();
73 });
74
75 subtitleOnOff.observe(subtitleDiv, {
76 attributes: true,
77 attributeOldValue: true,
78 attributeFilter: ["style"],
79 });
80};
81
82
83function whenSubtitleOn() {

Callers 1

content.jsFile · 0.85

Calls 2

whenSubtitleOnFunction · 0.85
whenSubtitleOffFunction · 0.85

Tested by

no test coverage detected