summaryrefslogtreecommitdiff
path: root/source/helpers/dom-utils.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2022-09-09 22:01:54 +0700
committerGravatar GitHub <noreply@github.com> 2022-09-09 22:01:54 +0700
commitaaca03e354866411b60e79edadb1f63d8af27f02 (patch)
tree0d669628437086c8ce25f147425888fa4ed91f8c /source/helpers/dom-utils.ts
parentdbbd437efdcb7df7241f5d512bae9c225c8aa063 (diff)
downloadrefined-github-aaca03e354866411b60e79edadb1f63d8af27f02.tar.gz
refined-github-aaca03e354866411b60e79edadb1f63d8af27f02.tar.zst
refined-github-aaca03e354866411b60e79edadb1f63d8af27f02.zip
Update dependencies (#5955)
Diffstat (limited to 'source/helpers/dom-utils.ts')
-rw-r--r--source/helpers/dom-utils.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/helpers/dom-utils.ts b/source/helpers/dom-utils.ts
index 53f98c9a..d9dffc2e 100644
--- a/source/helpers/dom-utils.ts
+++ b/source/helpers/dom-utils.ts
@@ -1,11 +1,13 @@
import select from 'select-dom';
-import pushForm from 'push-form';
+import {setFetch} from 'push-form';
// `content.fetch` is Firefox’s way to make fetches from the page instead of from a different context
// This will set the correct `origin` header without having to use XMLHttpRequest
// https://stackoverflow.com/questions/47356375/firefox-fetch-api-how-to-omit-the-origin-header-in-the-request
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts#XHR_and_Fetch
-pushForm.fetch = window.content?.fetch ?? window.fetch;
+if (window.content?.fetch) {
+ setFetch(window.content.fetch);
+}
/**
* Append to an element, but before a element that might not exist.