Jump to content
Sign in to follow this  
Czar

open external link in new tab of browser

Recommended Posts

This seems like an embarrassingly simple question but I can't figure it out.

All I want is to be able to have the user click a button and open a URL in a new tab in their browser

I cannot find any examples and searching throws up everything but a solution.

 

Share this post


Link to post
Share on other sites

@jartothanks that answer was something like I was expecting.

 

However, just so you are aware, when I have browserapi.window. then open is not an option by code insight. See image attachment

 

 

 

 

 

SmartMS_GqyeL5KqHh.png

Share this post


Link to post
Share on other sites

The other possible downside of using window.open is that it depends on the users browser setting whether it opens a new tab or a new window.

This behaviour cannot be determined by js, it is dependent on the user.

While chrome seems to favour using the tab-mechanism, other browsers don't. I've tested a couple which resulted in 'pop-up blocked' messages

Also mobile browsers don't have tabs, so they will spawn a new window at best.

(There is something called the tab-api, which gives granular tab processing under program control. This is used for developing browser extensions, which I have never done. It may or may not be possible to use that api in SMS, although I suspect that even if it does, it will have ramifications)

Another possible option is of course using an iFrame element on the form. Depends on your requirements

Share this post


Link to post
Share on other sites
4 hours ago, Czar said:

@jartothanks that answer was something like I was expecting.

 

However, just so you are aware, when I have browserapi.window. then open is not an option by code insight. See image attachment

 

 

 

 

 

SmartMS_GqyeL5KqHh.png

Try using BrowserApi.Windowobject.open( ) instead. Note that "window" is of type THandle which means you can utilise any valid javascript method/property on it, but code completion will not work. "Windowobject" on the other hand is of type Jwindow and is built with code completion in mind. 

Share this post


Link to post
Share on other sites

I need to have a look at the code completion/code insight. It's been on my bug list for quite some time. Have to see what I can do to that internal browser shutdown issue as well :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×