mozilla-extensions / firefox-voice

Firefox Voice is an experiment in a voice-controlled web user agent
Mozilla Public License 2.0
287 stars 122 forks source link

Cannot paste into URL bar #867

Closed firefoxvoiceissuebot closed 4 years ago

firefoxvoiceissuebot commented 4 years ago

Issue Type: Other Firefox Version: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0 Device: Laptop Location: DOMINICAN REPUBLIC GitHub Username: @Zml99

Steps to Reproduce

1) Ctrl+. 2) "Copy Link" 3) Open new tab. 4) Ctrl+. 5) "Paste"

Expected Behavior

Link should had be pasted in the search bar.

Actual Behavior

Got this error: "Internal error: Error: Missing host permission for the tab"

ianb commented 4 years ago

Let's do two changes:

  1. If you do "paste" and the current tab is about:newtab then we should navigate to whatever is in the clipboard (hoping they aren't trying to paste a search query)
  2. Add a "paste and go" intent that will always try to navigate to what is in the clipboard.

Note this requires some fiddling, creating an input in the background page, pasting into it with document.execCommand("paste"), then reading the input field, and destroying it.