Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit bcbf8ba

Browse files
committed
Merge pull request #248 from awalGarg/patch-1
blacklist fetch
2 parents c4c2078 + d782be4 commit bcbf8ba

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/codeWorker.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ var whitey = {
7373
'WorkerMessageEvent': 1
7474
};
7575

76+
/**
77+
* DOM specification doesn't define an enumerable `fetch` function object on the global object
78+
* so we add the property here, and the following code will blacklist it.
79+
* (`fetch` descends from `GlobalFetch`, and is thus present in worker code as well)
80+
* Just in case someone runs the bot on some old browser where `fetch` is not defined anyways,
81+
* this will have no effect.
82+
* Reason for blacklisting fetch: well, same as XHR.
83+
*/
84+
global.fetch = undefined;
85+
7686
[ global, Object.getPrototypeOf(global) ].forEach(function ( obj ) {
7787
Object.getOwnPropertyNames( obj ).forEach(function( prop ) {
7888
if( whitey.hasOwnProperty(prop) ) {

0 commit comments

Comments
 (0)