Skip to content

Commit

Permalink
Also detect view source tab from popup windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Jan 19, 2016
1 parent abdcfe7 commit ffa41c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,10 @@ var privateTab = {
patcher.wrapFunction(
window, fnViewSource, fnViewSource,
function before(argsOrDoc) {
var isPrivate = this.isPrivateContent(window);
var w = this.getNotPopupWindow(window, true) || window;
var isPrivate = this.isPrivateContent(w);
_log(fnViewSource + "(): wait for tab to make " + (isPrivate ? "private" : "not private"));
this.readyToOpenTab(window, isPrivate);
this.readyToOpenTab(w, isPrivate);
}.bind(this)
);
}
Expand Down Expand Up @@ -2414,10 +2415,10 @@ var privateTab = {
callback(null);
}, 0);
},
getNotPopupWindow: function(window) {
getNotPopupWindow: function(window, force) {
if(window.toolbar && window.toolbar.visible)
return window;
if(prefs.get("dontUseTabsInPopupWindows")) try {
if(force || prefs.get("dontUseTabsInPopupWindows")) try {
var {RecentWindow} = Components.utils.import("resource:///modules/RecentWindow.jsm", {});
return RecentWindow.getMostRecentBrowserWindow({
allowPopups: false
Expand Down

0 comments on commit ffa41c1

Please sign in to comment.