()
| 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 |
no test coverage detected