Jump to content

Is it possible to change UniMainModule.BrowserOptions at runtime


Semper

Recommended Posts

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?

Link to comment
Share on other sites

  • 1 year later...

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