MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / updateIcon

Method updateIcon

src/app/service/service_worker/runtime.ts:682–698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

680 }
681
682 updateIcon() {
683 const enableUserscript: boolean = this.isUserScriptsAvailable && this.isLoadScripts;
684 const iconUrl = enableUserscript
685 ? chrome.runtime.getURL("assets/logo-32.png") // 设置正常logo
686 : chrome.runtime.getURL("assets/logo-gray-32.png"); // 如果未启用脚本,设置灰色的logo
687 chrome.action.setIcon(
688 {
689 path: { "32": iconUrl },
690 },
691 () => {
692 const lastError = chrome.runtime.lastError;
693 if (lastError) {
694 console.error("chrome.runtime.lastError in chrome.action.setIcon:", lastError);
695 }
696 }
697 );
698 }
699
700 public loadBlacklist() {
701 // 设置黑名单match

Callers 3

initMethod · 0.95

Calls 2

getURLMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected