Closed Bug 1774269 Opened 2 years ago Closed 2 years ago

Add an intervention for imgur.com

Categories

(Web Compatibility :: Interventions, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ksenia, Unassigned)

References

()

Details

As Thomas discovered in https://bugzilla.mozilla.org/show_bug.cgi?id=1742344#c4 it's possible to temporarily fix the issue with imgur.

Ah, actually their code does properly check for the existence of service workers, the problem is that they assume that if window.caches is defined, calling window.caches.keys() will not fail. But in private browsing mode it throws a SecurityError (presumably until bug 1714354 is fixed).

A simple webcompat intervention can fix this for now (at least I tested for https://imgur.io/gallery/*):

try {
  window.caches.keys(); // fails in private browsing mode with a SecurityError, see bug 1714354
} catch (_) {
  Object.defineProperty(window.wrappedJSObject, "caches", {
    value: undefined,
  });
}

We can add this for both mobile and desktop, see more info below:

Most reports are from mobile (Firefox Focus / Nightly and Release in private mode) for the following urls:
https://m.imgur.com/ (for example, https://m.imgur.com/a/ABecAFx)
https://imgur.io/

I've also tried the same urls on desktop in a private window and https://imgur.io/ is broken, while https://m.imgur.com/a/ABecAFx is working (redirecting to https://imgur.com/a/ABecAFx)

Blocks: 1742344

It might be worth noting that I could turn the suggested intervention in bug 1742344 into a SmartBlock shim instead, if we'd like to keep anti-tracking related fixes more self-contained in SmartBlock. I'm already going to be making such shims for private browsing related to Firebase, so that might be a good idea.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
No longer blocks: 1752990
You need to log in before you can comment on or make changes to this bug.