mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(webdriver): prefer globalThis over window to make it work in Firefox (#12438)
This commit is contained in:
parent
0ef192097a
commit
33c6069227
@ -21,11 +21,16 @@ export const ariaQuerySelector = (
|
|||||||
root: Node,
|
root: Node,
|
||||||
selector: string
|
selector: string
|
||||||
): Promise<Node | null> => {
|
): Promise<Node | null> => {
|
||||||
return window.__ariaQuerySelector(root, selector);
|
// In Firefox sandboxes globalThis !== window and we expose bindings on globalThis.
|
||||||
|
return (globalThis as unknown as Window).__ariaQuerySelector(root, selector);
|
||||||
};
|
};
|
||||||
export const ariaQuerySelectorAll = async function* (
|
export const ariaQuerySelectorAll = async function* (
|
||||||
root: Node,
|
root: Node,
|
||||||
selector: string
|
selector: string
|
||||||
): AsyncIterable<Node> {
|
): AsyncIterable<Node> {
|
||||||
yield* await window.__ariaQuerySelectorAll(root, selector);
|
// In Firefox sandboxes globalThis !== window and we expose bindings on globalThis.
|
||||||
|
yield* await (globalThis as unknown as Window).__ariaQuerySelectorAll(
|
||||||
|
root,
|
||||||
|
selector
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
@ -209,13 +209,6 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "WebDriver BiDi locateNodes does not support shadow roots so far"
|
"comment": "WebDriver BiDi locateNodes does not support shadow roots so far"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"testIdPattern": "[ariaqueryhandler.spec] AriaQueryHandler waitForSelector *",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["firefox", "webDriverBiDi"],
|
|
||||||
"expectations": ["SKIP"],
|
|
||||||
"comment": "TODO: Needs investigation"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"testIdPattern": "[autofill.spec] *",
|
"testIdPattern": "[autofill.spec] *",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
Loading…
Reference in New Issue
Block a user