Chrome extension: open html in crx file without tab icon

Hey. I am developing a simple chrome extension that replaces the current new tab by default by opening index.html in the .crx extension directory.

Currently, the new tab has already been changed using the new index.html page, however there is no icon on the tab.

May I ask why? Many thanks!

Current problem opened with a new tab without a tab icon

Current problem

The extension directory is as follows:

catalog

manifest.json code is as follows

{
    "manifest_version": 2,  
    "name": "千山",  
    "version": "0.1.0",  
    "description": "测试", 
    "icons": {"16": "icon200.png", "48": "icon200.png", "128": "icon200.png"},
    "browser_action": {  
        "default_icon": "icon.png" ,
        "default_title": "测试",
        "default_popup": "popup.html"
    },
    "chrome_url_overrides": {
        "newtab": "index.html"
    }
}

head of index.html is as follows, and I actually wrote, but it did not display

<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>千山</title>
    <!-- Bootstrap -->
    <link href="bootstrap.min.css" rel="stylesheet">
    <link rel="icon" href="fav.ico" type="image/x-icon">
+4
2

"fav.ico" . JavaScript , chrome.runtime.getURL("fav.ico").

, , ( key.pem), JavaScript.

"fav.ico" web_accessible_resources manifest.json:

{
    "web_accessible_resources": [
        "fav.ico",
        "bootstrap.min.css"
    ]
}
+1

, - . Chrome New .

, , .

, , , .

0

Source: https://habr.com/ru/post/1584069/


All Articles