{"ScriptPreparationCode":"var adsList = [];\r\nvar iterations = 100000;\r\n\r\n// sel 1 - _taboola\r\nvar list1 = document.querySelectorAll(\u0022div.trc_related_container \u003E div.trc_rbox_container\u0022);\r\n\r\n// sel 2 - _taboola\r\nvar list2 = document.querySelectorAll(\u0022div[data-feed-main-container-id]\u0022);\r\n\r\nvar tmpFullList = [...list1, ...list2];\r\n\r\nfunction getHighPrecisionTimestamp() {\r\n if (window.performance \u0026\u0026 window.performance.now) {\r\n return window.performance.now(); // Returns a DOMHighResTimeStamp value\r\n } else {\r\n return new Date().getTime(); // Fallback to millisecond precision if high-res timestamp is not supported\r\n }\r\n}\r\n\r\n// Function to compare one element to all others in the array\r\nfunction compareElementsContains(arr) {\r\n var nCE = [];\r\n for (let i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n const cE = arr[i];\r\n var iCEC = false;\r\n for (let j = 0; j \u003C arr.length; j\u002B\u002B) {\r\n if (i !== j) {\r\n const oE = arr[j];\r\n // If ad[i] is not contained by any of the others, then add to final list\r\n if ( oE.contains(cE) ) {\r\n iCEC = true;\r\n // debugger;\r\n } else {\r\n // debugger;\r\n }\r\n }\r\n }\r\n if (!iCEC) {\r\n nCE.push(cE);\r\n }\r\n }\r\n return nCE;\r\n}\r\n// Function to find if an ad has another one as ancestor in its DOM branch\r\nfunction hasAncestorInList(nL) {\r\n var nAE = [];\r\n for (let i = 0; i \u003C nL.length; i\u002B\u002B) {\r\n const eA = nL[i];\r\n let hA = false;\r\n for (let j = 0; j \u003C nL.length; j\u002B\u002B) {\r\n if (i !== j) {\r\n const eB = nL[j];\r\n \r\n let p = eA.parentElement;\r\n while (p !== null) {\r\n if (p === eB) {\r\n hA = true;\r\n break;\r\n }\r\n p = p.parentElement;\r\n } \r\n }\r\n }\r\n if (!hA) {\r\n nAE.push(eA);\r\n } \r\n }\r\n return nAE;\r\n}","TestCases":[{"Name":"hasAncestorInList","Code":"var adsList = hasAncestorInList(tmpFullList);","IsDeferred":false},{"Name":"compareElementsContains","Code":"var adsList = compareElementsContains(tmpFullList);","IsDeferred":false}]}