- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
您好,我正在开发一个简单的 chrome 扩展程序,它通过在扩展程序的 .crx 目录中打开一个 index.html 来替换当前默认的新标签页。
目前新标签页已经修改为新的index.html页面,但是标签上没有图标。
请问为什么?非常感谢!
当前打开新标签页标签上没有图标的问题
扩展目录如下所示:
manifest.json代码如下
{
"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"
}
}
index.html的head是这样的,我自己写的,但是没有显示出来
<!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">
最佳答案
您需要将相对路径“fav.ico”替换为文件的完整扩展名路径。在 JavaScript 中,您可以通过调用 chrome.runtime.getURL("fav.ico")
获取完整路径。
如果您知道完整路径并采取预防措施以确保您的扩展 ID 不会随时间改变(通过始终使用相同的 key.pem
文件发布),那么硬编码path 将起作用并且不需要任何 JavaScript。
您可能还需要将“fav.ico”添加到manifest.json
的web_accessible_resources
部分:
{
"web_accessible_resources": [
"fav.ico",
"bootstrap.min.css"
]
}
关于javascript - Chrome 扩展 : Open html in the crx file with no icon on tab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29802740/
我在服务器上托管了一个 crx 文件。我的网页上有一个链接,可以将其下载到本地计算机上。 Download document.getElementById('download_frame
Chrome 商店不接受 CRX 文件,只接受简单的 ZIP 文件。 所以我很困惑为什么存在 CRX 文件?还提取 ZIP 文件并加载它的解压选项仍然是一个选项。 据我所知,Chrome 不允许安装
使用 crx 包管理器在 AEM 中构建包时抛出错误“包构建未定义”。但是当我在 etc/packages/mypackages 下检查时,包被创建了。即使错误日志中没有错误或异常。我该如何解决这个问
要安装无 CRX 的 Web 应用程序,需要一个 manifest.json 文件。 然后必须调用函数 chrome.app.install()。 从逻辑上讲,该应用程序应该安装,但它没有。 Chro
我需要为系统上的所有内核设置 CR4.MCE 位 (4)。我想为此编写一个 linux 内核模块,但我不确定如何进行:How do you sequentially access all the CR
我在 Gruntfile 中使用 grunt-crx 任务,如下所示: crx: { packExtension: { src: "../bui
我刚刚创建了一个非常简单的 chrome 扩展,它运行良好。但是当我转换为 .crx 文件并尝试用 chrome 打开它时,没有任何反应。我的chrome浏览器版本是19.0.1081.2 dev-m
目前,安装 Chrome 扩展程序(在开发过程中)的唯一方法是将其从桌面拖到浏览器上,然后在弹出窗口中单击“添加”。我更愿意让整个过程自动化。我目前以编程方式构建、打包和签署我的 CRX,但仍坚持最后
我想从 PHP 生成一个 Chrome 扩展(Chrome 主题)。我的 PHP 脚本生成一个 zip 文件 (download.zip)。要将其转换为 .crx 包,需要添加 header ,包括公
我不确定这些扩展是用哪种语言编写的,我认为它们是用 Html、Javascript 或 JSON 编写的。据我所知,它们被“压缩”在 .CRX 文件中。 可以直接修改 Chrome 扩展程序(或它们使
我正在尝试使用 selenium 将我的扩展安装到远程机器上。我找到了一些代码片段可以实现这一点,但我不知道如何让它工作。 到目前为止我尝试过的是: desired_cap = {'browser':
上周我遇到了一些困难。我已经能够使用以下链接格式使用 chrome 商店中列出的扩展名的 ID 下载 crx 文件。 https://clients2.google.com/service/updat
我使用 --pack-extension 开关编译扩展: C:\Users\APOL0\AppData\Local\Google\Chrome\Application>chrome.exe --pac
我正在做一个涉及浏览器扩展的项目。在 Firefox 中,我确实知道您下载扩展程序后的位置(在您的个人资料文件夹下),我想知道 Chrome 在安装它们后将 crx 隐藏在哪里?特别是在 Mac 中。
我一直在谷歌搜索,但我似乎找不到像 Chrome 商店中那样安装自定义扩展程序的代码。我有自己的链接,可链接到 Dropbox 上的 .crx 文件。我如何通过 html 或 JavaScript 代
我希望能够用 PHP 生成一个 crx 文件。 crx 文件是一个带有附加 header 的 zip 文件,我不知道如何创建这个 header 。如果我使用预生成的 pem 文件,我可以创建一个 cr
我正在尝试从 CRX de 中卸载并删除一个包。为此,我使用“content-package-maven-plugin”并在 Jenkins 中调用顶级 maven 目标,以卸载和 rm 作为此插件的
我们建立了chrome扩展名,供有选择性的人员仅在公司内部使用。我们不希望将此内容发布在chrome网站商店上。我们可以通过在扩展页面中拖放crx文件来完成此操作。 但是在最新版的chrome(我使用
已关闭。这个问题是 not about programming or software development 。目前不接受答案。 这个问题似乎不是关于 a specific programming
您好,我正在开发一个简单的 chrome 扩展程序,它通过在扩展程序的 .crx 目录中打开一个 index.html 来替换当前默认的新标签页。 目前新标签页已经修改为新的index.html页面,
我是一名优秀的程序员,十分优秀!