From 29fb0da796070e58d601881ae83e220c8047650f Mon Sep 17 00:00:00 2001 From: Konrad Dzwinel Date: Thu, 9 Nov 2023 21:29:17 +0100 Subject: [PATCH 1/2] Add ability to disable individual FP tests via url param. --- privacy-protections/fingerprinting/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/privacy-protections/fingerprinting/main.js b/privacy-protections/fingerprinting/main.js index a743cc7..4102919 100644 --- a/privacy-protections/fingerprinting/main.js +++ b/privacy-protections/fingerprinting/main.js @@ -41,11 +41,22 @@ function runTests () { testsDetailsDiv.innerHTML = ''; + const pageURL = new URL(location.href); + let disabledTests = []; + + if (pageURL.searchParams.has('disable_tests')) { + disabledTests = pageURL.searchParams.get('disable_tests').split(','); + } + function updateSummary () { testsSummaryDiv.innerText = `Collected ${all} datapoints${failed > 0 ? ` (${failed} failed)` : ''}. Click for details.`; } tests.forEach(test => { + if (disabledTests.includes(test.id)) { + console.log(`Test "${test.id}" disabled via url param.`); + return false; + } if (test.category === 'all-props' && !includeAllPropsCheckbox.checked) { return; } From 7bad40a6c70bbe88095ba130e22465688e7a93b6 Mon Sep 17 00:00:00 2001 From: Konrad Dzwinel Date: Thu, 9 Nov 2023 21:37:04 +0100 Subject: [PATCH 2/2] Nit. no need to return false --- privacy-protections/fingerprinting/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/privacy-protections/fingerprinting/main.js b/privacy-protections/fingerprinting/main.js index 4102919..33cda59 100644 --- a/privacy-protections/fingerprinting/main.js +++ b/privacy-protections/fingerprinting/main.js @@ -55,7 +55,7 @@ function runTests () { tests.forEach(test => { if (disabledTests.includes(test.id)) { console.log(`Test "${test.id}" disabled via url param.`); - return false; + return; } if (test.category === 'all-props' && !includeAllPropsCheckbox.checked) { return;