Jump to content

Is it possible to change UniMainModule.BrowserOptions at runtime


Recommended Posts

Posted

Tried to change UniMainModule.BrowserOptions at runtime:

if chkBrowserOptions.Checked=True then UniMainModule.BrowserOptions:=[] 
else UniMainModule.BrowserOptions:=[boDisableMouseRightClick];

but this has no effect.

 

So I have a question - Is it possible to change UniMainModule.BrowserOptions in runtime?

  • 1 year later...
Posted

Same here. No effect also at designtime. The menu of the browser is shown over my TUniPopupMenu. i studied the pop demo and i am shure that i do all right. But maybe i have overseen something?

 

edit: in Safari, it works, in Firefox it does not work

Posted

Hi! 

 

If question still relevant , try:

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  if MainModule.UniMainModule.BrowserOptions = [] then begin
    MainModule.UniMainModule.BrowserOptions := [boDisableMouseRightClick];
    UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return false; }');
  end
  else begin
    MainModule.UniMainModule.BrowserOptions := [];
    UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return true; }');
  end;
end;

Best regards.

  • Like 2
  • Upvote 1

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