Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displays Warning Message if Cookies Not Enabled #3511

Merged
merged 13 commits into from Apr 10, 2018
15 changes: 11 additions & 4 deletions notebook/static/notebook/js/notebook.js
Expand Up @@ -3175,6 +3175,7 @@ define([
* @param {Error} error
*/
Notebook.prototype.load_notebook_error = function (error) {
var isSanitized = true;
this.events.trigger('notebook_load_failed.Notebook', error);
var msg;
if (error.name === utils.XHR_ERROR && error.xhr.status === 500) {
Expand All @@ -3187,6 +3188,11 @@ define([
console.warn('Error stack trace while loading notebook was:');
console.warn(error.stack);
}
if (navigator.cookieEnabled == false){
msg = i18n.msg._("Jupyter requires cookies to work; please enable cookies" +
" and refresh page. <a href=\"https://www.wikihow.com/Enable-Cookies-in-Your-Internet-Web-Browser\"> Learn more about enabling cookies. </a>");
isSanitized = false;
}
dialog.modal({
notebook: this,
keyboard_manager: this.keyboard_manager,
Expand All @@ -3198,9 +3204,10 @@ define([
click : function () {
window.close();
}
},
"Ok": {}
}
}
},
sanitize: isSanitized

});
};

Expand Down Expand Up @@ -3378,4 +3385,4 @@ define([
};

return {Notebook: Notebook};
});
});