Skip to content

Commit

Permalink
remove webRequest and webRequestBlocking
Browse files Browse the repository at this point in the history
firefox was previously unable to use declarativeNetRequest, as some
browser state (ExtensionDNRStore) wasn't correctly initialized wrt
yomitan's use of the DNR API. this bug manifested as an unexpected
error on calls to updateDynamicRules(), specifically after the browser
has been restarted.

switching to the use of session rules instead of dynamic rules fixes
this bug. i have tested audio info requests (custom JSON, JPod
Alternate, Jisho) that exhibited the bug after browser restart on
version 115 and 118, and the audio plays instead of the request
failing.

webRequest can now be entirely removed.
  • Loading branch information
praschke committed Oct 29, 2023
1 parent ba8eec9 commit e61a69f
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 297 deletions.
25 changes: 0 additions & 25 deletions dev/data/manifest-variants.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,31 +248,6 @@
"nativeMessaging"
]
},
{
"action": "add",
"path": [
"permissions"
],
"items": [
"webRequest"
]
},
{
"action": "add",
"path": [
"permissions"
],
"items": [
"webRequestBlocking"
]
},
{
"action": "remove",
"path": [
"permissions"
],
"item": "declarativeNetRequest"
},
{
"action": "remove",
"path": [
Expand Down
7 changes: 1 addition & 6 deletions docs/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
`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.
This sometimes involves removing or changing the `Origin` request header,
as this can be used to fingerprint browser configuration.

* `declarativeNetRequest` _(Chrome only)_ <br>
* `declarativeNetRequest` <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
Loading

0 comments on commit e61a69f

Please sign in to comment.