Using inappBrowser, I want to be able to load content with url coming from a menu list. When user clicks on a menu item it loads the content. Before a new item is loaded, current is is set to hide - “item.browser.hide()”. The goal is to navigate between menu items and maintain state of items previously displayed.
Here is the issue: Say all menu items have already been created once, if I click on a menu item (item.browser.show() content displayed is always the last one displayed.
Is there a way to update inappBrowser with latest “item.browser” without the use of inappBrowser.create()? Can this be done by extending InAppBrowser or InAppBrowserObject?
Angular 10
“@ionic-native/in-app-browser”: “^5.28.0”
“cordova-plugin-inappbrowser”: “^4.0.0”
options: InAppBrowserOptions = {
location: ‘no’,//Or ‘no’
hidden: ‘yes’, //Or ‘yes’
};
onMenuSelected(item) {
this.platform.ready().then(() => {
const target = “_blank”;
if (item.appBrowser === null || item.appBrowser === undefined) {
item.appBrowser = new InAppBrowser();
item.browser = item.appBrowser.create(item.url, target, this.options);
item.browser’on’.subscribe(event => {
//
});
}
item.browser.show();
});
}