我正在编写一个扩展程序,该扩展程序将(例如)打开一个新标签并在新创建的标签内的input
元素上设置一个值。
var creating = browser.tabs.create({
url: "https://myloginform.html"
});
creating.then(onCreated, onError);
function onCreated(){
console.log('here');
}
function onError(){
}
input
元素是用户名字段。
问题是onCreated似乎没有被触发,在我的扩展控制台中,出现以下错误:
Cannot send function call result: other side closed connection (call data: ({path:"tabs.create", args:[{active:null, cookieStoreId:null, index:null, openInReaderMode:null, openerTabId:null, pinned:null, url:"https://myloginform.html", windowId:null}]}))
感谢您的帮助。
我的扩展程序示例: