forcecopy

force copy

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/534397/1580089/forcecopy.js

  1. ;PushIconAction({
  2. name: 'force copy',
  3. id: 'icon-copy',
  4. image: GM_getResourceURL('icon-copy'),
  5. trigger: (t, hideIcon) => {
  6. const el = getSelectionElement();
  7. const html = el.innerHTML ? el.innerHTML : t;
  8. const item = new ClipboardItem({
  9. 'text/html': new Blob([html], {type: 'text/html'}),
  10. 'text/plain': new Blob([t], {type: 'text/plain'}),
  11. })
  12. navigator.clipboard.write([item]).catch((err) => {
  13. console.log(err);
  14. request('text=' + t, '', () => {
  15. hideIcon();
  16. }).catch(console.log);
  17. });
  18. },
  19. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址