From 11bedb6892cdbf9d4841fa1daa43164f5546be87 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Thu, 2 Jan 2025 16:28:37 +0100 Subject: [PATCH 1/4] Convert browser extensions data to array Avoids `Object.keys()`, not available in Firefox 3.6 and earlier. --- browser-extensions.json | 7 ++++--- views/extensioncheck.ejs | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/browser-extensions.json b/browser-extensions.json index 704230f59..740cd3bdc 100644 --- a/browser-extensions.json +++ b/browser-extensions.json @@ -1,5 +1,6 @@ -{ - "nordpass": { +[ + { + "key": "nordpass", "name": "NordPass", "message": "NordPass performs polyfill-like transformations on navigator.credentials, affecting tests for the CredentialsContainer API.", "affectedTests": ["api.CredentialsContainer"], @@ -7,4 +8,4 @@ "firefoxId": "0ff38d7a-db91-4a1a-a222-00f10d098b22", "safariId": "9F9F9D62-DE32-4B4F-88FD-63D448DACFDC" } -} +] diff --git a/views/extensioncheck.ejs b/views/extensioncheck.ejs index 0f118cacd..7efb19e4a 100644 --- a/views/extensioncheck.ejs +++ b/views/extensioncheck.ejs @@ -111,13 +111,11 @@ See the LICENSE file for copyright details return; } - var extensionsToCheck = Object.keys(extensions); - var remaining = extensionsToCheck.length; + var remaining = extensions.length; var foundExtensions = []; - extensionsToCheck.forEach(function(k) { - var extension = extensions[k]; + extensions.forEach(function(extension) { checkExtension(extension, function(result) { if (result) { foundExtensions.push(k); From 7ef284306cde85ba01a4bd9ae7a9528427aba335 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Thu, 2 Jan 2025 16:29:38 +0100 Subject: [PATCH 2/4] Replace `Object.keys()` with `for..in` loop --- static/resources/harness.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/resources/harness.js b/static/resources/harness.js index a759ac12c..f0c14ef15 100644 --- a/static/resources/harness.js +++ b/static/resources/harness.js @@ -1747,9 +1747,10 @@ renderHarnessLink(resultsEl); // Render code and support for reusable instances - var reInstKeys = Object.keys(reusableInstances.__sources); - for (var i = 0; i < reInstKeys.length; i++) { - renderReInstReportEl(reInstKeys[i], resultsEl); + for (var key in reusableInstances.__sources) { + if (Object.prototype.hasOwnProperty.call(reusableInstances.__sources, key)) { + renderReInstReportEl(reusableInstances.__sources[key], resultsEl); + } } // Add divider From be42f510003d72911606f26c0b2716d4c41e4982 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:31:45 +0100 Subject: [PATCH 3/4] Update browser-extensions.json --- browser-extensions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/browser-extensions.json b/browser-extensions.json index 740cd3bdc..d880d165c 100644 --- a/browser-extensions.json +++ b/browser-extensions.json @@ -1,6 +1,5 @@ [ { - "key": "nordpass", "name": "NordPass", "message": "NordPass performs polyfill-like transformations on navigator.credentials, affecting tests for the CredentialsContainer API.", "affectedTests": ["api.CredentialsContainer"], From f2d7a25e751ed93bc037cab97a6ef7b9f304339e Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Thu, 2 Jan 2025 16:33:33 +0100 Subject: [PATCH 4/4] fixup! Replace `Object.keys()` with `for..in` loop --- static/resources/harness.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/resources/harness.js b/static/resources/harness.js index f0c14ef15..d51f5f1df 100644 --- a/static/resources/harness.js +++ b/static/resources/harness.js @@ -1748,7 +1748,12 @@ // Render code and support for reusable instances for (var key in reusableInstances.__sources) { - if (Object.prototype.hasOwnProperty.call(reusableInstances.__sources, key)) { + if ( + Object.prototype.hasOwnProperty.call( + reusableInstances.__sources, + key + ) + ) { renderReInstReportEl(reusableInstances.__sources[key], resultsEl); } }