Skip to content

Add isSupported method #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 8, 2017
Merged

Add isSupported method #355

merged 4 commits into from
Feb 8, 2017

Conversation

itaisteinherz
Copy link
Contributor

@itaisteinherz itaisteinherz commented Dec 15, 2016

This fixes #337.

Created the isSupported method for getting the support of a given action, or all actions if no action is given.
Fixed the default value setting.
Added tests for the isSupported method.
@bboydflo
Copy link

bboydflo commented Jan 5, 2017

@zenorocha would be nice to have this merged

@xiwc
Copy link

xiwc commented Jan 5, 2017

Firefox38 can not use copy,but this check return true.

@itaisteinherz
Copy link
Contributor Author

itaisteinherz commented Jan 5, 2017

@xiwc According to MDN:

Before Firefox 41, clipboard capability needed to be enabled in the user.js preference file. See A brief guide to Mozilla preferences for more information. If the command wasn't supported or enabled, execCommand was raising an exception instead of returning false. In Firefox 41 and later, clipboard capability are enabled by default in any event handler that is able to pop-up a window (semi-trusted scripts).

Did you enable the clipboard capability in the user.js preference file? If you did, then I don't think that this is a problem with the method itself.

@xiwc
Copy link

xiwc commented Jan 6, 2017

@itaisteinherz Thank you for your answers. Is there a way to check clipboard capability is or not enabled as users usually do not know this switch feature.

@itaisteinherz
Copy link
Contributor Author

itaisteinherz commented Jan 6, 2017

@xiwc You could get the browser type and version using this module or this answer from Stack Overflow. Then, if the isSupported method returns true, the browser type is Firefox and the version number is lower than 41, the clipboard capability is enabled. If the browser type is Firefox, the version number is greater than 41 but the isSupported method returns false, the clipboard capability is disabled.

@xiwc
Copy link

xiwc commented Jan 6, 2017

@itaisteinherz got, thks.

@zenorocha zenorocha merged commit 63d1b0f into zenorocha:master Feb 8, 2017
@zenorocha
Copy link
Owner

Sorry for taking so long to merge @itaisteinherz. Thanks a lot!

zenorocha added a commit that referenced this pull request Feb 8, 2017
zenorocha added a commit that referenced this pull request Feb 8, 2017
@itaisteinherz itaisteinherz deleted the add-issupported branch February 8, 2017 15:02
cdll pushed a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
cdll pushed a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
cdll added a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
cdll added a commit to x78w/clipboard.js that referenced this pull request Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add API to check if copy action is supported
4 participants