Skip to content

Commit

Permalink
Simplify: use shortcut for PrivateBrowsingUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Aug 19, 2015
1 parent eb3cf57 commit b346a3a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3809,9 +3809,9 @@ var privateTab = {
patchPrivateBrowsingUtils: function(applyPatch) {
var meth = "isWindowPrivate";
var key = "PrivateBrowsingUtils.isWindowPrivate";
var pbu = PrivateBrowsingUtils;
if(applyPatch) {
var _this = this;
var pbu = PrivateBrowsingUtils;
pbu._privateTabOrigIsWindowPrivate = pbu.isWindowPrivate;
patcher.wrapFunction(pbu, meth, key,
function before(window) {
Expand Down Expand Up @@ -3851,8 +3851,8 @@ var privateTab = {
);
}
else {
patcher.unwrapFunction(PrivateBrowsingUtils, meth, key);
delete PrivateBrowsingUtils._privateTabOrigIsWindowPrivate;
patcher.unwrapFunction(pbu, meth, key);
delete pbu._privateTabOrigIsWindowPrivate;
}
_log("patchPrivateBrowsingUtils(" + applyPatch + ")");
if("isContentWindowPrivate" in PrivateBrowsingUtils)
Expand All @@ -3861,9 +3861,9 @@ var privateTab = {
patchPrivateBrowsingUtilsContent: function(applyPatch) {
var meth = "isContentWindowPrivate";
var key = "PrivateBrowsingUtils.isContentWindowPrivate";
var pbu = PrivateBrowsingUtils;
if(applyPatch) {
var _this = this;
var pbu = PrivateBrowsingUtils;
pbu._privateTabOrigIsContentWindowPrivate = pbu.isContentWindowPrivate;
patcher.wrapFunction(pbu, meth, key,
function before(window) {
Expand Down Expand Up @@ -3895,8 +3895,8 @@ var privateTab = {
);
}
else {
patcher.unwrapFunction(PrivateBrowsingUtils, meth, key);
delete PrivateBrowsingUtils._privateTabOrigIsContentWindowPrivate;
patcher.unwrapFunction(pbu, meth, key);
delete pbu._privateTabOrigIsContentWindowPrivate;
}
_log("patchPrivateBrowsingUtilsContent(" + applyPatch + ")");
},
Expand Down

0 comments on commit b346a3a

Please sign in to comment.