-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.js
30 lines (29 loc) · 953 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
28
29
30
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-90329527-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
chrome.runtime.onInstalled.addListener(function() {
let value = 300;
chrome.storage.sync.set({ width: value }, function() {
console.log("Default width", value);
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function() {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: { urlContains: "github.com" },
css: ["textarea"]
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}
]);
});
});