-
Notifications
You must be signed in to change notification settings - Fork 469
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
Fix TypeError: "fetch" is read-only
#169
Conversation
Sounds good. I guess this is something they're A/B testing? I'm currently not seeing this on either Chrome/Firefox.
|
Probably. The load trace has kasada stuff in it 722956/t.prototype.loadKPSDK/b</</this.loadPromise< |
It looks like you need to pass in a var realFetch = window.fetch;
Object.defineProperty(window, "fetch", { value: function(url, init, ...args) { console.log('hi'); realFetch.apply(this, arguments); } });
fetch(); Do they do anything with the worker |
It looks like Based on some traces it looks like |
That could be problematic. I think the simplest solution would be to ensure the scripts run before their code. I'll take a look when they have pushed this change out. |
This PR doesn't fix the issue |
It seems a twitch (p.js?) script redefines the
window.fetch
withObject.defineProperty
which makes it read-only (not over-writable with regular assignment).Only using
Object.defineProperty
will be able to overwrite it.