Status bar color change and inAppBrowser

I have an application that starts as a normal ionic 2 application but then it launches an ionic 2 browser app web page inside an inAppBrowser.

I am able to change the android status bar when I start the app, but when I switch to my ionic 2 browser page, the status bar returns to black background.

in my ionic 2 browser app page I have added this to the app.ts:

  constructor(platform: Platform) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
      // added to change the status bar background color
      StatusBar.overlaysWebView(false);
      StatusBar.backgroundColorByHexString('#FF8300');
    });
  }

But it does not do anything as far as I can tell. Have I missed something? Is there anyway to change the status bar background color from inAppBrowser or at least to prevent inAppBrowser from reverting it back to black?

1 Like

Normally inappbrowser does not support cordova.js file. But you can load cordova.js file with:

var win = window.open(...
win.executeScript({file:"file:///android_asset/www/cordova.js"});

after that your page opened with inappbrowser can do plugin abilites. Actually i did not try :slight_smile:

same here, alfabc’s answer doesn’t seem to work

Has anyone a solution for this problem?