TruckMovers / cordova-plugin-remote-injection

DEPRECATED: Cordova plugin to allow a remote site to interact with cordova's javascript APIs when loaded within a cordova app.
Apache License 2.0
91 stars 95 forks source link

CRIInjectFirstFiles issue #23

Closed Graham-Phillips closed 7 years ago

Graham-Phillips commented 7 years ago

If I include www/cordova.js in the list of files to inject with CRIInjectFirstFiles I get an error thrown: cordova already defined

If I don't include it I get Uncaught ReferenceError: cordova is not defined

Which is the right way?

Just to add a bit more.... I'm getting no console logs from the index.js file I load. A plugin I have defined is loading (at least the library it includes is loading) and I get this is the console "Could not find cordova.js script tag. Plugin loading may fail" -- however, I can type cordova in the console and it traces ok.

Currently got this

bradleyjames commented 7 years ago

Could not find cordova.js script tag. Plugin loading may fail

This message is a warning and I never got around to trying to address it. If you can type cordova in the console while viewing a remote site the plugin has done its job.

I'm confused what state your in. You shouldn't need to specify anything in CRIInjectFirstFiles in order for the plugin to inject cordova.

Graham-Phillips commented 7 years ago

Ah cool, thanks for the reply. No, I didn't think we should be manually injecting cordova to be honest, just trying every permutation.