G
G
gallantalex2017-06-03 14:17:03
Angular
gallantalex, 2017-06-03 14:17:03

Why doesn't executeScript for Android 6+ work in the inAppBrowser plugin?

I have an application built on Ionic 3 which uses the ionic-native/inAppBrowser plugin. In this plugin, I use the executeScript method, which passes the code to the page opened by the inAppBrowser browser. This method works well on Android 4.4 platform. But when I open the application on android 6 or 7, this method is not processed. Why is this happening? Here is a snippet of my code:

this.browser = this.inAppBrowser.create(data, '_blank', 'location=no,hardwareback=no,hidden=yes');
    this.browser.on('loadstart').subscribe(event => {
      this.browser.executeScript({
        code: '' +
        'onload = function() {' +
        'backButton = document.getElementsByClassName("backwards")[0];' +
        'backButton.setAttribute("href", "http://www.parkimon.ru");' +
        'excessLink = document.getElementsByClassName("right")[0].remove();' +
        '}'
      }).then(()=>{});
    });

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question