##// END OF EJS Templates
Backport PR #6120: Only allow iframe embedding on same origin....
Backport PR #6120: Only allow iframe embedding on same origin. This sets the iframe security policy by default to only allow same origin embedding of the notebook. This can be overridden by changing `headers['X-Frame-Options']`.

File last commit:

r15201:029ac024
r17365:e35c0e60
Show More
inject_js.js
23 lines | 648 B | application/javascript | JavascriptLexer
//
// Test robustness about JS injection in different place
//
// This assume malicious document arrive to the frontend.
//
casper.notebook_test(function () {
var messages = [];
this.on('remote.alert', function (msg) {
messages.push(msg);
});
this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
var json = cell.toJSON();
json.prompt_number = "<script> alert('hello from input prompts !')</script>";
cell.fromJSON(json);
});
this.then(function () {
this.test.assert(messages.length == 0, "Captured log message from script tag injection !");
});
});