Search result tabs didn't become children of the current tab if the selection include white spaces before/after the search term.
This commit is contained in:
parent
24fc712975
commit
ec294ee820
@ -225,6 +225,8 @@ TreeStyleTabWindow.prototype = {
|
|||||||
|
|
||||||
shouldOpenSearchResultAsChild : function TSTWindow_shouldOpenSearchResultAsChild(aTerm)
|
shouldOpenSearchResultAsChild : function TSTWindow_shouldOpenSearchResultAsChild(aTerm)
|
||||||
{
|
{
|
||||||
|
aTerm = aTerm.replace(/^\s+|\s+$/g, '');
|
||||||
|
|
||||||
var mode = this.getTreePref('autoAttach.searchResult');
|
var mode = this.getTreePref('autoAttach.searchResult');
|
||||||
if (mode == this.kSEARCH_RESULT_ATTACH_ALWAYS) {
|
if (mode == this.kSEARCH_RESULT_ATTACH_ALWAYS) {
|
||||||
return true;
|
return true;
|
||||||
@ -241,7 +243,7 @@ TreeStyleTabWindow.prototype = {
|
|||||||
if (!aWindow || !(aWindow instanceof Ci.nsIDOMWindow))
|
if (!aWindow || !(aWindow instanceof Ci.nsIDOMWindow))
|
||||||
return false;
|
return false;
|
||||||
var selection = aWindow.getSelection();
|
var selection = aWindow.getSelection();
|
||||||
if (selection && selection.toString() == aTerm)
|
if (selection && selection.toString().replace(/^\s+|\s+$/g, '') == aTerm)
|
||||||
return true;
|
return true;
|
||||||
return aWindow.frames ? Array.slice(aWindow.frames).some(arguments.callee) : false ;
|
return aWindow.frames ? Array.slice(aWindow.frames).some(arguments.callee) : false ;
|
||||||
})(w);
|
})(w);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user