Will it be possible to retrieve the URL that the InAppBrowser is currently showing? Or have a callback to to get the url?
Hello @Jeremy Kuang ,You can't achieve this directly, but by customizing the plugin, you can add your own logic and additional operations to capture the URL.example:var ref = cordova.InAppBrowser.open('https://example.com', '_blank', 'location=yes');ref.addEventListener('loadstart', function(event) { console.log("New URL: " + event.url);});
Was the previous version of OutSystems' implementation of the InAppBrowser plugin and import from Cordova's? If it is, then maybe this will work for the previous version. But it seems that the latest version is a an implementation by OutSystems themselves.
Hi,
Please refer the below link,
https://www.outsystems.com/forums/discussion/30595/inappbrowser-plugin-extract-url-from-inappbrowser/
Or
https://youtu.be/XTG8_qPR6GM?si=GZ9f9WFHe50ATUxt
Thanks,
Sahana
Are you suggesting to use InAppEventBrowserEvents plugin? Correct me if I am wrong, but I believe InAppBrowserEvents does not support the latest version of the InAppBrowser plugin. Or at least, I have tried and it is not supported. Please let me know if you have tried and it is working for you (=
I have the same pain.
We have to patch plugin to support this. Have no idea why OS published this plugin without such built-in functionality.I'll work on this now.Stan
Looking for the same functionality what InAppEventBrowserEvents provides.
Unfortunately the official Plugin (InAppBrowser) doesn't have the minimum capability to address requirements
InAppBrowserEvents not compatible with latest InAppBrowser plugin
Yes , But its required to have the event call back features to track the in App browser navigations especially for the OIDC/Oauth2 flow for mobile application. MABS version 11 required to have latest plugin update.
Please referhttps://www.outsystems.com/forums/discussion/99096/inappbrowserevents-update-component/
Yes, there are 2 threads about same problem. I was trying td patch plugin but it will require deeper diving than I expected.And having MABS 10 depreciated soon is a serious problem indeed.
Hello @Jeremy Kuang
Use the below JS code to get the Current URL of the page instead of calling the open action, use this JS code.
inside the LoadStart event function, you can do what you want, like call another client action with the URL input parameter that does the work you want to do .
@Gourav Shrivastava it works with prev version of InAppBrowser.The latest version of InAppBrowser plugin has fully different implementation and doesn't return browser object. You can see that in source of plugin.
Yes @Stanislav Ploschansky ,
@Jeremy Kuang in this case, please use this code for getting URL
ref.executeScript(
{ code: 'window.location.href;' },
function(values) {
var currentUrl = values[0];
console.log('Current URL:', currentUrl);
// You can now use the currentUrl variable as needed
}
);
});
If you need reference, you can also check out this Documentation.
Thanks
Regards Gourav
@Gourav Shrivastava , your comments related to PREVIOUS version of plugin which available via
> cordova.InAppBrowser. The new version of plugin uses https://github.com/OutSystems/cordova-outsystems-inappbrowser and there plugin injected differently and implemented FULLY DIFFERENTLY
> cordova.plugins.OSInAppBrowser
Look for example here https://github.com/OutSystems/cordova-outsystems-inappbrowser/blob/main/src/www/web.ts and you will see Open* functions doesn't return browser object like previous version of plugin.
Thanks for clearing me, I got your point, let me check the changes in this component and if I got something, I will let you know.