web: Open new tabs beside the current one by extension#23313
Conversation
* Changes:
* Open new tabs beside the current tab instead of at default position (after all tabs).
* Remove redundant "promisify" wrapper from "tabs.create" calls.
* Test Environment:
* Windows 11, Firefox 143.0.
* Windows 11, Chrome 146.0.7680.80.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pzhlkj6612 <29089388+pzhlkj6612@users.noreply.github.com>
evilpie
left a comment
There was a problem hiding this comment.
Instead of setting the index, you should set the openerTabId to the right tab. In Firefox at least this will automatically open the new tab after the current tab. This behaviour is actually controllable by the user using the about:config preference browser.tabs.insertRelatedAfterCurrent.
Thank you, I didn't know that parameter. Let me check a better appraoch. |
|
Hello!
Unfortunately, Google Chrome does not have such thing:
To make behavior consistent across browsers, I think here what we only can do is specifying the index of newly created tabs. We can search "openerTabId" to see more discussion about it in Chromium's bug tracker: https://issues.chromium.org/issues?q=openerTabId |
| await tabs.create({ url: "/player.html", index }); | ||
| }; | ||
| export const openOnboardPage: () => Promise<void> = async () => { | ||
| const index = await getAdjacentTabIndex(); |
There was a problem hiding this comment.
The onboarding page isn't really related to the current page so I don't think it really make sense to do this.
Hello! Thanks for maintaining Ruffle. I can't always go back to my childhood to play old games without your hard work.
The logic about opening new tabs in the browser extension can be improved. I have so many tabs open. New ones opened by Ruffle always go to the end of the looooong tab list. I asked AI and have modified the code to let new tabs open beside the current one.
I'm not able to test the "onboard.html" page because I can't find a way to trigger the "INSTALL" event with unpacked extension. In Firefox Nightly, installing XPI file with setting
xpinstall.signatures.requiredtofalsedoes not work. I can't figure it out.The two changes about "player.html" have been tested, though.
Here is the commit message:
Please review, thank you!