Can I hide info bar of IE Mode in MSEdge?

735 views
Skip to first unread message

sun-rise

unread,
Dec 9, 2021, 3:27:08 AM12/9/21
to Selenium Users
Hi all,

I'm trying to build automated web site operation with IE Mode in MS Edge.
I want to hide info bars "You're using an unsupported command-ine flag: --ie-mode-force. This poses stability and security risks." and "All sites in this tab will be opened in Internet Explorer mode.", if possible.

Can I hide those?
(My project use C# and IEDriver.)

infobar.png

Thanks.

Hasmukh Ginoya

unread,
Dec 14, 2021, 3:11:27 AM12/14/21
to Selenium Users
I am also facing same problem. I want to hide this info bar.
I am opening the Microsoft edge with IE Mode using the command line from C# code.


I am launching Edge with IE Mode in 2 ways
1) Using Process like
               ProcessStartInfo processInfo = new ProcessStartInfo();
                processInfo.FileName = "msedge";                
                StringBuilder arguments = new StringBuilder();                
                arguments.Append(" --ie-mode-force");
                arguments.Append(" --internet-explorer-integration=iemode");
                arguments.Append(" --no-first-run");
                arguments.Append(" --no-service-autorun");
                arguments.Append(" --disable-sync");              
                arguments.Append(" --disable-features=msImplicitSignin");
                arguments.Append(" --user-data-dir=" + getEdgeTempFolder());
                arguments.Append(" www.google.com");
                processInfo.Arguments = arguments.ToString();               
                Process process = new Process();
                process.StartInfo = processInfo;
                process.Start();

2) Using IE Driver
 var dirPath = "PATH\\IEDriverServer_x64_4.0.0";
String ieDriver = "IEDriverServer.exe";

var ieService = InternetExplorerDriverService.CreateDefaultService(dirPath, ieDriver);
ieService.HideCommandPromptWindow = false;
ieService.LogFile = "PATH\\Logs\\IEDriver.log";
ieService.LoggingLevel = InternetExplorerDriverLogLevel.Debug;            

var ieOptions = new InternetExplorerOptions { };
String edgePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
ieOptions.EdgeExecutablePath = edgePath;
ieOptions.AttachToEdgeChrome = true;
ieOptions.InitialBrowserUrl = "http://www.google.com";
ieOptions.SetLoggingPreference(LogType.Browser, LogLevel.All);
ieOptions.ForceShellWindowsApi = true;  

var webdriver = new InternetExplorerDriver(ieService, ieOptions);
webdriver.Url = "http://www.google.com";            
webdriver.Close();

So in both cases this will display information bar like
Edge Error.JPG

Hasmukh Ginoya

unread,
Dec 14, 2021, 3:11:32 AM12/14/21
to Selenium Users

Edge Error.JPG
I have use 2 method in both cases it will display this information. So how can i hide that?

Option 1:
              ProcessStartInfo processInfo = new ProcessStartInfo();
                processInfo.FileName = "msedge";                
                StringBuilder arguments = new StringBuilder();                
                arguments.Append(" --ie-mode-force");
                arguments.Append(" --internet-explorer-integration=iemode");
                arguments.Append(" --no-first-run");
                arguments.Append(" --no-service-autorun");
                arguments.Append(" --disable-sync");              
                arguments.Append(" --disable-features=msImplicitSignin");
                arguments.Append(" --user-data-dir=" + getEdgeTempFolder());
                arguments.Append(" www.google.com");
                processInfo.Arguments = arguments.ToString();
               
                Process process = new Process();
                process.StartInfo = processInfo;
                process.Start();

Option 2:
Reply all
Reply to author
Forward
0 new messages