Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持拦截fetch请求吗 #267

Open
dahai300 opened this issue Oct 12, 2020 · 1 comment
Open

支持拦截fetch请求吗 #267

dahai300 opened this issue Oct 12, 2020 · 1 comment

Comments

@dahai300
Copy link

支持拦截fetch请求吗

@xdoer
Copy link

xdoer commented Jun 27, 2021

const originFetch = globalThis.fetch

globalThis.fetch = function (url, opt) {
 // 修改参数
    const res = await originFetch(url, opt)
   // 利用这个修改响应 https://developer.mozilla.org/zh-CN/docs/Web/API/ReadableStream
    return res.clone()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants