From b1ae088ee195f4600b7cfbbf9092d3d61706bd40 Mon Sep 17 00:00:00 2001 From: Peter Snyder Date: Mon, 2 May 2022 07:44:31 +0100 Subject: [PATCH 1/2] narrow-selector-for-deamp --- resources/de-amp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/de-amp.js b/resources/de-amp.js index ea84c1c6..43ca9fa3 100644 --- a/resources/de-amp.js +++ b/resources/de-amp.js @@ -1,12 +1,12 @@ (function () { if (typeof deAmpEnabled !== 'undefined' && deAmpEnabled) { - const selector = 'a' const attr = 'jsaction' + const selector = `a[data-amp-title][${attr}]` let timer const rmattr = () => { timer = undefined try { - const nodes = document.querySelectorAll(selector) + const nodes = Array.from(document.querySelectorAll(selector)) for (const node of nodes) { node.removeAttribute(attr) } From 4789b9b6265f728623cad09ef52b1ecef67b6738 Mon Sep 17 00:00:00 2001 From: pes10k <76526+pes10k@users.noreply.github.com> Date: Mon, 2 May 2022 03:08:00 -0500 Subject: [PATCH 2/2] Update de-amp.js --- resources/de-amp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/de-amp.js b/resources/de-amp.js index 43ca9fa3..1f343ccd 100644 --- a/resources/de-amp.js +++ b/resources/de-amp.js @@ -6,7 +6,7 @@ const rmattr = () => { timer = undefined try { - const nodes = Array.from(document.querySelectorAll(selector)) + const nodes = document.querySelectorAll(selector) for (const node of nodes) { node.removeAttribute(attr) }