|
@@ -3,19 +3,19 @@ import { test } from './fixtures'
|
|
|
import { createRandomPage } from './utils'
|
|
import { createRandomPage } from './utils'
|
|
|
|
|
|
|
|
test('custom html should not spawn any dialogs', async ({ page, block }) => {
|
|
test('custom html should not spawn any dialogs', async ({ page, block }) => {
|
|
|
- await createRandomPage(page)
|
|
|
|
|
-
|
|
|
|
|
page.on('dialog', async dialog => {
|
|
page.on('dialog', async dialog => {
|
|
|
expect(false).toBeTruthy()
|
|
expect(false).toBeTruthy()
|
|
|
await dialog.dismiss()
|
|
await dialog.dismiss()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ await createRandomPage(page)
|
|
|
|
|
+
|
|
|
await page.keyboard.type('<iframe src="javascript:confirm(1);" />')
|
|
await page.keyboard.type('<iframe src="javascript:confirm(1);" />')
|
|
|
await block.enterNext()
|
|
await block.enterNext()
|
|
|
|
|
|
|
|
await page.keyboard.type('<button id="test-xss-button" onclick="confirm(1)">Click me!</button>')
|
|
await page.keyboard.type('<button id="test-xss-button" onclick="confirm(1)">Click me!</button>')
|
|
|
await block.enterNext()
|
|
await block.enterNext()
|
|
|
- await page.keyboard.type('<details open id="test-xss-toggle" ontoggle=confirm(1);></details>')
|
|
|
|
|
|
|
+ await page.keyboard.type('<details open id="test-xss-toggle" ontoggle="confirm(1)">test</details>')
|
|
|
await block.enterNext()
|
|
await block.enterNext()
|
|
|
|
|
|
|
|
await page.click('#test-xss-toggle')
|
|
await page.click('#test-xss-toggle')
|
|
@@ -25,13 +25,13 @@ test('custom html should not spawn any dialogs', async ({ page, block }) => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
test('custom hiccup should not spawn any dialogs', async ({ page, block }) => {
|
|
test('custom hiccup should not spawn any dialogs', async ({ page, block }) => {
|
|
|
- await createRandomPage(page)
|
|
|
|
|
-
|
|
|
|
|
page.on('dialog', async dialog => {
|
|
page.on('dialog', async dialog => {
|
|
|
expect(false).toBeTruthy()
|
|
expect(false).toBeTruthy()
|
|
|
await dialog.dismiss()
|
|
await dialog.dismiss()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ await createRandomPage(page)
|
|
|
|
|
+
|
|
|
await page.keyboard.type('[:iframe {:src "javascript:confirm(1);"}]')
|
|
await page.keyboard.type('[:iframe {:src "javascript:confirm(1);"}]')
|
|
|
await block.enterNext()
|
|
await block.enterNext()
|
|
|
|
|
|