mirror of
https://github.com/electron/electron.git
synced 2026-01-09 23:48:01 -05:00
Add cross-origin frame webview spec
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
try {
|
||||
if (popup.location.toString() !== 'about:blank') {
|
||||
clearInterval(intervalID)
|
||||
ipcRenderer.send('answer', 'did not throw error')
|
||||
ipcRenderer.send('answer', `Did not throw error accessing location: ${popup.location}`)
|
||||
}
|
||||
} catch (error) {
|
||||
clearInterval(intervalID)
|
||||
|
||||
@@ -1686,6 +1686,15 @@ describe('<webview> tag', function () {
|
||||
document.body.appendChild(webview)
|
||||
})
|
||||
|
||||
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()
|
||||
})
|
||||
webview.src = 'file://' + path.join(fixtures, 'api', 'native-window-open-cross-origin.html')
|
||||
document.body.appendChild(webview)
|
||||
})
|
||||
|
||||
it('emits a new-window event', (done) => {
|
||||
webview.addEventListener('new-window', function (e) {
|
||||
assert.equal(e.url, 'http://host/')
|
||||
|
||||
Reference in New Issue
Block a user