From 15407c4cdea4e049f62d2041e87797b654dbe299 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 17 Mar 2016 21:52:46 -0500 Subject: [PATCH] Add Google Analytics --- analytics.js | 9 +++++++++ manifest.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 analytics.js diff --git a/analytics.js b/analytics.js new file mode 100644 index 00000000..b30f6115 --- /dev/null +++ b/analytics.js @@ -0,0 +1,9 @@ +var _gaq = _gaq || []; +_gaq.push(['_setAccount', 'UA-8246384-4']); +_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); +})(); diff --git a/manifest.json b/manifest.json index d2533e47..967b1330 100644 --- a/manifest.json +++ b/manifest.json @@ -22,8 +22,9 @@ "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"] + "scripts": ["messaging.js", "storage-websql.js", "storage.js", "background.js", "analytics.js"] }, "commands": { "openManage": {