fjxfitst
fjxfitst

Reputation: 11

Why can't the icon for the Chrome extension I developed be displayed?

I am developing a Chrome extension that is displayed in the Developer Tools, similar to Network. I used the chrome.devtools.panels.create method and passed the iconPath parameter, but it didn't work. Why? manifest.json

{
  "manifest_version":3,
  "name": "fengjianxiong",
  "version": "1.0",
  "description": "A custom DevTools panel.",
  "permissions": [
    "storage","webRequest","debugger"
  ],
  "host_permissions": [
    "*://*/*"
  ],
  "background": {
    "service_worker": "background.js"
  },
  "devtools_page": "devtools.html",
  "icons": {
    "16": "16.png",
    "32": "32.png",
    "48": "48.png",
    "128": "128.png"
  },
  "content_scripts": [
    {
      "js": [
        "content.js"
      ],
      "matches": [
       "<all_urls>"
      ]
    }
  ]
}

enter image description here enter image description here

I tried replacing the iconPath parameter in the chrome.devtools.panels.create method with images of different sizes, but none of them were displayed. I want the image to be shown on the tab

Upvotes: 1

Views: 61

Answers (1)

Chrysaloid
Chrysaloid

Reputation: 53

You can use emojis in the tab title to achieve icon-like effect. Windows Key + . will bring up the emoji picker on Windows and CTRL + CMD + Space - on Mac. Limitation is that some emojis just won't display in the OS-specific form and will always fallback to Unicode i.e. the Red Heard emoji โค (I can't even type it here in the OS-specific variant probably because of HTML <textarea>'s limitations). Other heart emojis work though, in code as well as here: ๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐ŸคŽ๐Ÿ–ค๐Ÿค.

I know that this might not be what you are looking for but maybe someone else with the same problem will find this workaround helpful.

Upvotes: 0

Related Questions