您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
CORS via Greasemonkey/Tampermonkey
This script enables web front-end developers to bypass "CORS" (a restriction imposed by browser security policies) to directly access other domains in the easiest and no-fuss way.
Simplest trial
CORSViaGM.init(window)
fetch('https://example.com')
Minimal full demo
addEventListener('load', () => setTimeout(async () => {
CORSViaGM.init(window)
document.write(await (
await fetch('https://example.com')
).text())
}, 200))
Advanced
If you want to await window._CORSViaGM.inited
, add the following element to the <head>
of your index.html
:
<script>
window._CORSViaGM = (inited => ({ inited: Object.assign(new Promise(r => inited = r), { done: inited }) }))()
</script>