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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...