Closed Bug 1778993 Opened 2 years ago Closed 2 years ago

The header is missing from homedepot.ca in Private browsing

Categories

(Core :: Privacy: Anti-Tracking, defect, P3)

Firefox 104
Other
Android
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox104 --- affected

People

(Reporter: ctanase, Unassigned)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file, 1 obsolete file)

Attached image The home depot.png

Environment:
Operating system: Android 11 (ONEPLUS A6000)
Firefox version: Nightly 104.0a1-20220710094429

Preconditions:

  1. VPN required for users outside of Canada.
  2. Open Private window.

Steps to reproduce:

  1. Go to: https://www.homedepot.ca/en/home.html
  2. Observe the header

Expected Behavior:
The header is visible on the page.

Actual Behavior:
The header is missing from the page.

Notes:

  1. Screenshot provided
  2. Not reproducible on Chrome Incognito mode
  3. Reproducible in Private regardless of ETP status
  4. Not reproducible with Normal browsing regardless of ETP status

It's probably because the indexedDB is not defined in PBM. I can see the error message on the console.

Severity: -- → S3

Yes, I see Uncaught ReferenceError: IDBRequest is not defined in the console.

They check for both IDBRequest and IDBOpenDBRequest and then try to open a database, so we can fix this with a tweak to our Firebase shim so it also defines those two APIs as empty objects.

@krosylight, maybe it's worth also adding those two to the list of "proxable" interfaces you exposed in https://phabricator.services.mozilla.com/D151086 ? That way we wouldn't need to adjust the Firebase shim, just add HomeDepot to the list of sites "using" it.

Flags: needinfo?(krosylight)

Thanks for the ping.

A quick search says it's from a library named zone.js (from Angular, so it's again from Google! Oh Google).

https://github.com/angular/zone.js/blob/b11bd466c20dc338b6d4d5bc3e59868ff263778d/lib/browser/property-descriptor.ts#L323-L330

  if (typeof IDBIndex !== 'undefined') {
    patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);
    patchFilteredProperties(IDBRequest.prototype, IDBIndexEventNames, ignoreProperties);
    patchFilteredProperties(IDBOpenDBRequest.prototype, IDBIndexEventNames, ignoreProperties);
    patchFilteredProperties(IDBDatabase.prototype, IDBIndexEventNames, ignoreProperties);
    patchFilteredProperties(IDBTransaction.prototype, IDBIndexEventNames, ignoreProperties);
    patchFilteredProperties(IDBCursor.prototype, IDBIndexEventNames, ignoreProperties);
  }

@krosylight, maybe it's worth also adding those two to the list of "proxable" interfaces you exposed in https://phabricator.services.mozilla.com/D151086 ? That way we wouldn't need to adjust the Firebase shim, just add HomeDepot to the list of sites "using" it.

Sounds like the answer here.

Flags: needinfo?(krosylight)

One thing is that, it checks the existence of IDBIndex which we had to expose because of idb@v3. 😞

Alright, makes sense, thanks for confirming. Once we're happy with this patch, I'll add a follow-up patch as needed to make sure the open method is handled as well (via the Firebase shim).

I haven't checked whether this patch works yet. I'm not sure it's worth to fix this way if it still needs another patch for .open().

(I had to switch to my local machine as it didn't work to have both office VPN and another to Canada.)

So it does require a separate patch for .open() 😞

The most ideal option is to make typeof IDBIndex !== 'undefined' false. We do have a very hacky option for that: make it work just like document.all does. (It allows accessing its property but typeof or boolean check will see it as if it's undefined.) I really didn't want to go that way but it seems that's the only good way to fulfill both requirements from zone.js and idb@v3.

Edit: But document.all is a property. We may instead make window.indexedDB work that way 🤔

Attachment #9285676 - Attachment description: WIP: Bug 1778993 - Always expose IDBRequest/IDBOpenDBRequest r=asuth!,twisniewski → WIP: Bug 1778993 - JSCLASS_EMULATES_UNDEFINED for IDBFactory in PBMode

The updated patch kinda works for this website and probably also for bug 1779536. One significant caveat is that there's no way for bindings code to check whether the current document is in PBMode. IMO there theoretically can be a process-wide boolean for PBMode in Fission but then Android has no Fission.

I just landed a shim for this in bug 1771783, which should ship with the 104 release. There is one problem that I can't resolve with shims just yet, however. The site also tries to access iDB from a web worker, which web extensions cannot "shim" as far as I can tell.

So while the header on the page will work as of bug 1771783, the worker will not run properly, which might cause other features on the site to break (and will at least spam "too much recursion" errors in the web console as the site repeatedly tries and fails to load the worker).

This was indeed fixed in bug 1771783, so I'll close this bug as such. We can reopen or revisit this in another bug when we explore a lower-level fix for this when Kagami returns from PTO.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Attachment #9285676 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: