Skip to content

Commit

Permalink
Simplify favicons handling in non-e10s mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Aug 22, 2016
1 parent 282a726 commit c76db27
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1264,8 +1264,8 @@ var privateTab = {

args = Array.slice(args);
try {
var doc = browser.contentDocument || browser.contentDocumentAsCPOW;
if(doc instanceof Components.interfaces.nsIImageDocument) {
var doc = browser.contentDocument;
if(doc && doc instanceof Components.interfaces.nsIImageDocument) {
// Will use base64 representation for icons of image documents
var req = doc.imageRequest;
var image = req && req.image;
Expand All @@ -1286,14 +1286,10 @@ var privateTab = {
}
}
catch(e) {
if(!doc && ("" + e).indexOf("unsafe CPOW usage") != -1)
_log("setTabAttributeProxy(): can't get content document, unsafe CPOW usage");
else {
Components.utils.reportError(e);
// Something went wrong, will use cached icon
args[1] = "moz-anno:favicon:" + val.replace(/[&#]-moz-resolution=\d+,\d+$/, "");
_log("setTabAttributeProxy() => moz-anno:favicon:");
}
Components.utils.reportError(e);
// Something went wrong, will use cached icon
args[1] = "moz-anno:favicon:" + val.replace(/[&#]-moz-resolution=\d+,\d+$/, "");
_log("setTabAttributeProxy() => moz-anno:favicon:");
}
return done();
},
Expand Down

0 comments on commit c76db27

Please sign in to comment.