Skip to content

Commit

Permalink
Add ability to disable individual FP tests via url param. (#173)
Browse files Browse the repository at this point in the history
* Add ability to disable individual FP tests via url param.

* Nit. no need to return false
  • Loading branch information
kdzwinel authored Nov 9, 2023
1 parent 228a569 commit c859cec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions privacy-protections/fingerprinting/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c859cec

Please sign in to comment.