Skip to content

Commit

Permalink
Clear link to source tab after "SSTabRestoring" + small delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Feb 4, 2017
1 parent 3bcc349 commit f4b285f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3810,6 +3810,14 @@ var privateTab = {
this.waitForTab(window, function(dupTab) {
// This will happens before we leave duplicateTab() statement
dupTab._privateTabSourceTab = tab;
window.addEventListener("SSTabRestoring", function onRestored(e) {
if((e.originalTarget || e.target) != dupTab)
return;
window.removeEventListener(e.type, onRestored, false);
window.setTimeout(function() {
delete dupTab._privateTabSourceTab;
}, 250);
}, false);
});
var dupTab = this.duplicateTabAndTogglePrivate(tab, isPrivate);
dupTab._privateTabWaitInitialize = Date.now();
Expand Down

0 comments on commit f4b285f

Please sign in to comment.