fix: include pending background tabs in tab list; add tabs create/switch to batch - #736
Open
tqjason wants to merge 1 commit into
Open
fix: include pending background tabs in tab list; add tabs create/switch to batch#736tqjason wants to merge 1 commit into
tqjason wants to merge 1 commit into
Conversation
…h on URL commit); add tabs create/switch to batch
fix(tmwdb): show newly created background tabs before page fully loads
Tabs created via chrome.tabs.create({active: false}) were missing from
the pushed tab list until the page reached 'complete' status, because:
1. sendTabsUpdate() ran on tabs.onCreated while the tab's navigation
had not committed, so tab.url was "" and isScriptable() filtered it
out (the real URL lives in tab.pendingUrl at that point).
2. The tabs.onUpdated listener only fired on status==='complete', so
no update was pushed when the URL committed during loading.
Introduce tabUrl() = t.url || t.pendingUrl || '' and use it everywhere
a tab URL is read (ext_ready, tabs_update, tabs list, batch tabs,
handleWsExec newTabs capture, tabs create response, handleCookies).
Also push tabs_update on changeInfo.url so a new tab appears as soon
as its navigation commits instead of only after full page load.
Additionally:
- Fix handleExtMessage tabs branching to if/else-if/else so 'create'
no longer relies on early return to skip the list branch.
- Support tabs create/switch sub-commands inside batch requests.
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.
fix(tmwdb): show newly created background tabs before page fully loads
Tabs created via chrome.tabs.create({active: false}) were missing from the pushed tab list until the page reached 'complete' status, because:
Introduce tabUrl() = t.url || t.pendingUrl || '' and use it everywhere a tab URL is read (ext_ready, tabs_update, tabs list, batch tabs, handleWsExec newTabs capture, tabs create response, handleCookies). Also push tabs_update on changeInfo.url so a new tab appears as soon as its navigation commits instead of only after full page load.
Additionally: