-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
40 lines (32 loc) · 1.04 KB
/
script.js
File metadata and controls
40 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
createRequest = function () {} // Override securlys request method
// Called for each tab every secound
function ran() {
document.getElementById("securlyOverlay").remove(); // Remove the overlay
}
// Loop through tabs and remove the overlay
async function injectScript() {
// Get all of chromes open tabs
const tabs = await new Promise((resolve) => {
chrome.tabs.query({}, resolve);
});
// Cycle through each tab
for (var tab of tabs) {
// Make sure the tab exists
if (!tab || !tab.id) {
console.error("No valid tab found");
continue;
}
try {
// Try to remove the overlay for a tab
await chrome.scripting.executeScript({
target: { tabId: tab.id },
func: ran,
});
console.log(`Injected into tab ${tab.id}`);
} catch (err) {
console.error(`Failed to inject into tab ${tab.id}:`, err);
}
}
}
// Check tabs every 1 secound
setInterval(injectScript, 1000);