{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/fetch/issues/124","labels_url":"https://api.github.com/repos/whatwg/fetch/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/fetch/issues/124/comments","events_url":"https://api.github.com/repos/whatwg/fetch/issues/124/events","html_url":"https://github.com/whatwg/fetch/issues/124","id":105894460,"number":124,"title":"Allow operation to outlive the document unloading (beacon)","user":{"login":"pornel","id":72159,"avatar_url":"https://avatars.githubusercontent.com/u/72159?v=3","gravatar_id":"","url":"https://api.github.com/users/pornel","html_url":"https://github.com/pornel","followers_url":"https://api.github.com/users/pornel/followers","following_url":"https://api.github.com/users/pornel/following{/other_user}","gists_url":"https://api.github.com/users/pornel/gists{/gist_id}","starred_url":"https://api.github.com/users/pornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pornel/subscriptions","organizations_url":"https://api.github.com/users/pornel/orgs","repos_url":"https://api.github.com/users/pornel/repos","events_url":"https://api.github.com/users/pornel/events{/privacy}","received_events_url":"https://api.github.com/users/pornel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-10T20:47:24Z","updated_at":"2015-09-22T17:19:43Z","closed_at":null,"body":"The [Beacon API](http://www.w3.org/TR/beacon/) adds a new feature to the platform — non-Service-Worker requests that outlive their document — but adds it in a high-level API with a narrow use-case (and poorly defined delivery, which is nether at-most-once, nor at-least-once).\r\n\r\nThere is no [lower-level primitive in that \"explains\"](https://extensiblewebmanifesto.org/) the Beacon API. Perhaps `fetch` could be it? \r\n\r\n```\r\nfunction sendBeacon(url, body) {\r\n    fetch(url, {\r\n        method: 'post',\r\n        body,\r\n        detachedFromDocumentLifetime: !!\"bikeshed\",\r\n        keepRetryingInUnspecifiedManner: \"like the beacon spec\",\r\n        ageHeaderUpdatedOnRetry: 'Beacon-Age',\r\n    });\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/whatwg/fetch/issues/comments/142354239","html_url":"https://github.com/whatwg/fetch/issues/124#issuecomment-142354239","issue_url":"https://api.github.com/repos/whatwg/fetch/issues/124","id":142354239,"user":{"login":"pornel","id":72159,"avatar_url":"https://avatars.githubusercontent.com/u/72159?v=3","gravatar_id":"","url":"https://api.github.com/users/pornel","html_url":"https://github.com/pornel","followers_url":"https://api.github.com/users/pornel/followers","following_url":"https://api.github.com/users/pornel/following{/other_user}","gists_url":"https://api.github.com/users/pornel/gists{/gist_id}","starred_url":"https://api.github.com/users/pornel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pornel/subscriptions","organizations_url":"https://api.github.com/users/pornel/orgs","repos_url":"https://api.github.com/users/pornel/repos","events_url":"https://api.github.com/users/pornel/events{/privacy}","received_events_url":"https://api.github.com/users/pornel/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T17:19:43Z","updated_at":"2015-09-22T17:19:43Z","body":"How is this supposed to work with Service Workers? Does beacon-related fetch retain beacon's magical behavior?\r\n\r\nI can't use Beacon without SW, since unreliable delivery, as well as browser-specific (stats-skewing) retry logic is not acceptable for my use cases."}}