mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
make close-and-halt work on new tabs in Chrome
this is not possible in Firefox, as new tabs/windows which were *not* opened via a script ( window.open call ) are not allowed to be closed via window.close and will yield a message like -- [11:50:59.691] Scripts may not close windows that were not opened by script. @ http://localhost:8888/static/notebook/js/menubar.js:105
This commit is contained in:
parent
57fa14a2fa
commit
1123af8528
@ -131,7 +131,11 @@ var IPython = (function (IPython) {
|
||||
});
|
||||
this.element.find('#kill_and_exit').click(function () {
|
||||
IPython.notebook.session.delete();
|
||||
setTimeout(function(){window.close();}, 500);
|
||||
setTimeout(function(){
|
||||
// allow closing of new tabs in Chromium, impossible in FF
|
||||
window.open('', '_self', '');
|
||||
window.close();
|
||||
}, 500);
|
||||
});
|
||||
// Edit
|
||||
this.element.find('#cut_cell').click(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user