Frederick Posted December 15, 2021 Share Posted December 15, 2021 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) Quote Link to comment Share on other sites More sharing options...
mehamada Posted December 15, 2021 Share Posted December 15, 2021 https://stackoverflow.com/questions/2587677/avoid-browser-popup-blockers Quote Link to comment Share on other sites More sharing options...
Frederick Posted December 15, 2021 Author Share Posted December 15, 2021 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.