Disable the edge sidebar using Capabilities and EdgeOptions

2.9k Views Asked by At

All I want to know how I can disable edge sidebar using Edge capability. so i can use it in automation. I am aware about two different ways to it mentioned below.

  1. Using .send_keys Shift + Ctrl + /
  2. From registry Editor Open Registry Editor by typing regedit in the Run prompt and pressing the Enter key. Navigate to the following path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Edge Right-click on the right section, and choose to create a DWORD with the name as HubsSidebarEnabled Set the value as 0x00000000 to disable it.

But i want to do it using Capabilities and EdgeOptions..

Attaching image of sidebar in edge

Please mention if any solution on this...

Edge version - Version 107.0.1418.62 (Official build) (64-bit) OS - win10

4

There are 4 best solutions below

1
On BEST ANSWER

EdgeOptions, Capabilities

Solution on C#

var options = new EdgeOptions();
options.AddArgument("--disable-features=msHubApps");

Solution on Ruby

DESIRED_CAPABILITIES = {    
    edge: { 
        browser_opts: {args:    %w( --disable-features=msHubApps),}
    }
}

Resource - https://github.com/MicrosoftEdge/EdgeWebDriver/issues/61
0
On

I searched a lot including some official documents: Capabilities and EdgeOptions, Browser Options, Capabilities, but didn't find such Capabilities/EdgeOptions.

I think we can't disable Edge sidebar using Edge capability for now. I suggest that you can provide feedback to Edge WebDriver team to help improve the product. Thanks for your understading.

1
On

@Matteo That didn't work and I could still see the Sidebar.

caps = { options: { prefs: { show_hub_apps_tower: false } } }

I am working on Watir with Ruby on Edge v114

1
On

I'll also add that another possibility would be to disable it with prefs.

Java :

Map<String, Object> lPrefs = new HashMap<>();

// Disable Hub Apps Tower
lPrefs.put("browser.show_hub_apps_tower", false);

edgeOptions.setExperimentalOption("prefs", lPrefs);

I find it pretty easy to do like that as I also edit a bunch of other features putting them in my HashMap.

You can find all available preferences using edge://prefs-internals/. Tinkering with this can be very powerful as you can basically find anything that you would need.