mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1543041 - Port bug 1355073 to quantumbar. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D29838 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c531d65bf7
commit
16e544aca5
@ -1555,20 +1555,20 @@ class UrlbarInput {
|
||||
|
||||
_on_drop(event) {
|
||||
let droppedItem = getDroppableData(event);
|
||||
if (!droppedItem) {
|
||||
return;
|
||||
let droppedURL = droppedItem instanceof URL ? droppedItem.href : droppedItem;
|
||||
if (droppedURL && (droppedURL !== this.window.gBrowser.currentURI.spec)) {
|
||||
let principal = Services.droppedLinkHandler.getTriggeringPrincipal(event);
|
||||
this.value = droppedURL;
|
||||
this.window.SetPageProxyState("invalid");
|
||||
this.focus();
|
||||
this.handleCommand(null, undefined, undefined, principal);
|
||||
// For safety reasons, in the drop case we don't want to immediately show
|
||||
// the the dropped value, instead we want to keep showing the current page
|
||||
// url until an onLocationChange happens.
|
||||
// See the handling in URLBarSetURI for further details.
|
||||
this.window.gBrowser.userTypedValue = null;
|
||||
this.window.URLBarSetURI(null, true);
|
||||
}
|
||||
let principal = Services.droppedLinkHandler.getTriggeringPrincipal(event);
|
||||
this.value = droppedItem instanceof URL ? droppedItem.href : droppedItem;
|
||||
this.window.SetPageProxyState("invalid");
|
||||
this.focus();
|
||||
this.handleCommand(null, undefined, undefined, principal);
|
||||
// For safety reasons, in the drop case we don't want to immediately show
|
||||
// the the dropped value, instead we want to keep showing the current page
|
||||
// url until an onLocationChange happens.
|
||||
// See the handling in URLBarSetURI for further details.
|
||||
this.window.gBrowser.userTypedValue = null;
|
||||
this.window.URLBarSetURI(null, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user