【发布时间】:2016-02-09 07:31:07
【问题描述】:
我有以下代码来介绍我的 Chrome 扩展程序。
// detect if this is the first time running
var first_run = false;
if (!localStorage['ran_before']) {
first_run = true;
localStorage['ran_before'] = '1';
}
// if not, start the intro() script
if (first_run) intro();
// intro script
function intro() {
window.open("intro/index.html", '_blank');
}
但遗憾的是,当我单击扩展程序时,它不会打开 popup.html,而只是打开介绍页面.. 它需要保持 popup.html 处于打开状态,我确信有办法做到这一点. 我想同时打开它们。
最好的方法是什么?
【问题讨论】:
-
如果你想打开
popup.html,你可能不应该打电话给window.open("intro/index.html")。 -
@DanielBeck 实际上,我想同时打开它们。
-
应该打开
popup.html的代码在哪里? -
@DanielBeck 不需要代码,用户点击右上角的图标打开扩展。
-
我们在 popup.html 中查看的代码也是?
标签: javascript jquery html google-chrome-extension