I\'m creating a website blocker: after you visit a website you\'ve blocked, the browser displays a new HTML page saying \"website blocked\". The new HTML page is saved in my
Assuming all of the following are true:
tabId
.You could do the following, which uses chrome.tabs.update() (Firefox docs) to change the tab with the ID contained in tabId
to display your message.html:
chrome.tabs.update(tabId ,{url:'/message.html'});
or
chrome.tabs.update(tabId ,{url:chrome.runtime.getURL('/message.html'}));
If you are changing the currently selected tab in the active window, then the tabId
is not required, and you can omit that argument.
Assuming all of the following are true:
You can use chrome.tabs.create() (Firefox docs) to create a new tab to display message.html:
chrome.tabs.create({url:'/message.html'});
or
chrome.tabs.create({url:chrome.runtime.getURL('/message.html'}));
Assuming all of the following are true:
You can use chrome.windows.create() (Firefox docs) to open a new window to display message.html:
chrome.windows.create({url:'/message.html'});
or
chrome.windows.create({url:chrome.runtime.getURL('/message.html'}));