]> git.gir.st - VimFx.git/commit
Dispatch trusted mouse events to content page (#751)
authorAlan Wu <XrXr@users.noreply.github.com>
Mon, 6 Jun 2016 10:23:05 +0000 (06:23 -0400)
committerSimon Lydell <simon.lydell@gmail.com>
Mon, 6 Jun 2016 10:23:05 +0000 (12:23 +0200)
commit5ca124b4ddc316e209699da8860b0bd1caf9c39f
treee5c0114baee0b2b18cb17b7ecacab7ef44641f9e
parent6858d53e58291a4268b8539407c271f90a7c533a
Dispatch trusted mouse events to content page (#751)

Some DOM APIs need to be called from the handler of a trusted event to
work. `requestFullscreen()` and `document.execCommand('copy')` are
examples of such API.

Before this patch, VimFx dispatched mouse events using
`element.dispatchEvent()` which had the event handlers for the events
running in untrusted context. This behavior prevented hint mode from
full-screening on Youtube and copying clone addresses on Github.

This patch uses XPCOM to dispatch mouse events as trusted events to the
content page.

See also:
https://www.w3.org/TR/uievents/#trusted-events - info from the spec
https://clipboardjs.com/ - before this patch, copying doesn't work
extension/lib/utils.coffee
Imprint / Impressum