Skip to content
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

Injectable URLs and check window to ensure Cordova is not already defined #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mattlisiv
Copy link

I made a few changes to assist in Cordova-wrapping an SPA, and I thought the changes may be beneficial to someone else.

  1. Add an CRIInjectableSites preference that accepts wildcard URLs. This prevents the javascript from being injected on every request. It seems like a preventive measure to ensure JS is not injected where it is not wanted.

  2. Add a window.cordova == null check to prevent Cordova from being injected multiple times. I have found this occurs when making asynchronous web calls from the initial page.

Let me know what you think. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant