From 8a671449223b96d1e09d9e87f402d7371379354f Mon Sep 17 00:00:00 2001 From: piro Date: Wed, 23 Dec 2009 16:31:51 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=AD=E3=83=BC=E3=83=9C=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=BC=E3=83=88=E3=82=AB=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=82=84=E3=82=B3=E3=83=94=E3=83=9A=E3=81=8C=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=81=AB?= =?UTF-8?q?=E6=9A=AB=E5=AE=9A=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5591 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/stopRendering.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/res/stopRendering.js b/content/treestyletab/res/stopRendering.js index 5c97b622..32b58095 100644 --- a/content/treestyletab/res/stopRendering.js +++ b/content/treestyletab/res/stopRendering.js @@ -12,7 +12,7 @@ http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/stopRendering.js */ (function() { - const currentRevision = 1; + const currentRevision = 2; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -30,7 +30,7 @@ get rootContentViewer() { - return window + return window.top .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShell) @@ -38,18 +38,32 @@ .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); }, + get isActive() + { + return window.top.document.documentElement.getAttribute('active') == 'true'; + }, + stop : function() { - if (!this._stopLevel) + if (!this._stopLevel) { this.rootContentViewer.hide(); + } this._stopLevel++; }, start : function() { this._stopLevel--; - if (!this._stopLevel) + if (!this._stopLevel) { this.rootContentViewer.show(); + if (this.isActive && !this.timer) { + this.timer = window.setTimeout(function(aSelf) { + aSelf.timer = null; + window.top.blur(); + window.top.focus(); + }, 0, this); + } + } } };