-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
27 lines (27 loc) · 954 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
26
27
chrome.runtime.onInstalled.addListener(function () {
chrome.storage.sync.set({color: '#3aa757'}, function () {
console.log('the color is green');
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules(
[
{
conditions: [
new chrome.declarativeContent.PageStateMatcher(
{
pageUrl:
{
hostEquals: 'developer.chrome.com'
}
}
)
],
actions:
[
new chrome.declarativeContent.ShowPageAction()
]
}
]
);
});
});