-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackground.js
25 lines (24 loc) · 849 Bytes
/
background.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
chrome.runtime.onInstalled.addListener(function() {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [new chrome.declarativeContent.PageStateMatcher({
pageUrl: {hostEquals: 'tjournal.ru'},
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
});
chrome.webNavigation.onHistoryStateUpdated.addListener(function(details) {
// debugger;
// chrome.tabs.executeScript(null,{code:"document.body.style.backgroundColor='red'"});
chrome.tabs.executeScript(null, {
code: 'window.location.reload()'
})
chrome.tabs.executeScript(null, {
file: 'twignore.css'
})
chrome.tabs.executeScript(null, {
file: 'twignore.js'
});
});