Do not work Google Analytics in Chrome extension -


i have problems including ga.js in extension. please, help. code:

manifest included

"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'" 

analytics.js

var _analyticscode = 'ua-xxx';//instead xxx number  var _gaq = _gaq || []; _gaq.push(['_setaccount', _analyticscode]); _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); })(); 

this script added in 2 page - popup.html , options.html. on popup right, options page says:

refused load script 'data:application/javascript;base64,dmfyihvyy2hpblryywnrzxi9znvuy3rpb24okxt9…jvcmw6znvuy3rpb24obyl7cmv0dxjuig87fsxfdhjhy2tfdmvuddpmdw5jdglvbigpe319fx07' because violates following content security policy directive: "script-src 'self' https://ssl.google-analytics.com".

hmm, problem releted using ghostery extension - blocks analysts scripts, replacing them stub. naturally, stub script not satisfy content security policy conditions.

perhaps answer useful someone


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -