Remove iframe related security code

This commit is contained in:
Cheng Zhao
2014-10-25 19:08:21 +08:00
parent e7825da0f8
commit 81170d81b3
9 changed files with 1 additions and 197 deletions

View File

@@ -37,34 +37,6 @@ describe 'chromium feature', ->
assert.equal b.constructor.name, 'BrowserWindow'
b.destroy()
describe 'iframe', ->
page = path.join fixtures, 'pages', 'change-parent.html'
beforeEach ->
global.changedByIframe = false
it 'can not modify parent by default', (done) ->
iframe = $('<iframe>')
iframe.hide()
iframe.attr 'src', "file://#{page}"
iframe.appendTo 'body'
isChanged = ->
iframe.remove()
assert.equal global.changedByIframe, false
done()
setTimeout isChanged, 30
it 'can modify parent when sanbox is set to none', (done) ->
iframe = $('<iframe sandbox="none">')
iframe.hide()
iframe.attr 'src', "file://#{page}"
iframe.appendTo 'body'
isChanged = ->
iframe.remove()
assert.equal global.changedByIframe, true
done()
setTimeout isChanged, 30
describe 'creating a Uint8Array under browser side', ->
it 'does not crash', ->
RUint8Array = require('remote').getGlobal 'Uint8Array'

View File

@@ -1,7 +0,0 @@
<html>
<body>
<script type="text/javascript" charset="utf-8">
window.parent.changedByIframe = true;
</script>
</body>
</html>