I made a few changes to assist in Cordova-wrapping an SPA, and I thought the changes may be beneficial to someone else.
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.
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.
I made a few changes to assist in Cordova-wrapping an SPA, and I thought the changes may be beneficial to someone else.
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.
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!