gpt4 book ai didi

javascript - 安装后弹出窗口的 Google Chrome 主题

转载 作者:行者123 更新时间:2023-11-28 09:16:59 24 4
gpt4 key购买 nike

我正在尝试为 google chrome 制作一个主题,但我希望在安装时出现一个弹出窗口。我不确定这是否可能,因为主题与扩展不同。

所以我想通过这个 list 文件,我可以通过扩展来做到这一点:

{
"background": {
"persistent": false,
"scripts": [ "script.js" ]
},
"description": "Een test",
"manifest_version": 2,
"name": "Test Extension",
"version": "0.0.2"
}

在 script.js 中我得到了以下代码:

chrome.runtime.onInstalled.addListener(function(){
window.open('http://www.example.com','','width=800,height=500');
});

这一切都很好。现在最困难的部分是使用它作为主题。问题是,当我将主题对象添加到 list 文件中时,事情似乎无法正常工作:脚本将不再执行。所以此时我的 list 文件如下所示:

{
"background": {
"persistent": false,
"scripts": [ "script.js" ]
},
"description": "Een test",
"manifest_version": 2,
"name": "Test Extension",
"theme": {
"colors": {
"bookmark_text": [ 255, 255, 255 ],
"frame": [ 12, 20, 30 ],
"ntp_background": [ 11, 21, 35 ],
"ntp_header": [ 40, 40, 40 ],
"ntp_link": [ 0, 0, 0 ],
"ntp_section": [ 255, 255, 255, 0.5 ],
"ntp_section_link": [ 0, 0, 0 ],
"ntp_section_text": [ 0, 0, 0 ],
"ntp_text": [ 255, 255, 255 ],
"tab_background_text": [ 10, 10, 10 ],
"tab_text": [ 255, 255, 255 ],
"toolbar": [ 6, 13, 21 ]
},
"images": {
"theme_frame": "img/frame.jpg",
"theme_frame_overlay": "img/frame_overlay.png",
"theme_ntp_attribution": "img/ntp_attribution.png",
"theme_ntp_background": "img/ntp_background.jpg",
"theme_tab_background": "img/tab_background.jpg",
"theme_tab_background_incognito": "img/tab_background.jpg",
"theme_toolbar": "img/toolbar.jpg"
},
"properties": {
"ntp_background_alignment": "bottom right",
"ntp_background_repeat": "no-repeat"
},
"tints": {
"buttons": [ 1, 1, 1 ]
}
},
"version": "0.0.2"
}

我想它不再起作用了,因为该文件现在将被分类为主题。不过,我想我可以在这里发布这个问题。希望大家给点建议。

最佳答案

使用这个( http://www.themebeta.com/chrome-theme-creator-online.html )来创建您的主题,它也会弹出一个窗口。

关于javascript - 安装后弹出窗口的 Google Chrome 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15526831/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com