mirror of
https://github.com/027xiguapi/code-box.git
synced 2026-10-05 13:38:30 +00:00
优化动态logo
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 9.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -1,5 +1,5 @@
|
||||
import defaultUrl from "raw:~/assets/icon.png"
|
||||
import activeUrl from "raw:~/assets/logo.png"
|
||||
import activeUrl from "raw:~/assets/icon.png"
|
||||
import defaultUrl from "raw:~/assets/logo.png"
|
||||
|
||||
import type { PlasmoMessaging } from "@plasmohq/messaging"
|
||||
|
||||
@@ -7,6 +7,7 @@ const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const [tab] = await chrome.tabs.query({ currentWindow: true, active: true })
|
||||
const { active } = req.body
|
||||
|
||||
console.log(active)
|
||||
if (active) {
|
||||
chrome.action.setIcon({ tabId: tab.id, path: activeUrl }, () => {})
|
||||
} else {
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function Content() {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="content">
|
||||
{csdnIsShow ? <Csdn /> : <></>}
|
||||
{zhihuIsShow ? <Zhihu /> : <></>}
|
||||
{baiduIsShow ? <Baidu /> : <></>}
|
||||
@@ -65,6 +65,6 @@ export default function Content() {
|
||||
{phpIsShow ? <Php /> : <></>}
|
||||
{customIsShow ? <Custom /> : <></>}
|
||||
<Config />
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
+3
-1
@@ -3,7 +3,9 @@ import { useEffect } from "react"
|
||||
import { useMessage } from "@plasmohq/messaging/hook"
|
||||
import { useStorage } from "@plasmohq/storage/hook"
|
||||
|
||||
import { addCss } from "~tools"
|
||||
import { addCss, setIcon } from "~tools"
|
||||
|
||||
setIcon(false)
|
||||
|
||||
export default function Custom() {
|
||||
const [runCss] = useStorage<boolean>("custom-runCss")
|
||||
|
||||
Reference in New Issue
Block a user