mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 07:47:32 +09:00
fuck this shit bro (add tabs.onReplaced notification)
This commit is contained in:
parent
e5a431b519
commit
5ac0d5acc3
6 changed files with 108 additions and 7 deletions
|
|
@ -2920,6 +2920,18 @@
|
|||
// Finish tearing down the tab that's going away.
|
||||
remoteBrowser._endRemoveTab(aOtherTab);
|
||||
|
||||
// Notify WebExtensions when one tab is replaced by another. Tab
|
||||
// adoption uses this same swap internally, but represents a move
|
||||
// and is marked below so it does not generate a replacement event.
|
||||
if (!aOurTab._adoptingTab) {
|
||||
let event = new CustomEvent("TabReplaced", {
|
||||
bubbles: true,
|
||||
detail: {addedTab: aOurTab, removedTab: aOtherTab},
|
||||
});
|
||||
aOurTab.dispatchEvent(event);
|
||||
}
|
||||
delete aOurTab._adoptingTab;
|
||||
|
||||
if (isBusy)
|
||||
this.setTabTitleLoading(aOurTab);
|
||||
else
|
||||
|
|
@ -3359,6 +3371,7 @@
|
|||
params.userContextId = aTab.getAttribute("usercontextid");
|
||||
}
|
||||
let newTab = this.addTab("about:blank", params);
|
||||
newTab._adoptingTab = aTab;
|
||||
let newBrowser = this.getBrowserForTab(newTab);
|
||||
let newURL = aTab.linkedBrowser.currentURI.spec;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue