2023-02-14 21:31:30 +00:00
|
|
|
/**
|
2024-01-03 10:11:33 +00:00
|
|
|
* @license
|
|
|
|
* Copyright 2023 Google Inc.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2023-02-14 21:31:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
import type PuppeteerUtil from '../injected/injected.js';
|
2023-02-15 23:09:31 +00:00
|
|
|
|
2023-02-14 21:31:30 +00:00
|
|
|
import {QueryHandler} from './QueryHandler.js';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
export class PierceQueryHandler extends QueryHandler {
|
|
|
|
static override querySelector = (
|
|
|
|
element: Node,
|
|
|
|
selector: string,
|
|
|
|
{pierceQuerySelector}: PuppeteerUtil
|
|
|
|
): Node | null => {
|
|
|
|
return pierceQuerySelector(element, selector);
|
|
|
|
};
|
|
|
|
static override querySelectorAll = (
|
|
|
|
element: Node,
|
|
|
|
selector: string,
|
|
|
|
{pierceQuerySelectorAll}: PuppeteerUtil
|
|
|
|
): Iterable<Node> => {
|
|
|
|
return pierceQuerySelectorAll(element, selector);
|
|
|
|
};
|
|
|
|
}
|