From 36989e19f8f82ce5363eb87bc6c8020714af6abd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 24 May 2017 13:07:50 -0700 Subject: [PATCH] Add spec for cross-origin blockage --- spec/api-browser-window-spec.js | 8 ++++++++ .../api/native-window-open-cross-origin.html | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 spec/fixtures/api/native-window-open-cross-origin.html diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index d36fa94525d..48f8a579c60 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1285,6 +1285,14 @@ describe('BrowserWindow module', function () { w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open-file.html')) }) + it('blocks accessing cross-origin frames', (done) => { + ipcMain.once('answer', (event, content) => { + assert.equal(content, 'Blocked a frame with origin "file://" from accessing a cross-origin frame.') + done() + }) + w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open-cross-origin.html')) + }) + it('opens window from