-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixpanel with Cordova attempts to load mixpanel-2-latest.min.js from filesystem #48
Comments
Thanks for writing in. I think you should already have everything you need here:
If you need more info on loading the lib from 'non-standard' locations, take a look at the Bower section in https://github.com/mixpanel/mixpanel-js/blob/master/README.md which details some variables we offer for overriding default lib locations. Also happy to help dig into your specific case via email at support@mixpanel.com. Does this help? |
Aah, my bad, I was actually referring to the little bootloader snippet when I said I'll check out the Bower section, looks like that'll answer the second part. Related question: If I ship a snapshot of the Mixpanel JS, will it be future proof, or will it eventually become incompatible with the Mixpanel API? |
This is also broken with Thanks! |
I believe this issue can be closed. I should mention that the readme now has a section titled: Using Bower to load the entire library which explains how to load Mixpanel without the CDN. This will allow it to pass the CSP for Chrome:extensions. |
If one includes
mixpanel.js
in their Cordova application, messages won't get logged. The problem comes with thescript
tag that is generated and inserted into the DOM:By default it matches the same protocol the document is loaded under, which in Cordova on Android, is
file://
. The filesystem lookup forfile://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js
of course ends up failing.One possible solution would be to always use
https://
. If there's a clean way to merge themixpanel.js
andmixpanel-2-latest.min.js
files into one (or even do it as a build step and provide the file in themixpanel-js
repo) and ship that, it would be preferred.The text was updated successfully, but these errors were encountered: