Skip to content

Commit 115d308

Browse files
shakyShaneShane Osbourne
andauthored
support allow-popups-to-escape-sandbox attribute in duckplayer embed (#997)
Co-authored-by: Shane Osbourne <[email protected]>
1 parent 91575dd commit 115d308

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

packages/special-pages/pages/duckplayer/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<iframe
1313
id="player"
1414
frameborder="0"
15-
allow="autoplay; encrypted-media"
15+
allow="autoplay; encrypted-media; fullscreen"
1616
allowfullscreen
17-
sandbox="allow-popups allow-scripts allow-same-origin"
17+
sandbox="allow-popups allow-scripts allow-same-origin allow-popups-to-escape-sandbox"
1818
></iframe>
1919
</div>
2020
<div class="toolbar">

packages/special-pages/tests/duckplayer.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ test.describe('duckplayer iframe', () => {
4545
await duckplayer.withStorageValues()
4646
await duckplayer.storageClearedAfterReload()
4747
})
48+
test('allows popups from embed', async ({ page }, workerInfo) => {
49+
const duckplayer = DuckPlayerPage.create(page, workerInfo)
50+
await duckplayer.openWithVideoID()
51+
await duckplayer.allowsPopups()
52+
})
4853
})
4954

5055
test.describe('duckplayer toolbar', () => {

packages/special-pages/tests/page-objects/duck-player.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,4 +375,9 @@ export class DuckPlayerPage {
375375
const { platformInfo, build } = perPlatform(testInfo.project.use)
376376
return new DuckPlayerPage(page, build, platformInfo)
377377
}
378+
379+
async allowsPopups () {
380+
const expected = 'allow-popups allow-scripts allow-same-origin allow-popups-to-escape-sandbox'
381+
await expect(this.page.locator('iframe')).toHaveAttribute('sandbox', expected)
382+
}
378383
}

0 commit comments

Comments
 (0)