Open danielweck opened 9 years ago
To open the Web Inspector (debugger + Javascript console, etc.) in Chrome, go to the "extensions" page (chrome://extensions/
), and click on the Inspect views: index.html
link located alongside the Readium icon.
UPDATE: scrap this comment, see the next one below.
https://developer.chrome.com/extensions/examples/tutorials/analytics/manifest.json
{
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'"
}
Scrap my above comment (not for packaged apps). This instead:
https://github.com/GoogleChrome/chrome-platform-analytics/blob/master/google-analytics-bundle.js
https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/analytics
CC @ryanackley (please have a look if you don't mind / you have the time)
Google Analytics currently disabled: https://github.com/readium/readium-js-viewer/blob/develop/src/chrome-app/analytics/ExtensionAnalytics.js#L16
//Refused to load the script 'https://ssl.google-analytics.com/ga.js'
//because it violates the following Content Security Policy directive:
//"default-src 'self' chrome-extension-resource:".
//Note that 'script-src' was not explicitly set,
//so 'default-src' is used as a fallback.
//
// window._gaq = window._gaq || [];
// _gaq.push(['_setAccount', 'UA-29665823-1']);
//
//
// (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);
// })();
return {
trackView : function(viewName){
//_gaq.push(['_trackPageview', viewName]);
},
sendEvent : function(category, action, label, value){
//_gaq.push(['_trackEvent', category, action, label, value]);
}
}
It looks like this must be used instead: https://github.com/GoogleChrome/chrome-platform-analytics/blob/master/google-analytics-bundle.js https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/analytics