orb icon indicating copy to clipboard operation
orb copied to clipboard

Avoid ORB checks for navigator.sendBeacon

Open zcorpan opened this issue 2 years ago • 2 comments

In Firefox Nightly I noticed that github.com has a resource blocked by ORB, which turns out to be from navigator.sendBeacon() in analytics-client.js (source file)

        try {
            if (navigator.sendBeacon) {
                navigator.sendBeacon(this.collectorUrl, body);
                return;
            }
        }
        catch {
        }

collectorUrl is https://collector.github.com/github/collect which returns a 204 No Content with x-content-type-options: nosniff per the Network tab.

Since sendBeacon responses aren't made available to JS it seems unnecessary to run ORB checks.

zcorpan avatar Jun 22 '23 10:06 zcorpan

This isn't web observable I think. We could add a code path to handle it explicitly, but we'd need to be very careful not to run into any issues later.

annevk avatar Jun 22 '23 11:06 annevk

Indeed. Maybe a note about navigator.sendBeacon() is sufficient here.

zcorpan avatar Jun 22 '23 11:06 zcorpan