Skip to content

Commit

Permalink
Try Element.prototype.setAttribute() in tab.setAttribute() wrapper
Browse files Browse the repository at this point in the history
Shouldn't call itself even if someone will create yet another wrapper
(#214)
  • Loading branch information
Infocatcher committed Mar 9, 2016
1 parent 6fef2c5 commit df70dc2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,15 +1218,16 @@ var privateTab = {
},
setTabAttributeProxy: function(attr, val) {
var args = arguments;
var tab = this;
if(attr == "image" && val) {
val += ""; // Convert to string
if(
!val.startsWith("moz-anno:favicon:")
&& privateTabInternal.isPrivateTab(this)
&& privateTabInternal.isPrivateTab(tab)
) {
args = Array.slice(args);
try {
var browser = this.linkedBrowser;
var browser = tab.linkedBrowser;
var doc = browser.contentDocument || browser.contentDocumentAsCPOW;
if(doc instanceof Components.interfaces.nsIImageDocument) {
// Will use base64 representation for icons of image documents
Expand Down Expand Up @@ -1256,7 +1257,8 @@ var privateTab = {
}
}
}
return Object.getPrototypeOf(Object.getPrototypeOf(this)).setAttribute.apply(this, args);
var window = tab.ownerDocument.defaultView;
return window.Element.prototype.setAttribute.apply(this, args);
},
patchBrowserThumbnails: function(window, applyPatch, forceDestroy) {
if(!("gBrowserThumbnails" in window)) // SeaMonkey?
Expand Down

0 comments on commit df70dc2

Please sign in to comment.