在编写谷歌浏览器插件的时候,如果我在background.js中用chrome.tabs.update跳到我本地的页面,如下面这样
chrome.tabs.onCreated.addListener(function (tab) {
if( (tab.title =='新标签页' || tab.pendingUrl == 'edge://newtab/')){
console.log('内部执行1 edge');
chrome.tabs.update(tab.id, { url: 'static/HTML/ntab.html' });
}
if( (tab.title == '新建标签页' || tab.pendingUrl == 'chrome://newtab/')){
console.log('内部执行2 guge');
chrome.tabs.update(tab.id, { url: 'static/HTML/ntab.html' });
}
if(tab.pendingUrl == 'qqbrowser://newtab'){
console.log('内部执行3 QQ');
chrome.tabs.update(tab.id, { url: 'static/HTML/ntab.html' });
}
});
我要怎么在我跳去我本地的static/HTML/ntab.html后,返回浏览器默认的打开新标签页地址呢?