Skip to content

Commit

Permalink
Add a better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWr committed Mar 26, 2024
1 parent 4cda1e0 commit f318db9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/helpers/noop-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ export const noopPromiseResolve = (
statusText: 'OK',
});

// In the case if responseType is opaque
// mock response' body, status, statusText & responseUrl to avoid adb checks
// https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
// If responseType is opaque, then by default
// body is null, status is 0, statusText and url are empty strings,
// as per https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
// It's required to mock these properties to avoid adblock detection
// https://github.com/AdguardTeam/Scriptlets/issues/364
if (responseType === 'opaque') {
Object.defineProperties(response, {
Expand Down

0 comments on commit f318db9

Please # to comment.