mirror of
https://github.com/HackPlan/atom-shell.git
synced 2026-04-29 12:15:38 +08:00
Remove iframe related security code
This commit is contained in:
@@ -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'
|
||||
|
||||
7
spec/fixtures/pages/change-parent.html
vendored
7
spec/fixtures/pages/change-parent.html
vendored
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
window.parent.changedByIframe = true;
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user