Bug 92737 - Part 10: Use browserDragAndDrop.dropLinks in urlbarBindings.xml

Issue #121
This commit is contained in:
janekptacijarabaci 2018-04-15 11:53:33 +02:00 committed by Roy Tam
commit 9a8a5cb244

View file

@ -455,11 +455,12 @@
<method name="onDrop">
<parameter name="aEvent"/>
<body><![CDATA[
let url = browserDragAndDrop.drop(aEvent, { })
let links = browserDragAndDrop.dropLinks(aEvent);
// The URL bar automatically handles inputs with newline characters,
// so we can get away with treating text/x-moz-url flavours as text/plain.
if (url) {
if (links.length > 0 && links[0].url) {
let url = links[0].url;
aEvent.preventDefault();
this.value = url;
SetPageProxyState("invalid");