InAppBrowser executeScript not working


#1

Hi. I’m using inAppBrowser to open a page, but i need to manipulate some things in this page so, searching through documentation, there’s a executeScript() function.

The case is: It’s not working. I have the following:

const chat = this.inApp.create('https://...', '_self', 'location=no');
chat.executeScript({ code: "console.log('123');" }).then((res) => {
  chat.show();
});

I’ve tried different types of scripts and none of then executes.

In the github plugin page there’s a addEventListener function, but Ionic doesn’t recognizes it.

So am i using the executeScript right? Is there a way to use addEventListener?

Thanks everyone :smiley:


#2

Same problem here. Seems like the executeScript() callback/promise is not working.


#3

Change target ‘_self’ to ‘_blank’.
It will work.