Added cancellable requests support for ExtensionStrategy
This commit is contained in:
@@ -7,6 +7,12 @@ export const hasChromeExtensionInstalled = () =>
|
|||||||
export const hasFirefoxExtensionInstalled = () =>
|
export const hasFirefoxExtensionInstalled = () =>
|
||||||
hasExtensionInstalled() && /Firefox/i.test(navigator.userAgent)
|
hasExtensionInstalled() && /Firefox/i.test(navigator.userAgent)
|
||||||
|
|
||||||
|
export const cancelRunningExtensionRequest = () => {
|
||||||
|
if (hasExtensionInstalled() && window.__POSTWOMAN_EXTENSION_HOOK__.cancelRunningRequest) {
|
||||||
|
window.__POSTWOMAN_EXTENSION_HOOK__.cancelRunningRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const extensionWithProxy = async (req, { state }) => {
|
const extensionWithProxy = async (req, { state }) => {
|
||||||
const { data } = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
|
const { data } = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
|
||||||
method: "post",
|
method: "post",
|
||||||
|
|||||||
Reference in New Issue
Block a user