getting rid of analytics.js
This commit is contained in:
parent
c6df61b4e9
commit
458daf0836
28
analytics.js
28
analytics.js
|
@ -1,28 +0,0 @@
|
|||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-8246384-4']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
function isAnalyticsEnabled() {
|
||||
try {
|
||||
return chrome.extension.getBackgroundPage().prefs.get("analyticsEnabled");
|
||||
} catch (ex) {
|
||||
console.log(ex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Prefs seems not available immediately
|
||||
setTimeout(function() {
|
||||
if (isAnalyticsEnabled()) {
|
||||
(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);
|
||||
})();
|
||||
setInterval(function() {
|
||||
if (isAnalyticsEnabled()) {
|
||||
_gaq.push(['_trackPageview']);
|
||||
}
|
||||
}, 1000 * 60 * 60 * 24);
|
||||
}
|
||||
}, 1000);
|
|
@ -22,9 +22,8 @@
|
|||
"http://userstyles.org/",
|
||||
"https://userstyles.org/"
|
||||
],
|
||||
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
|
||||
"background": {
|
||||
"scripts": ["messaging.js", "storage-websql.js", "storage.js", "background.js", "analytics.js"]
|
||||
"scripts": ["messaging.js", "storage-websql.js", "storage.js", "background.js"]
|
||||
},
|
||||
"commands": {
|
||||
"openManage": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user