integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Remove calls to deprecated `document.execCommand()`

Open timobrembeck opened this issue 2 years ago • 0 comments

Motivation

The Browser API method document.execCommand() is deprecated.

Proposed Solution

Although all modern browsers still support this feature, it may be removed in future versions.

Alternatives

Just hope that the feature is so widespread that browsers don't remove it anytime soon. :sweat_smile:

Additional Context

Usages:

createlink

https://github.com/digitalfabrik/integreat-cms/blob/810bd2f3be861db0148a5e0410b5878ee59bfa17/integreat_cms/static/src/js/tinymce-plugins/autolink_tel/plugin.js#L146 https://github.com/digitalfabrik/integreat-cms/blob/810bd2f3be861db0148a5e0410b5878ee59bfa17/integreat_cms/static/src/js/tinymce-plugins/autolink_tel/plugin.js#L156

AutoUrlDetect

https://github.com/digitalfabrik/integreat-cms/blob/810bd2f3be861db0148a5e0410b5878ee59bfa17/integreat_cms/static/src/js/tinymce-plugins/autolink_tel/plugin.js#L176

copy

https://github.com/digitalfabrik/integreat-cms/blob/810bd2f3be861db0148a5e0410b5878ee59bfa17/integreat_cms/static/src/js/copy-clipboard.ts#L21 document.execCommand("copy") can be replaced by the Clipboard_API

timobrembeck avatar Oct 09 '22 19:10 timobrembeck