Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8066: Remove invalid selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
cuba committed Sep 14, 2023
1 parent b8662aa commit e20e404
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,21 @@ window.__firefox__.execute(function($) {
}

return Array.from(CC.hiddenSelectors).filter((selector) => {
return element.matches(selector)
try {
return element.matches(selector)
} catch (error) {
console.error(`Invalid selector '${selector}'`)

// Remove the culprit from everywhere so it doesn't cause errors
CC.hiddenSelectors.delete(selector)
CC.unhiddenSelectors.add(selector)

for (let queueIndex = 0; queueIndex < CC.runQueues.length; queueIndex += 1) {
CC.runQueues[queueIndex]
CC.runQueues[queueIndex].delete(selector)
}
return false
}
})
}

Expand Down

0 comments on commit e20e404

Please sign in to comment.