fix: no playback (#92)

This commit is contained in:
Xmader 2020-12-06 00:51:51 -05:00
parent 63ac2030a9
commit 9491f6c848
No known key found for this signature in database
GPG key ID: A20B97FB9EB730E4

View file

@ -36,7 +36,7 @@ const magicHookConstr = (() => {
const iframe = nodes[0] as HTMLIFrameElement
const w = iframe.contentWindow as Window
hookNative(w, 'fetch', (fn) => {
hookNative(w, 'fetch', () => {
return function (url, init) {
const token = init?.headers?.Authorization
if (typeof url === 'string' && token) {
@ -47,7 +47,7 @@ const magicHookConstr = (() => {
l[type]?.(token)
}
}
return fn(url, init)
return fetch(url, init)
}
})
}