diff --git a/script2-1-qcc-acq.js b/script2-1-qcc-acq.js index bbdcf11..42cf5a4 100644 --- a/script2-1-qcc-acq.js +++ b/script2-1-qcc-acq.js @@ -8,7 +8,8 @@ // @match https://aiqicha.baidu.com/company_detail_* // @match https://www.tianyancha.com/company/* // @match https://shiming.gsxt.gov.cn/* -// @grant none +// @grant GM_setClipboard +// @run-at document-start // ==/UserScript== (function () { @@ -1177,19 +1178,9 @@ class TianYanChaParser { // 复制源码按钮 const copySourceButton = createButton("复制源码", () => { - const html = document.documentElement.outerHTML; - - copyToClipboard(html, "HTML源码已复制到剪贴板"); - /* - navigator.clipboard - .writeText(html) - .then(() => { - alert("源码已复制到剪贴板"); - }) - .catch((err) => { - console.error("复制失败:", err); - }); - */ + const html = document.documentElement.outerHTML; + GM_setClipboard(html, 'text'); + ToolUtils.showAutoCloseMessage("源码已复制到剪贴板", "success") }); // 解析公司信息按钮