This userscript is for use with userChrome.js, see
https://github.com/Sporif/firefox-quantum-userchromejs or https://github.com/ardiman/userChrome.js
It will create a button in the address bar and search field to clear the input field.
This will allow clearing the field without selecting the text first (which would overwrite the clipboard if you use a plugin like "copy on select"). You than can use middle mouse button to paste the before selected text as it is the default in X-Window systems (Linux) or can be activated in about:config (middlemouse.paste=true).