Page 1 of 1

Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Tue Jul 23, 2019 4:13 am
by barbaz
I wanted to experiment with First Party Isolation in Waterfox 68.0a2, but when I enabled it, my extensions lost their data! Disabling first-party isolation again seems to have gotten it back. Image

I don't think all my extensions were affected, but the affected extensions include:
- uBlock Origin
- Stylus
- µMatrix

Some digging through my now-somewhat-messed-up profile suggests the cause: These extensions use IndexedDB to store data, and their IndexedDB with first-party isolation is different from their IndexedDB without first-party isolation, and the new context had nothing in it - so the extensions saw a clean slate.

So this should just be a matter of getting my existing extension data into the new (FPI) context.

I tried simply quitting Waterfox, deleting the newly-created (blank) IndexedDB stores, and copying in the existing (non-FPI) ones in their place. But that didn't work (and seemed to cause more breakage of affected extensions, so I deleted it again). So I guess I have to assess breakage manually and fix it manually.

For Stylus, I used its own import/export to transfer my data to the new context. uBlock Origin looks to have retained my user settings, looks like it only lost the caches of filters - so, no big deal there, just Purge all caches then Update now and that seems to be sorted.

I'm still not sure what broke with µMatrix - my rules are all there, and seem functional, but I'm seeing this error:

Code: Select all

cookies is undefined cookies.js:105
    addCookiesToDict moz-extension://***/js/cookies.js:105
    apply self-hosted:4417
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:539
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:752
    withLastError resource://gre/modules/ExtensionCommon.jsm:676
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:744
Based on my findings, Violentmonkey and Form History Control could also have lost data in theory, but they appear entirely unaffected.

I'm posting this as more of a heads-up than a request for help (although some help assessing my µMatrix would be appreciated :) ). This really caught me by surprise, I was expecting possible website breakage but not anything like this.

Re: Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Tue Jul 23, 2019 12:37 pm
by therube

Re: Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Tue Jul 23, 2019 6:12 pm
by barbaz
barbaz wrote:
Tue Jul 23, 2019 4:13 am
µMatrix [...] I'm seeing this error:

Code: Select all

cookies is undefined cookies.js:105
    addCookiesToDict moz-extension://***/js/cookies.js:105
    apply self-hosted:4417
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:539
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:752
    withLastError resource://gre/modules/ExtensionCommon.jsm:676
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:744
I think I figured this error out. It's a µMatrix bug -
https://github.com/gorhill/uMatrix/blob ... #L593-L595
https://developer.mozilla.org/en-US/doc ... ies/getAll

Oh, an issue is already filed - https://github.com/gorhill/uMatrix/issues/878

I have the options to delete cookies un-checked. None of my current µMatrix rules are about "cookie", but this could change in future. Does this error matter for my usage?

Re: Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Fri Jul 26, 2019 1:29 am
by barbaz
Another FPI issue affecting extensions: chrome.runtime.getBackgroundPage() returns null in inline options page context. Workaround is to open the options page as a tab. It's possible to code this workaround into an affected extension (and still have it use inline options where possible), but for extensions that don't have such workaround code, you can use Project Insight to access their options pages and it works.

Re: Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Sun Jul 28, 2019 6:50 pm
by barbaz
barbaz wrote:
Fri Jul 26, 2019 1:29 am
Another FPI issue affecting extensions: chrome.runtime.getBackgroundPage() returns null in inline options page context.
Of the extensions I have installed, seems this only affects my custom extensions. Other people's extensions have the options page use chrome.runtime.sendMessage() to work with the background page. I updated my extensions to do this instead, and now my inline options pages work fine inline with FPI enabled.

Re: Enabling First Party Isolation DELETED some of my extension data!!!!

Posted: Mon Oct 21, 2019 10:04 pm
by barbaz
https://hg.mozilla.org/releases/mozilla ... 07c9e1824a

That change is going to make it to Waterfox Current at some point. When it does, should I expect to have to go through this again, to ensure my current (FPI-specific) extension data is preserved?