Purposely Crash Chrome Tab for Chrome Extension
Load chrome://kill
on the tab.
For example, to kill this tab on chrome, enter chrome://kill
in the URL bar and hit enter.
Extra fun as of Chrome 20: chrome://favicon/size/1/http://gonna.crash.you/
Got this working and packaged up as an extension. Here's the relevant code:
// Called when the user clicks on the browser action.chrome.browserAction.onClicked.addListener(function(tab) { queryInfo = new Object(); chrome.tabs.query(queryInfo, function(result) { var i; for (i=0; i < result.length; i += 1) { chrome.experimental.processes.getProcessIdForTab(result[i].id, function(processId) { chrome.experimental.processes.terminate(processId); }); } });});
With the experimental processes API, you can end processes, including those that belong to tabs.
I have thought of that exact same use case - if you ever complete your extension I'd like to try it!
Though maybe a better idea for now could be for your background page could redirect tabs to a data uri based on the page, such as
data:text/html,<a href="http://www.google.com/">click here to restore</a>
or maybe an extension page that generates pages based on its query parameters:
my_extension_page.html?url=http://www.google.com/