WebUI: switch to lightweight clipboard library

The new library [1] will opt to the modern Clipboard API [2] when it is available. It will
fallback to the old method otherwise.
The new library is also smaller and without any bloat.

Note that the line `module.exports` is required to be removed/commented out. This is the only
patch required.

[1] https://github.com/feross/clipboard-copy
[2] https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API

PR #22792.
This commit is contained in:
Chocobo1
2025-05-31 17:55:10 +08:00
committed by GitHub
parent 4b07597d54
commit 96f0eebc4e
11 changed files with 123 additions and 72 deletions

View File

@@ -31,7 +31,7 @@
<script defer src="scripts/localpreferences.js?v=${CACHEID}"></script>
<script defer src="scripts/color-scheme.js?v=${CACHEID}"></script>
<script defer src="scripts/mocha-init.js?locale=${LANG}&v=${CACHEID}"></script>
<script defer src="scripts/lib/clipboard.min.js"></script>
<script defer src="scripts/lib/clipboard-copy.js"></script>
<script defer src="scripts/filesystem.js?v=${CACHEID}"></script>
<script defer src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
<script defer src="scripts/progressbar.js?v=${CACHEID}"></script>