現在のページがabout:blankなどの時にエラーになる問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1350 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-10-26 19:42:46 +00:00
parent 2508116bc3
commit 381207f5b5

View File

@ -760,8 +760,11 @@ catch(e) {
'{',
<><![CDATA[
{
var currentURI = TreeStyleTabService.browser.currentURI;
var parentTab = TreeStyleTabService.getParentTab(TreeStyleTabService.browser.selectedTab);
var currentURI = TreeStyleTabService.browser.currentURI;
var currentHost = currentURI.spec.match(/^\w+:\/\/[^:\/]+(\/|$)/) ? currentURI.host : null ;
var parentTab = TreeStyleTabService.getParentTab(TreeStyleTabService.browser.selectedTab);
var parentURI = parentTab ? parentTab.linkedBrowser.currentURI : null ;
var parentHost = parentURI && parentURI.spec.match(/^\w+:\/\/[^:\/]+(\/|$)/) ? parentURI.host : null ;
]]></>
).replace(
'aTriggeringEvent && aTriggeringEvent.altKey',
@ -772,16 +775,17 @@ catch(e) {
(
(
TreeStyleTabService.getTreePref('urlbar.loadSameDomainToNewChildTab') &&
currentURI.host == RegExp.$1 &&
currentHost == RegExp.$1 &&
(TreeStyleTabService.readyToOpenChildTab(
parentTab && parentTab.linkedBrowser.currentURI.host == RegExp.$1 ?
parentHost == RegExp.$1 ?
parentTab :
null
), true)
) ||
(
TreeStyleTabService.getTreePref('urlbar.loadSameDomainToNewChildTab') &&
currentURI.host != RegExp.$1
currentHost != RegExp.$1 &&
currentURI.spec != 'about:blank'
)
)
)