getting rid of analytics.js

This commit is contained in:
Jeremy Schomery 2017-01-08 12:27:33 +03:30
parent c6df61b4e9
commit 458daf0836
2 changed files with 1 additions and 30 deletions

View File

@ -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);

View File

@ -22,9 +22,8 @@
"http://userstyles.org/", "http://userstyles.org/",
"https://userstyles.org/" "https://userstyles.org/"
], ],
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'",
"background": { "background": {
"scripts": ["messaging.js", "storage-websql.js", "storage.js", "background.js", "analytics.js"] "scripts": ["messaging.js", "storage-websql.js", "storage.js", "background.js"]
}, },
"commands": { "commands": {
"openManage": { "openManage": {