Skip to content

Commit 68c9bd0

Browse files
authored
fix: no dnslink lookup when turned off (#823)
Closes #821
1 parent 53ec312 commit 68c9bd0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

add-on/src/lib/ipfs-companion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ module.exports = async function init () {
243243
} catch (error) {
244244
info.gatewayVersion = null
245245
}
246-
if (info.currentTab) {
246+
if (state.active && info.currentTab) {
247247
const url = info.currentTab.url
248248
info.isIpfsContext = ipfsPathValidator.isIpfsPageActionsContext(url)
249249
info.currentDnslinkFqdn = dnslinkResolver.findDNSLinkHostname(url)

add-on/src/lib/ipfs-request.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ function createRequestModifier (getState, dnslinkResolver, ipfsPathValidator, ru
111111
// This is a good place to listen if you want to cancel or redirect the request.
112112
onBeforeRequest (request) {
113113
const state = getState()
114+
if (!state.active) return
114115
// early sanity checks
115116
if (preNormalizationSkip(state, request)) {
116117
return
@@ -131,7 +132,7 @@ function createRequestModifier (getState, dnslinkResolver, ipfsPathValidator, ru
131132
}
132133
}
133134
// handle redirects to custom gateway
134-
if (state.active && state.redirect) {
135+
if (state.redirect) {
135136
// late sanity checks
136137
if (postNormalizationSkip(state, request)) {
137138
return

0 commit comments

Comments
 (0)