I instanciate a an InAppBrowser with
let browser = new InAppBrowser('my_fancy_url', "_self", 'location=no,hidden=yes,useWideViewPort=yes');
Then a call on browser.insertCss({code: this.cssETransaction}); raises an error :
TypeError: Cannot call method 'apply' of undefined
I tried to call insertCss() after browser.show(), I tried to set hidden to no but I never managed to insert CSS.
On the other hand on chrome://inspect when I call the InAppBrowser from cordova.InAppBrowser.open(...) I can easily insertCss.
Any Thoughts on that ?
I get a similar error using insertCss in the iOS simulator:
TypeError: undefined is not an object (evaluating 'pluginObj._objectInstance[methodName].apply')
In order to workaround this I have added the following code to my project. It is a ugly hack that creates an alias in the cordova-plugin-inappbrowser plugin.
const browser_proto = (this.browser as any)._objectInstance.__proto__;
browser_proto.insertCss = browser_proto.insertCSS;
Just pushed a commit to fix this, will be available in the next release.
Most helpful comment
Just pushed a commit to fix this, will be available in the next release.