Accept text including whitespaces for drag and drop on the tab bar #633
Now such dropped text will be searched by the default search engine.
This commit is contained in:
parent
833b1c924e
commit
479e6c5137
@ -1278,6 +1278,7 @@ catch(e) {
|
|||||||
|
|
||||||
retrieveURLsFromDataTransfer : function TSTService_retrieveURLsFromDataTransfer(aDataTransfer)
|
retrieveURLsFromDataTransfer : function TSTService_retrieveURLsFromDataTransfer(aDataTransfer)
|
||||||
{
|
{
|
||||||
|
log('retrieveURLsFromDataTransfer');
|
||||||
var urls = [];
|
var urls = [];
|
||||||
var types = [
|
var types = [
|
||||||
'text/x-moz-place',
|
'text/x-moz-place',
|
||||||
@ -1299,19 +1300,20 @@ catch(e) {
|
|||||||
if (urls.length)
|
if (urls.length)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return urls.filter(function(aURI) {
|
log(' => retrieved: ', urls);
|
||||||
|
urls = urls.filter(function(aURI) {
|
||||||
return aURI &&
|
return aURI &&
|
||||||
aURI.length &&
|
aURI.length &&
|
||||||
aURI.indexOf(this.BOOKMARK_FOLDER) == 0 ||
|
aURI.indexOf(this.BOOKMARK_FOLDER) == 0 ||
|
||||||
(
|
!/^\s*(javascript|data):/.test(aURI);
|
||||||
aURI.indexOf(' ', 0) == -1 &&
|
|
||||||
!/^\s*(javascript|data):/.test(aURI)
|
|
||||||
);
|
|
||||||
}, this);
|
}, this);
|
||||||
|
log(' => filtered: ', urls);
|
||||||
|
return urls;
|
||||||
},
|
},
|
||||||
BOOKMARK_FOLDER: 'x-moz-place:',
|
BOOKMARK_FOLDER: 'x-moz-place:',
|
||||||
retrieveURLsFromData : function TSTService_retrieveURLsFromData(aData, aType)
|
retrieveURLsFromData : function TSTService_retrieveURLsFromData(aData, aType)
|
||||||
{
|
{
|
||||||
|
log('retrieveURLsFromData: ', aType, aData);
|
||||||
switch (aType)
|
switch (aType)
|
||||||
{
|
{
|
||||||
case 'text/x-moz-place':
|
case 'text/x-moz-place':
|
||||||
|
Loading…
Reference in New Issue
Block a user