Skip to content

Commit

Permalink
Dispatch "PrivateTab:PrivateChanged" event only if window is really p…
Browse files Browse the repository at this point in the history
…rivate

(related to #94)
  • Loading branch information
Infocatcher committed Aug 24, 2013
1 parent 4913a81 commit ed5e3cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion protocolRedirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
}
}
}
if(tab) {
if(
tab
&& !tab.hasAttribute("privateTab-isPrivate")
&& "PrivateBrowsingUtils" in win
&& win.PrivateBrowsingUtils.isWindowPrivate(window)
) {
var evt = doc.createEvent("UIEvent");
evt.initUIEvent("PrivateTab:PrivateChanged", true, false, win, 1);
tab.dispatchEvent(evt);
Expand Down

0 comments on commit ed5e3cd

Please sign in to comment.