Improve prevent-fetch — set response.status to 0 if responseType is set to opaque #364
Labels
enhancement
Improvement of existent feature
Priority: P4
Release: v1.9.101
Resolution: Fixed
Status: Closed
Version: Scriptlets v1.9
Related to - AdguardTeam/AdguardFilters#163224
Steps to reproduce:
With scriptlet enabled
response.status
is200
so alert is displayed, but as far as I understand, ifresponse.type
isopaque
, thenresponse.status
should be0
:https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
So maybe we could set
status
basing onresponseType
:Scriptlets/src/helpers/noop-utils.ts
Lines 99 to 102 in 6c3693f
Perhaps also
response.statusText
should be set to''
andresponse.body
tonull
, ifresponseType
is set toopaque
.The text was updated successfully, but these errors were encountered: