我的网站打开的每个新标签都有4个简单的扩展名。我试图让它不在地址栏中显示我的网址。对1或全4的任何帮助都将不胜感激。
Chrome扩展程序:
chrome.tabs.onCreated.addListener(
function(tab){
var newTabURL = {url: 'https://www.mywebsite.com'};
if(tab.url === "chrome://newtab/")
{
chrome.tabs.update(newTabURL);
}
console.log(tab.url);
}
);

Firefox扩展程序:
browser.tabs.onCreated.addListener(
function(tab){
var newTabURL = {url: 'https://www.mywebsite.com'};
if(tab.url === "about:newtab")
{
browser.tabs.update(newTabURL);
}
console.log(tab.url);
}
);

Opera Extension:
chrome.tabs.onCreated.addListener(
function(tab){
var newTabURL = {url: 'https://www.mywebsite.com'};
if(tab.url === "chrome://startpage/")
{
chrome.tabs.update(newTabURL);
}
console.log(tab.url);
}
);

边缘扩展:
browser.tabs.onCreated.addListener(
function(tab){
var newTabURL = {url: 'https://www.mywebsite.com'};
browser.tabs.update(newTabURL);
console.log(tab.url);
}
);