VM-Packages icon indicating copy to clipboard operation
VM-Packages copied to clipboard

Set Chrome as default browser

Open Ana06 opened this issue 1 year ago • 4 comments

Details

I think we should add a googlechrome.defaultbrowser.vm package to add Chrome as default browser as proposed in https://github.com/mandiant/VM-Packages/issues/16.

One idea would be to use the following PowerShell script

Add-Type -AssemblyName System.Windows.Forms
Start ms-settings:defaultapps
Sleep 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB 5}{ENTER}")
Sleep 1
[System.Windows.Forms.SendKeys]::SendWait("{TAB 2}{ENTER}");

But this only works if Google Chrome is the third browser in the list, what I am not sure that is always the case. This is how it looks like for me: Screenshot 2024-01-11 at 17 39 56

How does it look for others? Does anyone have a better idea to implement it? 🤔

Ana06 avatar Jan 11 '24 16:01 Ana06

Did we determine if https://github.com/DanysysTeam/PS-SFTA from https://github.com/mandiant/VM-Packages/issues/823 is something we can use or at least take a part of the code to use in our own way?

If not, could we use the alternative from chocolatey? https://community.chocolatey.org/packages/setdefaultbrowser

emtuls avatar Apr 26 '24 05:04 emtuls

I have asked legal and they have advised that we send an issue/PR to request the addition of the LICENSE file if we want to use the code.

Ana06 avatar May 24 '24 13:05 Ana06

@emtuls which of the two options (PS-SFTA or the setdefaultbrowser browser) would you prefer to use? If we prefer to use PS-SFTA I can ask them to include the license file.

Ana06 avatar May 27 '24 10:05 Ana06

Whichever is easier imo, but setdefaultbrowser seems pretty easy with it being in chocolatey already. :)

emtuls avatar Jun 08 '24 00:06 emtuls