Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Chrome as default browser #822

Closed
Ana06 opened this issue Jan 11, 2024 · 4 comments · Fixed by #1164
Closed

Set Chrome as default browser #822

Ana06 opened this issue Jan 11, 2024 · 4 comments · Fixed by #1164
Assignees
Labels
😕 needs info Further information is needed 💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed

Comments

@Ana06
Copy link
Member

Ana06 commented Jan 11, 2024

Details

I think we should add a googlechrome.defaultbrowser.vm package to add Chrome as default browser as proposed in #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 Ana06 added 💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed labels Jan 11, 2024
@Ana06 Ana06 changed the title Set Chrome as default browse Set Chrome as default browser Jan 11, 2024
@Ana06 Ana06 added the 😕 needs info Further information is needed label Apr 25, 2024
@emtuls
Copy link
Member

emtuls commented Apr 26, 2024

Did we determine if https://github.com/DanysysTeam/PS-SFTA from #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

@Ana06
Copy link
Member Author

Ana06 commented May 24, 2024

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
Copy link
Member Author

Ana06 commented May 27, 2024

@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.

@emtuls
Copy link
Member

emtuls commented Jun 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😕 needs info Further information is needed 💎 enhancement It is working, but it could be better ❔ discussion Further discussion is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants