mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 252441 - Dropping text containing spaces will now perform a search on the given sentence. r=gavin.sharp
This commit is contained in:
parent
c0b4a0ab95
commit
382a30b4a7
@ -4030,8 +4030,7 @@
|
|||||||
url = browserDragAndDrop.drop(event, { }, true);
|
url = browserDragAndDrop.drop(event, { }, true);
|
||||||
} catch (ex) {}
|
} catch (ex) {}
|
||||||
|
|
||||||
// valid urls don't contain spaces ' '; if we have a space it isn't a valid url.
|
if (!url)
|
||||||
if (!url || url.contains(" "))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let bgLoad = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
|
let bgLoad = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
|
||||||
@ -4043,12 +4042,12 @@
|
|||||||
if (!tab || dropEffect == "copy") {
|
if (!tab || dropEffect == "copy") {
|
||||||
// We're adding a new tab.
|
// We're adding a new tab.
|
||||||
let newIndex = this._getDropIndex(event);
|
let newIndex = this._getDropIndex(event);
|
||||||
let newTab = this.tabbrowser.loadOneTab(getShortcutOrURI(url), {inBackground: bgLoad});
|
let newTab = this.tabbrowser.loadOneTab(url, {inBackground: bgLoad, allowThirdPartyFixup: true});
|
||||||
this.tabbrowser.moveTabTo(newTab, newIndex);
|
this.tabbrowser.moveTabTo(newTab, newIndex);
|
||||||
} else {
|
} else {
|
||||||
// Load in an existing tab.
|
// Load in an existing tab.
|
||||||
try {
|
try {
|
||||||
this.tabbrowser.getBrowserForTab(tab).loadURI(getShortcutOrURI(url));
|
this.tabbrowser.getBrowserForTab(tab).loadURIWithFlags(url, Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
|
||||||
if (!bgLoad)
|
if (!bgLoad)
|
||||||
this.selectedItem = tab;
|
this.selectedItem = tab;
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
|
@ -64,7 +64,7 @@ function test() {
|
|||||||
drop("mochi.test/first", true);
|
drop("mochi.test/first", true);
|
||||||
drop("javascript:'bad'");
|
drop("javascript:'bad'");
|
||||||
drop("jAvascript:'bad'");
|
drop("jAvascript:'bad'");
|
||||||
drop("space bad");
|
drop("search this", true);
|
||||||
drop("mochi.test/second", true);
|
drop("mochi.test/second", true);
|
||||||
drop("data:text/html,bad");
|
drop("data:text/html,bad");
|
||||||
drop("mochi.test/third", true);
|
drop("mochi.test/third", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user