-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbk.js
35 lines (30 loc) · 772 Bytes
/
bk.js
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
import {colorPage,googleColor} from './colors.js';
import {search_for} from './search.js'
chrome.action.onClicked.addListener((tab) =>
{
if(tab.url.includes("google.co"))
{
chrome.scripting.executeScript
({
target: { tabId: tab.id },
function: googleColor
});
}
else if(!tab.url.includes("chrome://"))
{
chrome.scripting.executeScript
({
target: { tabId: tab.id },
function: colorPage
});
chrome.scripting.executeScript
({
target: { tabId: tab.id },
function: search_for
});
}
});
chrome.runtime.onInstalled.addListener(async () => {
chrome.action.setPopup({popup: "main.html"});
chrome.storage.sync.set({Visit:1}, function() {});
});