Bug 1355073 - Accidentally starting a drag on the identity block reloads the page and discards pending permission prompts. r=johannh
authorphoenixabhishek <phoenixgyaan@gmail.com>
Mon, 25 Mar 2019 21:32:52 +0000
changeset 467922 768adc665e9bbd2e0a279fa0062e0c974e7cbf70
parent 467921 957cc8c178c0ff51070ac45d1b0f140e7d5a26c8
child 467923 aab55dab4d5bd736245393af111e7283741858ed
push id35813
push useraiakab@mozilla.com
push dateThu, 04 Apr 2019 16:07:30 +0000
treeherdermozilla-central@aa623df2ae8f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1355073
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1355073 - Accidentally starting a drag on the identity block reloads the page and discards pending permission prompts. r=johannh Changed the function to check if the dropped and current URL are not same. Differential Revision: https://phabricator.services.mozilla.com/D24509
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1049,19 +1049,20 @@ file, You can obtain one at http://mozil
           }
         ]]></body>
       </method>
 
       <method name="onDrop">
         <parameter name="aEvent"/>
         <body><![CDATA[
           let droppedItem = this._getDroppableItem(aEvent);
-          if (droppedItem) {
+          let droppedURL = droppedItem instanceof URL ? droppedItem.href : droppedItem;
+          if (droppedURL && (droppedURL !== gBrowser.currentURI.spec)) {
             let triggeringPrincipal = browserDragAndDrop.getTriggeringPrincipal(aEvent);
-            this.value = droppedItem instanceof URL ? droppedItem.href : droppedItem;
+            this.value = droppedURL;
             SetPageProxyState("invalid");
             this.focus();
             this.handleCommand(null, undefined, undefined, triggeringPrincipal);
             // Force not showing the dropped URI immediately.
             gBrowser.userTypedValue = null;
             URLBarSetURI(null, true);
           }
         ]]></body>