Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InAppBrowser insertCss Not Working #921

Closed
ghost opened this issue Dec 28, 2016 · 3 comments
Closed

InAppBrowser insertCss Not Working #921

ghost opened this issue Dec 28, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 28, 2016

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 ?

@spongessuck
Copy link

I get a similar error using insertCss in the iOS simulator:

TypeError: undefined is not an object (evaluating 'pluginObj._objectInstance[methodName].apply')

@aronbierbaum
Copy link

aronbierbaum commented Jan 6, 2017

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;

@ihadeed ihadeed closed this as completed in de07df6 Jan 7, 2017
@ihadeed
Copy link
Collaborator

ihadeed commented Jan 7, 2017

Just pushed a commit to fix this, will be available in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants