Hi,

I am able to link a button to a URL, however it opens in the app. I would like the link to be opened in the phone's application browser instead, is there a way to achieve this?

Thanks.

Regards,
Jerome

Solution

Hi Jerome

You can use this plugin to open either in-app or to redirect to the default browser


Hope this helps!

  -CLSJ

Solution

Hi Jerome,

There's no need to use a plugin just to achieve this. You can use a JavaScript element in your click handler with the following script:

window.open('https://www.google.com', '_system');

This opens the URL in the device's browser.

Aurelio Junior wrote:

Hi Jerome,

There's no need to use a plugin just to achieve this. You can use a JavaScript element in your click handler with the following script:

window.open('https://www.google.com', '_system');

This opens the URL in the device's browser.

hi Aurelio

Do u have an working example of it. 

i need to implement it in my mobile application but currently my links are opening inside my app.


Hi Nitesh,

Just follow these steps:

  • Add a Client Action to handle your link's On Click event.
  • Add a JavaScript element to the new Client Action.
  • Use the following code for the JavaScript element:
    window.open('<yourURL>', '_system');

Aurelio Junior wrote:

Hi Nitesh,

Just follow these steps:

  • Add a Client Action to handle your link's On Click event.
  • Add a JavaScript element to the new Client Action.
  • Use the following code for the JavaScript element:
    window.open('<yourURL>', '_system');

Hi Aurelio,

I have used the above JavaScript, the link is navigating to external browser, But the URL is attached with the outsystems personal link.

We need append the URL with https, If the website is just google.com then it will not work



Aurelio Junior wrote:

Hi Jerome,

There's no need to use a plugin just to achieve this. You can use a JavaScript element in your click handler with the following script:

window.open('https://www.google.com', '_system');

This opens the URL in the device's browser.

I think there is no meaning for "_system" in window.open(), it just works as an overload with window name (https://www.w3schools.com/jsref/met_win_open.asp). But cordova InAppBrowser (if you use it) knows this keyword as a command to start the system browser.

window.open() works, but it opens the page still inside of the mobile app, which means, in particular, that download will not work. I can also see that if I go to tasks in Android - there is no separate browser there, just the mobile app. Or is this really working differently for you?

I was desperately looking for a way to download a file or at least open a page which can download, without adding a plugin. Unfortunately I came to a conclusion that it's not possible.