From 479e6c5137a05ba08ed7c0b4a03ee8e801740dcd Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sat, 20 Feb 2016 16:10:59 +0900 Subject: [PATCH] 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. --- modules/tabbarDNDObserver.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index 29bffbf0..26ec5dfa 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -1278,6 +1278,7 @@ catch(e) { retrieveURLsFromDataTransfer : function TSTService_retrieveURLsFromDataTransfer(aDataTransfer) { + log('retrieveURLsFromDataTransfer'); var urls = []; var types = [ 'text/x-moz-place', @@ -1299,19 +1300,20 @@ catch(e) { if (urls.length) break; } - return urls.filter(function(aURI) { + log(' => retrieved: ', urls); + urls = urls.filter(function(aURI) { return aURI && aURI.length && aURI.indexOf(this.BOOKMARK_FOLDER) == 0 || - ( - aURI.indexOf(' ', 0) == -1 && - !/^\s*(javascript|data):/.test(aURI) - ); + !/^\s*(javascript|data):/.test(aURI); }, this); + log(' => filtered: ', urls); + return urls; }, BOOKMARK_FOLDER: 'x-moz-place:', retrieveURLsFromData : function TSTService_retrieveURLsFromData(aData, aType) { + log('retrieveURLsFromData: ', aType, aData); switch (aType) { case 'text/x-moz-place':