Use dummy dns API when it's not present

This commit is contained in:
Raymond Hill 2024-09-13 11:20:37 -04:00
parent d1db02b04c
commit 93042eced4
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -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;