From ed5e3cd8f44d4e7e3683b3bb7a266e1aace77172 Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Sat, 24 Aug 2013 17:11:46 +0400 Subject: [PATCH] Dispatch "PrivateTab:PrivateChanged" event only if window is really private (related to #94) --- protocolRedirect.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/protocolRedirect.html b/protocolRedirect.html index 90b7375..68a0ab1 100644 --- a/protocolRedirect.html +++ b/protocolRedirect.html @@ -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);