在Google Chrome扩展程序中添加“选项”菜单

时间:2011-10-01 11:21:18

标签: javascript google-chrome google-chrome-extension

如何在右键点击Google Chrome扩展程序的图标时添加选项菜单?

我创建了一个名为options.html的文件;现在我如何将其链接起来以便它起作用?我认为这是自动的。

1 个答案:

答案 0 :(得分:3)

Google Chrome会自动填充右键单击菜单,因此要在其中包含一个选项,您的扩展程序需要实际提供选项页面。正如您已经想到的那样,通过将以下行添加到options.html来指定manifest.json作为您的选项页面:

"options_page": "options.html",

请参阅documentation of this feature