[Webkit-unassigned] [Bug 188329] New: navigator.sendBeacon does not work in pagehide callbacks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Aug 4 09:57:27 PDT 2018


            Bug ID: 188329
           Summary: navigator.sendBeacon does not work in pagehide
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Macintosh
                OS: macOS 10.13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: philip at philipwalton.com

Initial support for navigator.sendBeacon was added here: https://bugs.webkit.org/show_bug.cgi?id=175007,
but if you try to invoke navigator.sendBeacon() in a pagehide event listener, it fails and you get a warning in the console:

> Beacon API cannot load ... due to access control checks

Note that this is the same error you'd get if you tried to do a fetch() or xhr in a pagehide event listener, so I suspect the same rules are being enforced. However, beacons should not be subject to the same restrictions since they're designed to not block or require waiting for a response. (Note, this is also true of any fetch() with the keepalive flag set to true and should be considered when webkit implements keepalive: https://bugs.webkit.org/show_bug.cgi?id=168865).

All other browsers that support the Beacon API or fetch keepalive allow these requests to be sent in the pagehide event listener.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180804/5c82e932/attachment.html>

More information about the webkit-unassigned mailing list