Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reinstate webRequest and correct the permissions docs #287

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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