Fix "Search LibRedirect" from context menu
When you try to select a text on a page and click a "Search LibRedirect" on Google Chrome - it does not redirect to the frontend and shows error page. After an investigation and debug, I saw Chrome passes details.initiator = "null" for such requests. Handle this case in code and allow redirects.
This commit is contained in:
parent
286ebd9e94
commit
a659c520f0
|
@ -36,7 +36,7 @@ browser.webRequest.onBeforeRequest.addListener(
|
||||||
let initiator
|
let initiator
|
||||||
try {
|
try {
|
||||||
if (details.originUrl) initiator = new URL(details.originUrl)
|
if (details.originUrl) initiator = new URL(details.originUrl)
|
||||||
else if (details.initiator) initiator = new URL(details.initiator)
|
else if (details.initiator && details.initiator !== "null") initiator = new URL(details.initiator)
|
||||||
} catch {
|
} catch {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue