Skip to content

Commit

Permalink
fix: reinstate webRequest and correct the permissions docs
Browse files Browse the repository at this point in the history
`webRequest` is used on Chrome/MV3 to surface error information from
failed requests. it was added back to the declarative path by
toasted-nutbread in FooSoft#2161, but the permissions
documentation did not reflect `webRequests` continued necessity.
  • Loading branch information
praschke committed Oct 25, 2023
1 parent b64ca7d commit c54461a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
10 changes: 1 addition & 9 deletions dev/data/manifest-variants.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"clipboardWrite",
"unlimitedStorage",
"declarativeNetRequest",
"webRequest",
"scripting",
"offscreen"
],
Expand Down Expand Up @@ -248,15 +249,6 @@
"nativeMessaging"
]
},
{
"action": "add",
"path": [
"permissions"
],
"items": [
"webRequest"
]
},
{
"action": "add",
"path": [
Expand Down
9 changes: 7 additions & 2 deletions docs/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
`unlimitedStorage` is used to help prevent web browsers from unexpectedly
deleting dictionary data.

* `webRequest` and `webRequestBlocking` _(Firefox only)_ <br>
Yomichan uses these permissions to ensure certain requests have valid and secure headers.
* `webRequest` <br>
Yomichan uses this permission to collect audio or create Anki notes using
[AnkiConnect](https://ankiweb.net/shared/info/2055492159).
It is also required to surface error information from failed requests.

* `webRequestBlocking` _(Firefox only)_ <br>
Yomichan uses this permission to ensure certain requests have valid and secure headers.
This sometimes involves removing or changing the `Origin` request header,
as this can be used to fingerprint browser configuration.

Expand Down
16 changes: 14 additions & 2 deletions ext/permissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,24 @@ <h2 id="permissions"></h2>
</div>
</div>
</div></div>
<div class="settings-item"><div class="settings-item-inner">
<div class="settings-item-left">
<div class="settings-item-label"><code>webRequest</code></div>
<div class="settings-item-description">
<p>
Yomitan uses this permission to collect audio or create Anki notes using
<a href="https://ankiweb.net/shared/info/2055492159" target="_blank" rel="noopener noreferrer">AnkiConnect</a>.
It is also required to surface error information from failed requests.
</p>
</div>
</div>
</div></div>
<div class="settings-item" data-show-for-browser="firefox firefox-mobile"><div class="settings-item-inner">
<div class="settings-item-left">
<div class="settings-item-label"><code>webRequest</code> and <code>webRequestBlocking</code></div>
<div class="settings-item-label"><code>webRequestBlocking</code></div>
<div class="settings-item-description">
<p>
Yomitan uses these permissions to ensure certain requests have valid and secure headers.
Yomitan uses this permission to ensure certain requests have valid and secure headers.
This sometimes involves removing or changing the <code>Origin</code> request header,
as this can be used to fingerprint browser configuration.
</p>
Expand Down

0 comments on commit c54461a

Please sign in to comment.