can't do search from the web search bar in some webpages

This commit is contained in:
SHIMODA Hiroshi 2010-12-09 23:33:04 +09:00
parent 950ef92e8b
commit c2f3cfaf17
2 changed files with 6 additions and 3 deletions

View File

@ -157,9 +157,12 @@ var TreeStyleTabService = {
w = this.browser.contentWindow;
return (function(aWindow) {
if (aWindow.getSelection().toString() == aTerm)
if (!aWindow || !(aWindow instanceof Components.interfaces.nsIDOMWindow))
return false;
var selection = aWindow.getSelection();
if (selection && selection.toString() == aTerm)
return true;
return Array.slice(aWindow.frames).some(arguments.callee);
return aWindow.frames ? Array.slice(aWindow.frames).some(arguments.callee) : false ;
})(w);
},
kSEARCH_RESULT_DO_NOT_ATTACH : 0,

View File

@ -5,7 +5,7 @@
<RDF:Description RDF:about="urn:mozilla:install-manifest"
em:id="treestyletab@piro.sakura.ne.jp"
em:name="Tree Style Tab"
em:version="0.11.2010120902"
em:version="0.11.2010120903"
em:creator="SHIMODA Hiroshi"
em:description="Show tabs like a tree."
em:homepageURL="http://piro.sakura.ne.jp/xul/_treestyletab.html.en"