Jump to content

Open new tab with button


skafinski

Recommended Posts

Hi,

I'm trying to open new tab (blank) with href to some location on disc.

If i use label and use a href it works and opens new tab no problem.

If i use button and set hreftarget to _blank and  href for path it doesn't work

 

object UniButton1: TUniButton
  Left = 608
  Top = 45
  Width = 75
  Height = 25
  Hint = ''
  Caption = 'UniButton1'
  TabOrder = 11
  Href = 'file:///D:/somefolder'
  HrefTarget = '_blank'
  OnClick = UniButton1Click
end

 

also if i use niSession.AddJS('window.open(''file:///D:/somefolder', ''_blank'');'); it doesn't work.

 

Does anybody knows how to do this?

Link to comment
Share on other sites

3 hours ago, skafinski said:

If i use label and use a href it works and opens new tab no problem.

How? 

In most modern browsers, opening a local file using a link (href) is not possible for security reasons. This limitation is due to security policy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...