Destroyed 4.1.1 Setting Extension Permission Exceptions (markdown)

Thorin-Oakenpants 2019-05-08 09:18:35 +00:00
parent e123f522b0
commit 3f42ca51e9

@ -1,54 +0,0 @@
:exclamation: Extensions + localStorage + indexedDB is fixed in FF59+ - see [1406675](https://bugzilla.mozilla.org/show_bug.cgi?id=1406675)
---
### :small_orange_diamond: The Issue
Cookies control access to **localStorage** and **indexedDB**. The `ghacks user.js` denies cookies by default (although we changed this in v62). This is the pref `network.cookie.cookieBehavior` (see `2701`). A value of `2` denies all cookies, a value of `1` allows first party only.
Extensions <sup>1</sup> that use local dom storage and/or indexedDB **will break** <sup>2</sup> if they are not allowed a cookie, even though they do not actually set any. Extensions that use such storage include uBlock Origin, uMatrix, Stylus and Violentmonkey. Extension IndexedDB entries are located in your `profile\storage\default` directory and start with `moz-extension`.
![](https://github.com/ghacksuserjs/ghacks-user.js/blob/master/wikipiki/exceptions03.png)
:exclamation: Note: Private Browsing mode (currently) does not allow IndexedDB
<sup>1</sup> `Extensions` = Web Extensions API, `Legacy Extensions` = legacy APIs or the Add-on SDK.
<sup>2</sup> Some extensions have built in fallbacks to limit or resolve breakage, but the best solution is to allow IndexedDB, which is faster.
### :small_orange_diamond: Strategy
You have two choices
- Allow first party cookies and use an extension to clean up and/or block cookies and storage
- Deny all cookies and use site exceptions, **including** exceptions for extensions that need it. And you can still use an extension to clean up and control website cookies and storage if you want.
### :small_orange_diamond: How To Set Extension Cookie Exceptions
- Open `about:debugging > Add-ons`
- Click on the `Manifest URL` of the extension
- On the manifest page, right click and select `View Page Info`
- Select the `Permissions` tab
- For `Set Cookies`, uncheck `use default` and check `Allow`
- Restart Firefox for the extension to start using storage
![](https://github.com/ghacksuserjs/ghacks-user.js/blob/master/wikipiki/exceptions01.png)
### :small_orange_diamond: Note
- The exception uses the extension's `Internal UUID`, which is a random unique value generated on each install of the extension. So be aware of that if you uninstall and reinstall.
- You can view cookie exceptions under Options > Privacy & Security > History > Custom Settings > Accept cookies from websites > Exceptions
![](https://github.com/ghacksuserjs/ghacks-user.js/blob/master/wikipiki/exceptions02.png)
`Pro Tip`: If you are not sure what extensions require IndexedDB <sup>1</sup>
* enable first party cookies in your `user.js` and restart
* check the options (if any) for each extension
* look in your `profile\storage\default` directory for `moz-extension` entries (see pic 1)
* add these entries manually via the cookies exceptions dialog
* just replace `+++` with `://` (see pic 3)
* directory: `moz-extension+++e0cc77c6-3785-4297-a034-7896f46563af`
* exception: `moz-extension://e0cc77c6-3785-4297-a034-7896f46563af`
* set cookies in the `user.js` back to none and restart
* clean out any unwanted cookies and storage collected during this exercise
<sup>1</sup> This will not work in Private Browsing mode