Programmatically add/remove favorites bar (i.e., via registry or command line)?

Viewed 21

In Edge, I often take screenshots. My favorites bar contains some information that I need to obscure. So, I would like to create a script (a batch file or something) that I can use to quickly turn the favorites bar off.

Yes, I know that I can go into settings and turn the favorites bar off. I don't know how to manipulate the settings menu programmatically.

Possibly helpful info:

I thought a flag might look similar to this: msedge.exe --enable-features=msEdgeDeleteBrowsingDataOnExit,msEdgeOptionB --disable-features=FeatureC

Here is a list of features: https://peter.sh/experiments/chromium-command-line-switches/, but I don't see favorites bar mentioned. I tried searching "never" and "tabs" because those are options (see fig. 1).

There might be some kind of backend-option extension that can set this to a hotkey, but I honestly couldn't find a good reference for building extensions. This was the closest thing to a reference I found: https://learn.microsoft.com/en-us/microsoft-edge/extensions-chromium/getting-started/part2-content-scripts?source=recommendations&tabs=v2

fig 1: Fig 1., an image of the drop-down menu for "show favorites bar" with options "only on new tabs", "never", and "always".

1 Answers

This can be accomplished merely by pressing ctrl+shift+b.

You could potentially remap the keyboard command with ahk:

v1:

if winactive("ahk_exe msedge.exe")
^+b::^b ;;for example, remapping ctrl+shift+b to ctrl+b

v2:

ifwin active("ahk_exe msedge.exe")
^+b::^b ;;for example, remapping ctrl+shift+b to ctrl+b

Or some more complex trigger such as allowing a ShareX shortcuts to pass and simultaneously hammer ctrl+shift+b. But it's so easy to just strike ctrl+shift+b that it doesn't make sense to put a lot of effort into automating the process.

I've not found any commandline method of enabling/disabling the favorites bar; however, if a commandline method did exist, it would require that all edge instances be closed prior to its running; so, this solution is comparatively not pragmatic (probably useless if-even possible).

Related