Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Add check for native clipboard support and code to use it, fixes #171 #650

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hallvors
Copy link
Contributor

This pull request aims to make sure we use the native clipboard implementation rather than Flash in browsers with sufficient support for that.

If feature detection indicates native support is available, it will add a simple click event listener rather than a Flash overlay. The click listener will in turn add a copy listener, fire execCommand('copy') and remove the copy listener again.

It works OK on this test case in the browsers I've tested:
http://hallvord.com/temp/moz/zeroclipboard/test.html
but it could do with much wider testing - more browser/platform combos, Flash enabled/disabled.

@JamesMGreene - review?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 62.16% when pulling 83f88da on hallvors:minimalNativeClipboardImpl into d88febe on zeroclipboard:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 62.195% when pulling 26a3aa6 on hallvors:minimalNativeClipboardImpl into d88febe on zeroclipboard:master.

@hallvors
Copy link
Contributor Author

@JamesMGreene I fixed the merge conflict here. Guess test coverage is still falling slightly, sorry I have not had time to figure out how to fix that.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 61.931% when pulling 13821cc on hallvors:minimalNativeClipboardImpl into 5beb963 on zeroclipboard:master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants