Created by: handeyeco
Hey there! The Contribution Guidelines say to ask before submitting a PR, but it doesn't say how to ask. I don't have a lot of experience contributing to OSS, so please let me know if I missed something.
This PR allows for CRA to control tabs on other Chromium-based browsers besides Google Chrome. How the code works:
- Checks if AppleScript is applicable. Logic isn't changed, but I renamed the variable to
shouldTryOpenChromiumWithAppleScript
. - Runs through a list of supported browsers:
- Chrome Canary (has to come before Chrome because of grep)
- Chrome
- Edge
- Brave
- Vivaldi
- Chromium
- For each browser, it greps to see if that browser is a process
- If it finds a match, it passes the browser name to the AppleScript
- AppleScript uses the Google Chrome dictionary to control the provided browser
Other than that, the logic is essentially the same. Most people shouldn't see a difference in behavior except for those using a browser in the list above that's not Chrome; for those people, CRA will reuse the existing tab rather than a new tab.
I noticed that Safari has its own dictionary for AppleScripts. If it benefits anyone, I could look into implementing similar logic for Safari users. Unfortunately for Firefox users like myself, there seems to be no hope.
Apologies if I left something out, but I tried my best. Let me know what needs to be changed, would be proud to have my code in CRA.
Closes #8264 (closed)