forcecopy

force copy

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyforks.org/scripts/534397/1580089/forcecopy.js

;PushIconAction({
    name: 'force copy',
    id: 'icon-copy',
    image: GM_getResourceURL('icon-copy'),
    trigger: (t, hideIcon) => {
        const el = getSelectionElement();
        const html = el.innerHTML ? el.innerHTML : t;
        const item = new ClipboardItem({
            'text/html': new Blob([html], {type: 'text/html'}),
            'text/plain': new Blob([t], {type: 'text/plain'}),
        })
        navigator.clipboard.write([item]).catch((err) => {
            console.log(err);
            request('text=' + t, '', () => {
                hideIcon();
            }).catch(console.log);
        });
    },
});
长期地址
遇到问题?请前往 GitHub 提 Issues。