Add sizzle support

Use the same `document` tracking fix/hack as in our CDP driver.
This commit is contained in:
Martin Pitt 2024-07-26 16:43:51 +02:00
parent 49317d7c19
commit 6c97825295
4 changed files with 17 additions and 8 deletions

View file

@ -1,8 +1,4 @@
window.ph_select = function(sel) {
if (!window.Sizzle) {
return Array.from(document.querySelectorAll(sel));
}
if (sel.includes(":contains(")) {
if (!window.Sizzle) {
throw new Error("Using ':contains' when window.Sizzle is not available.");