Cannot switch to web browser

I have just installed root_v6.30.06 to take place of 6.28 because I need some C++17 features. But I find that the default Browser is ROOTBrowser instead of Web Browser.
I have changed C:\root_v6.30.06\etc\system.rootrc as follow:

Canvas.Name:                TWebCanvas
Browser.Name:                ROOT::Experimental::RWebBrowserImp

But it doesn’t work

_ROOT Version:6.30.06
_Platform:Win10
Compiler: Not Provided


Try with ROOT::RWebBrowserImp

It shows

WARNING!
rootrc parameter "Browser.Name" with web browser disabled for security reasons.
See https://root.cern/about/security/#2023-11-26-open-port-for-control-of-web-gui-allows-read-and-write-access-to-file-system for more information.
For environments controlling the security issues you can enable web display by calling
gROOT->SetWebDisplay(); in ROOT prompt or in startup scripts

I want to use Web Browser when I open a .root file, so I guess I need to change the startup scripts. Where is it in windows system?

You can create a rootlogon.C in either the etc directory in the ROOT installation, your %USERPROFILE%, or the current directory. For example:

void rootlogon() {
   gROOT->SetWebDisplay("chrome");
}

See the TROOT::SetWebDisplay|(const char *webdisplay) documentation

Thank you very much!
It works when I put rootlogon.C in the current directory.
By the way, it doesn’t work when I put it in the etc directory or my %USERPROFILE%.

1 Like

OK, I’ll check, it might have changed or it might be different on Windows…

OK, so here is how it works:
rootlogon.C in the current directory
.rootlogon.C in the %USERPROFILE% directory, with _rootlogon() as function name
system.rootlogon.C in the %ROOTSYS%\etc directory, with system_rootlogon() as function name

1 Like

For example, a %USERPROFILE%\.rootlogon.C with a couple of printf, not to forget that a custom command is being executed:

void _rootlogon()
{
   printf("\nExecuting custom %%USERPROFILE%%\\.rootlogon.C\n\n");
   printf("Setting Web Display as \"chrome\"...\n\n");
   gROOT->SetWebDisplay("chrome");
}
1 Like

Same can be achieved with .rootrc parameter:

WebGui.Display: chrome

Info about related parameters in RWebWindow::ShowWindow() docu