From 77c7e722a6c44c72ccb4bb86e4995e850bb5274d Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 5 Jan 2010 13:09:28 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= 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@5781 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/operationHistory.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/res/operationHistory.js b/content/treestyletab/res/operationHistory.js index f4ca6210..c3935778 100644 --- a/content/treestyletab/res/operationHistory.js +++ b/content/treestyletab/res/operationHistory.js @@ -74,7 +74,7 @@ http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/operationHistory.test.js */ (function() { - const currentRevision = 8; + const currentRevision = 9; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -247,10 +247,10 @@ return true; }, - getWindowId : function(aWindow) + getWindowId : function(aWindow, aDefaultId) { var root = aWindow.document.documentElement; - var id = root.getAttribute(this.WINDOW_ID); + var id = root.getAttribute(this.WINDOW_ID) || aDefaultId; try { if (!id) id = this.SessionStore.getWindowValue(aWindow, this.WINDOW_ID); @@ -263,16 +263,17 @@ var windows = this._getWindowsById(id); var forceNewId = windows.length && (windows.length > 1 || windows[0] != aWindow); - if (!id || forceNewId) { + if (!id || forceNewId) id = 'window-'+Date.now()+parseInt(Math.random() * 65000); + + if (root.getAttribute(this.WINDOW_ID) != id) { + root.setAttribute(this.WINDOW_ID, id); try { this.SessionStore.setWindowValue(aWindow, this.WINDOW_ID, id); } catch(e) { } } - if (root.getAttribute(this.WINDOW_ID) != id) - root.setAttribute(this.WINDOW_ID, id); return id; },