nomaam opened a new issue #679:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/679
# Bug Report
// none of these file paths work
var toInject = cordova.file.applicationDirectory + "www/js/inject.js";
//var toInject = "www/js/inject.js";
//var toInject = "js/inject.js";
//var toInject = "inject.js";
inAppBrowserRef.executeScript(
{
file: toInject
//code:
// "alert('inline injected');" // inline code works as expected
},
function () {
alert("inject finished");
}
);
## Problem
Trying to use inAppBrowser and inject JS from a file that is stored in the
www folder. Doesn't work, no error messages given. Inline code injection works,
but is very sloppy to use if you have any decent length of code.
Also, it does work if you include a .js file that is hosted on the internet.
This seems like a very poor way of programming... You would want to have your
.js file that your injecting to actually be included in the App, not imported
from a website.
### What is expected to happen?
Load the JS file
### What does actually happen?
Nothing, no error.
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
Newest version of everything. See version section.
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
Code posted above
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
Android
### Version information
cordova-clipboard 1.3.0 "Clipboard"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-inappbrowser 3.2.0 "InAppBrowser"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.4 "Whitelist"
[email protected] | Apache-2.0 | deps: 8 | versions: 1201
bin: cordova
dist
.tarball: https://registry.npmjs.org/cordova/-/cordova-9.0.0.tgz
dependencies:
configstore: ^4.0.0 cordova-lib: ^9.0.0 insight: ^0.10.1
nopt: ^4.0.1
cordova-common: ^3.1.0 editor: ^1.0.0 loud-rejection: ^2.0.0
update-notifier: ^2.5.0
dist-tags:
3.6.0-0.2.8: 3.6.0-0.2.8 nightly:
10.0.0-nightly.2020.4.20.093c53cc
latest: 9.0.0 rc: 5.3.3
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x ] I searched for existing GitHub issues
- [x ] I updated all Cordova tooling to most recent version
- [ x] I included all the necessary information above
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]