From 93042eced4e4fabc18d76d92f6a16362965593cf Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 13 Sep 2024 11:20:37 -0400 Subject: [PATCH] Use dummy dns API when it's not present --- platform/firefox/vapi-background-ext.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background-ext.js b/platform/firefox/vapi-background-ext.js index acc65da32..5d3ff8c5d 100644 --- a/platform/firefox/vapi-background-ext.js +++ b/platform/firefox/vapi-background-ext.js @@ -26,7 +26,12 @@ import { /******************************************************************************/ -const dnsAPI = browser.dns; +const dnsAPI = browser.dns || { + resolve() { + return Promise.resolve(); + } +}; + const isPromise = o => o instanceof Promise; const isResolvedObject = o => o instanceof Object && o instanceof Promise === false;