webbrowser-rs icon indicating copy to clipboard operation
webbrowser-rs copied to clipboard

Feature Request: Allow "DONT SWITCH" Launch Flag on Mac

Open jackbackes opened this issue 6 months ago • 2 comments

On Mac, I'd like to override the default behavior and open the browser in the background. This requires the Launch Services flag "DONT_SWITCH".

https://docs.rs/launch-services/latest/launch_services/struct.LSLaunchFlags.html

https://developer.apple.com/documentation/coreservices/lslaunchflags/1442057-dontswitch

I request implementing a builder method to allow control of launch flags or otherwise enable "dont switch" behavior.

jackbackes avatar Jul 02 '25 00:07 jackbackes

I think it should be ok to expose this out as a macos specific extension of BrowserOptions. I'd prefer this to be a dont_switch option instead of accepting open ended LSLaunchFlags , because some of them might affect behaviours which this crate guarantees.

Feel free to raise a PR if you wish, else I'll take it up over the next few days.

amodm avatar Jul 02 '25 03:07 amodm

@jackbackes does the change in #106 solve sufficiently for the scenario you mention?

amodm avatar Jul 06 '25 17:07 amodm