Fix #38: links open inside the BT standalone window on Vivaldi#45
Open
bennyz327 wants to merge 1 commit into
Open
Fix #38: links open inside the BT standalone window on Vivaldi#45bennyz327 wants to merge 1 commit into
bennyz327 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported in #38 (Vivaldi 7.4): when the Topic Manager is run in WINDOW
(standalone panel) mode, clicking any link in the tree opens the
document inside the BT panel window, replacing the BT UI — rather
than in the user's main browser window. Only Vivaldi is affected;
Chrome, Edge behave correctly.
Root cause
background.js'sopenTabs/openTabGroupscallchrome.tabs.create({url})without a
windowIdwhenever the parent topic has no siblings already open.Chrome's
currentWindowresolution explicitly skipspopup/panel/devtoolswindow types, so on standard Chromium the new tab lands inthe user's most-recently-focused normal window — exactly what we want.
Vivaldi's
currentWindowresolution does not exclude its own panelwindows, so the new tab is routed into the BT panel itself.
Fix
A small helper
nonBTWindowId()returns the id of a non-BT normalwindow to pass to
chrome.tabs.create. It is a Vivaldi-onlyworkaround — it returns
nullon every other browser, so their codepaths are byte-identical to before this PR.
Vivaldi detection uses the
vivExtDataproperty that Vivaldi attachesto every
Windowobject (verified absent on Chrome/Edge). This isrobust to Vivaldi's UA-masking setting, which by default makes Vivaldi
indistinguishable from Chrome via
navigator.userAgent/userAgentData.The helper is also used in
openTabGroupsso "Open All" / tab-grouprestores get the same treatment.
Testing
"Open All" both open in the user's main browser window; BT panel
untouched. Sibling-grouping still routes to the sibling's window.
unchanged from before this PR (helper returns
null, same code pathas today).
before the Vivaldi probe).