Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Allow customization of cmd click link behavior #50

Open
keith opened this issue Jul 31, 2016 · 2 comments
Open

Allow customization of cmd click link behavior #50

keith opened this issue Jul 31, 2016 · 2 comments

Comments

@keith
Copy link
Collaborator

keith commented Jul 31, 2016

We discussed this a little bit but I wanted to create an issue so we don't forget.

It would be nice to be able to hook into the cmd+click action on links in order to do things like open the link in the background instead of the foreground, and also be able to decide on the ordering. For example if you cmd+click multiple URLs and they come to the foreground, you may want the later ones to be just a single buffer in front of the website you were opening them from, instead of at the end.

@keith
Copy link
Collaborator Author

keith commented Jul 31, 2016

I think this could mostly be achieved by adding a new config option such as new-frame.opens-in-background. This could then be used for all parts of this function:

https://github.com/kylef/webkitten/blob/e3a822e852d2faf3f0fb92f236dc1300bea69e18/src/lib.rs#L60-L66

Which would either refocus, the window, or webview that was focused at the time after opening the new URL.

I'm happy to take a stab at this if everyone is on board with the approach!

@kattrali
Copy link
Owner

I think the config option in the right track, though you may have to touch some dirty internals in window.rs to prevent showing a newly-added webview. Getting started should be as simple as adding a focus argument to open_webview though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants