Recreating inappbrowser after close?

Hi all! New to Ionic and Angular, but not programming. I know I’m going to do lots of silly stuff, so forgive some dumb code in the short term.

I’m trying to start an app with a hidden inappbrowser. I want to executescript() but if I need to open the browser, have the option to show it, do something, then hide it again, but the only option when the browser is visible is to “close” it, which kills the instance of the inappbrowser making my executescript() calls happen on null.

I’m able to re-instantiate the browser on exit, and my executescript() calls work again BUT… the browser.show() doesn’t do anything anymore.

My show function has this:

    this.browser.show();
    this.browser.executeScript({code: "console.log('show triggered');"});

    this.browser.on('exit').subscribe(event => {
        this.browser = this.theInAppBrowser.create(this.url, this.target,this.options);
        this.browser.executeScript({code: "console.log('exit triggered, browser recreated');"});
    });

The console.log()s actually work, but the this.browser.show() still does nothing. That is, the “show triggered” shows up in the console log, but the browser doesn’t become visible.

Just very strange that the browser seems to be properly recreated, but show doesn’t work. I tried adding a .hide() before .show() to see if it thought it was already visible and didn’t need to do anything, but that didn’t work.

Thanks in advance!

-Trevor