-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendCall-script.js
More file actions
23 lines (23 loc) · 827 Bytes
/
endCall-script.js
File metadata and controls
23 lines (23 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
console.log("End call script");
chrome.runtime.onMessage.addListener(function (req, sender, response) {
if (req.url !== location) {
response({ notThisTab: "hmm" });
}
console.log(req);
if (req.endMeetMethod === "call") {
if (document.getElementById("send-message-google-meet"))
document.getElementById("send-message-google-meet").style.display =
"none";
if (document.querySelector('button[aria-label="Leave call"]')) {
document.querySelector('button[aria-label="Leave call"]').click();
chrome.runtime.sendMessage({
sendNotification: true,
message: "Closed meeting " + location,
});
} else {
chrome.runtime.sendMessage({ closeTab: true });
}
} else if (req.endMeetMethod === "tab") {
chrome.runtime.sendMessage({ closeTab: true });
}
});