Greasy Fork is available in English.

CORS Helper

A simple script that helps bypass CORS restrictions

Autor
PRO-2684
Dnevne instalacije
0
Ukupnih instalacija
78
Ocjene
0 0 0
Verzija
0.1.2
Stvoreno
17.09.2024.
Ažurirano
19.01.2025.
Size
650 bajtova
Licenza
GPL-3.0
Primjenjuje se

CORS Helper

A simple script that helps bypass CORS restrictions.

📦 Installation

🪄 Usage

By default, it doesn't apply to any websites. In order for this script to take effect on a site, you need to add the website to this script's User matches list. (You can find it at Dashboard - Installed Userscripts - CORS Helper - Settings - Includes/Excludes - User matches - Add...)

After this, refresh the page and you'll have access to GM_fetch function under the window object, which behaves like fetch but without CORS restrictions.

🤔 How it works

// ...
// @require      https://cdn.jsdelivr.net/npm/@trim21/gm-fetch@<version>
// ...
unsafeWindow.GM_fetch = GM_fetch;

Yes, that's it. It simply exposes the GM_fetch function under window.

⚠️ Disclaimer

Please only enable this script on websites you trust, otherwise you're on your own.

🎉 Acknowledgements

Trim21/gm-fetch, for providing wrappers for GM.xmlHttpRequest that are compatible with fetch.