1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Add ability to distinguish trapped entry point in json-prune

This commit is contained in:
Raymond Hill 2023-08-08 12:30:42 -04:00
parent 4f082a96bc
commit 2c04b5a982
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1216,7 +1216,10 @@ function jsonPrune(
const extraArgs = safe.getExtraArgs(Array.from(arguments), 3);
const logLevel = shouldLog(extraArgs);
const fetchPropNeedles = parsePropertiesToMatch(extraArgs.fetchPropsToMatch, 'url');
if ( fetchPropNeedles.size === 0 ) {
if (
fetchPropNeedles.size === 0 ||
matchObjectProperties(fetchPropNeedles, { url: 'undefined' })
) {
JSON.parse = new Proxy(JSON.parse, {
apply: function(target, thisArg, args) {
return objectPrune(