From 374d4800e5ff737a1dd247107aa648c6cd19a8cf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 21 Nov 2021 11:17:05 -0500 Subject: [PATCH] Arrow functions are not `instanceof Function` But their `typeof` is `function`, so use this instead to detect whether an argument is a function which can be called. Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/ --- src/web_accessible_resources/amazon_apstag.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/web_accessible_resources/amazon_apstag.js b/src/web_accessible_resources/amazon_apstag.js index c6aab5be2..ea45541c0 100644 --- a/src/web_accessible_resources/amazon_apstag.js +++ b/src/web_accessible_resources/amazon_apstag.js @@ -21,6 +21,7 @@ // https://www.reddit.com/r/uBlockOrigin/comments/ghjqph/ // https://github.com/NanoMeow/QuickReports/issues/3717 +// https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/ (function() { 'use strict'; @@ -30,7 +31,7 @@ }.bind(); const apstag = { fetchBids: function(a, b) { - if ( b instanceof Function ) { + if ( typeof b === 'function' ) { b([]); } },