diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index 53755077d8..a39d4e312e 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -741,6 +741,13 @@ .getService(Ci.nsIClipboard) .supportsSelectionClipboard()) return; + + // Check if this selection was actually user-generated, and exit if not + // to prevent copying the selection (e.g autofill) to clipboard/primary + if (!window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils) + .isHandlingUserInput) + return; var val = this._getSelectedValueForClipboard(); if (!val)