Skip to content

Commit

Permalink
Merge pull request #287 from praschke/chrome-webRequest
Browse files Browse the repository at this point in the history
fix: reinstate webRequest and correct the permissions docs
  • Loading branch information
djahandarie authored Oct 25, 2023
2 parents b64ca7d + d1dda1b commit d3c916b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
16 changes: 7 additions & 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 All @@ -283,6 +275,9 @@
],
"excludeFiles": [
"sw.js",
"offscreen.html",
"js/background/offscreen.js",
"js/background/offscreen-main.js",
"js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
Expand Down Expand Up @@ -331,6 +326,9 @@
],
"excludeFiles": [
"sw.js",
"offscreen.html",
"js/background/offscreen.js",
"js/background/offscreen-main.js",
"js/dom/simple-dom-parser.js",
"lib/parse5.js"
]
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 d3c916b

Please sign in to comment.