Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome extension 关于chrome扩展开发的困惑_Google Chrome Extension - Fatal编程技术网

Google chrome extension 关于chrome扩展开发的困惑

Google chrome extension 关于chrome扩展开发的困惑,google-chrome-extension,Google Chrome Extension,在弹出页面上有一个函数chrome.tabs.create,背景页面有chrome.tabs.onCreated.addListener,并且onCreated.addListener中有chrome.tabs.getSelected,我不明白为什么没有警报代码就不能继续。代码是这样的 $(document).ready(function() { chrome.tabs.onCreated.addListener(function() { alert("Login"); //witho

在弹出页面上有一个函数chrome.tabs.create,背景页面有chrome.tabs.onCreated.addListener,并且onCreated.addListener中有chrome.tabs.getSelected,我不明白为什么没有警报代码就不能继续。代码是这样的

    $(document).ready(function() { chrome.tabs.onCreated.addListener(function() {
alert("Login");  //without this can not go on.only click the alert can work
$("#dialog").dialog("open");chrome.tabs.getSelected(null,function(tab) {chrome.tabs.sendRequest(tab.id,

该警报不会停止执行其余代码。在单击警报上的“确定”之前,您必须经历浏览器UI中的更改。这实际上就是chrome的特点。在解决警报之前,您将不会在浏览器的UI中看到任何更改(如创建新选项卡、重新排列选项卡等)

请澄清您的问题。很难理解你想要完成什么和什么不起作用。