From 4f467568fb0488a194a4f5e85f6f3fba7617069a Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 11 Jan 2009 10:08:53 +0000 Subject: [PATCH] fix frame handling --- chrome/content/zotero/browser.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js index 22200baebb..374faf27a7 100644 --- a/chrome/content/zotero/browser.js +++ b/chrome/content/zotero/browser.js @@ -360,22 +360,31 @@ var Zotero_Browser = new function() { * called to unregister Zotero icon, etc. */ function contentHide(event) { - if(event.originalTarget instanceof HTMLDocument && !event.originalTarget.defaultView.frameElement) { + if(event.originalTarget instanceof HTMLDocument) { + // Get root document if this is a frameset var doc = event.originalTarget; + var rootDoc = doc; + while(rootDoc.defaultView.frameElement) { + rootDoc = rootDoc.defaultView.frameElement.ownerDocument; + } // Figure out what browser this contentDocument is associated with var browser; for(var i=0; i