优化输出日志的颜色

This commit is contained in:
xu_yanfeng
2024-12-24 21:09:13 +08:00
parent d62cc0a26c
commit 27f4884216
13 changed files with 199 additions and 181 deletions

View File

@@ -1,18 +1,3 @@
export function injectScript(url: string) {
if (chrome && chrome.runtime && chrome.runtime.getURL) {
let content = chrome.runtime.getURL(url)
const script = document.createElement("script")
script.setAttribute("type", "text/javascript")
script.setAttribute("src", content)
script.onload = function () {
document.head.removeChild(script);
}
document.head.appendChild(script)
console.log(`inject script success: ${content}`);
} else {
console.log("inject script failed")
}
}
interface LogOptions {
data: any;