-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
25 lines (24 loc) · 895 Bytes
/
background.js
File metadata and controls
25 lines (24 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// chrome.tabs.onActivated.addListener(tab => {
// chrome.tabs.get(tab.tabId, current_tab_info => {
// if (/^https:\/\/www\.google/.test(current_tab_info.url)) {
// chrome.tabs.insertCSS(null,{file: "./mystyle.css"})
// chrome.tabs.executeScript(
// null,
// {file: "./foreground.js"},
// () => console.log("I injected!")
// )
// }
// })
// })
chrome.tabs.onActivated.addListener(tab => {
chrome.tabs.get(tab.tabId, current_tab_info => {
if (/^(https:\/\/www\.youtube\.com\/feed\/channels)*$/.test(current_tab_info.url)) {
chrome.tabs.insertCSS(null,{file: "./mystyle.css"})
chrome.tabs.executeScript(
null,
{file: "./foreground.js"},
() => console.log("I injected!")
)
}
})
})