From 8d55e5967ed4d7f03ab08cbbd034d116a10f618a Mon Sep 17 00:00:00 2001 From: Sam Macbeth Date: Thu, 10 Oct 2019 10:22:35 +0200 Subject: [PATCH] Improve extraHeaders feature detection --- add-on/src/lib/ipfs-companion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add-on/src/lib/ipfs-companion.js b/add-on/src/lib/ipfs-companion.js index ffc6f455b..074db5d05 100644 --- a/add-on/src/lib/ipfs-companion.js +++ b/add-on/src/lib/ipfs-companion.js @@ -97,7 +97,7 @@ module.exports = async function init () { function registerListeners () { const onBeforeSendInfoSpec = ['blocking', 'requestHeaders'] - if (!runtime.isFirefox) { + if (browser.webRequest.OnBeforeSendHeadersOptions && 'EXTRA_HEADERS' in browser.webRequest.OnBeforeSendHeadersOptions) { // Chrome 72+ requires 'extraHeaders' for access to Referer header (used in cors whitelisting of webui) onBeforeSendInfoSpec.push('extraHeaders') }