From 458daf0836c00be329b47522906d10fd449ff6b4 Mon Sep 17 00:00:00 2001 From: Jeremy Schomery Date: Sun, 8 Jan 2017 12:27:33 +0330 Subject: [PATCH] getting rid of analytics.js --- analytics.js | 28 ---------------------------- manifest.json | 3 +-- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 analytics.js diff --git a/analytics.js b/analytics.js deleted file mode 100644 index f1b05512..00000000 --- a/analytics.js +++ /dev/null @@ -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); diff --git a/manifest.json b/manifest.json index b41d8701..915fa98a 100644 --- a/manifest.json +++ b/manifest.json @@ -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": {