修改复制源码

This commit is contained in:
manchuwork
2025-12-12 04:22:40 +08:00
parent c813f29f85
commit 580c411142

View File

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