Answer the question
In order to leave comments, you need to log in
How to insert your JavaScript code into a website page in an Apache Cordova application?
In regular browsers, injecting your code into sites is easy by creating an extension, but what about Apache Cordova? Are there tools for this? The documentation is porridge, I just can’t read it, but there are no normal guides. In general, it is not clear where to dig. In theory, normal chromium works inside the same place, is it possible to hang real extensions from Chrome on it?
PS The option with a proxy is not suitable, you need to keep a separate server for substituting content, and this is a so-so solution.
Answer the question
In order to leave comments, you need to log in
Found the answer . You need to connect the InAppBrowser plugin, after which, you can inject the code into certain pages as follows:
var ref = window.open('http://apache.org', '_blank', 'location=yes');
ref.addEventListener('loadstop', function() {
ref.executeScript({file: "myscript.js"});
});
<plugin name="cordova-plugin-inappbrowser" source="npm" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question