Bug 547731 - browser-ui.js#159 tab is null error [r=mark.finkle]
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -146,18 +146,19 @@ var BrowserUI = {
},
_linkAdded : function(aEvent) {
let link = aEvent.originalTarget;
if (!link || !link.href)
return;
if (/\bicon\b/i(link.rel)) {
+ // Must have an owner document and not be in a frame
var ownerDoc = link.ownerDocument;
- if (!ownerDoc) // no document, no icon
+ if (!ownerDoc || ownerDoc.defaultView.frameElement)
return;
let tab = Browser.getTabForDocument(ownerDoc);
tab.setIcon(link.href);
// If the link changes after pageloading, update it right away.
// otherwise we wait until the pageload finishes
if ((tab.browser == Browser.selectedBrowser) && !tab.isLoading())
this._updateIcon(tab.browser.mIconURL);