Install the bleeding-edge version of Chrome (get if from the dev channel or use Canary) and create an extension that uses the chrome.processes
API.
It seems that the browser's process has ID 0. So, the following code will terminate Chrome:
chrome.processes.terminate(0);
However, since this is not documented, I suggest to get a list of processes, loop through the list and terminate the browser's process:
chrome.processes.getProcessInfo([], false, function(processes) {
processes.forEach(function(process) {
if (process.type === 'browser') {
chrome.processes.terminate(process.id);
}
});
});
Alternative methods that work in all Chrome versions:
- Create a NPAPI plugin and kill Chrome.
- Host a local server of your choice that terminates your browser on (http) request.
- Install a local application and use the native message API to request termination of Chrome.
These methods are not very convenient, and all either binary code and/or external applications to work. Therefore, I recommend to use the approach I've outlined in my answer.