Jump to content

How To Disable The Popup Blocker In Firefox (And Other Browsers)?


Frederick

Recommended Posts

When I open a web site in Firefox (using the following code) and its popup windows blocker is enabled, the site cannot be reached.

UniSession.AddJS('open("www.google.com", "_blank")');

Is there a way to disable the popup blocker by code so that the site can be called?

I tried the following code in the MainForm.UniFormShow event but there is no effect:-

procedure TMainForm.UniFormShow(Sender: TObject);
begin
  Caption := UniApplication.Parameters.Values['param1'];
end;

--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1555)

Link to comment
Share on other sites

Thanks. I did see this page but was not sure how to add it in the following JS code:-

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniSession.AddJS(
    'var f = document.createElement("form"); '+
    'f.action="http://localhost:8077/"; '+ // the second app url
    'f.method="POST"; f.setAttribute("target", "view");'+

    'var i=document.createElement("input"); '+ // Param1
    'i.type="hidden"; '+
    'i.name="param1"; '+
    'i.value="Test"; '+
    'f.appendChild(i); '+

    'document.body.appendChild(f); '+
    'window.open("", "view"); f.submit(); '
  );
end;

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...