From c859cece24a1b71a9a70fab764466ca99c80c743 Mon Sep 17 00:00:00 2001 From: Konrad Dzwinel Date: Thu, 9 Nov 2023 22:23:28 +0100 Subject: [PATCH] Add ability to disable individual FP tests via url param. (#173) * Add ability to disable individual FP tests via url param. * Nit. no need to return false --- 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..33cda59 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; + } if (test.category === 'all-props' && !includeAllPropsCheckbox.checked) { return; }