{"action":"closed","issue":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/236","labels_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/236/comments","events_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/236/events","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/236","id":31745075,"number":236,"title":"Option bag for .unregister, including immediate","user":{"login":"jakearchibald","id":93594,"avatar_url":"https://avatars.githubusercontent.com/u/93594?v=3","gravatar_id":"","url":"https://api.github.com/users/jakearchibald","html_url":"https://github.com/jakearchibald","followers_url":"https://api.github.com/users/jakearchibald/followers","following_url":"https://api.github.com/users/jakearchibald/following{/other_user}","gists_url":"https://api.github.com/users/jakearchibald/gists{/gist_id}","starred_url":"https://api.github.com/users/jakearchibald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakearchibald/subscriptions","organizations_url":"https://api.github.com/users/jakearchibald/orgs","repos_url":"https://api.github.com/users/jakearchibald/repos","events_url":"https://api.github.com/users/jakearchibald/events{/privacy}","received_events_url":"https://api.github.com/users/jakearchibald/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/labels/needs%20input","name":"needs input","color":"006b75"},{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/labels/needs%20spec","name":"needs spec","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/milestones/3","labels_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/milestones/3/labels","id":825216,"number":3,"title":"Version 2","description":null,"creator":{"login":"KenjiBaheux","id":6354698,"avatar_url":"https://avatars.githubusercontent.com/u/6354698?v=3","gravatar_id":"","url":"https://api.github.com/users/KenjiBaheux","html_url":"https://github.com/KenjiBaheux","followers_url":"https://api.github.com/users/KenjiBaheux/followers","following_url":"https://api.github.com/users/KenjiBaheux/following{/other_user}","gists_url":"https://api.github.com/users/KenjiBaheux/gists{/gist_id}","starred_url":"https://api.github.com/users/KenjiBaheux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KenjiBaheux/subscriptions","organizations_url":"https://api.github.com/users/KenjiBaheux/orgs","repos_url":"https://api.github.com/users/KenjiBaheux/repos","events_url":"https://api.github.com/users/KenjiBaheux/events{/privacy}","received_events_url":"https://api.github.com/users/KenjiBaheux/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":13,"state":"open","created_at":"2014-10-14T08:25:32Z","updated_at":"2015-02-09T13:56:14Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2014-04-17T17:18:05Z","updated_at":"2015-02-09T13:56:14Z","closed_at":"2015-02-09T13:56:14Z","body":"```js\r\n.unregister({\r\n  scope: '/*',\r\n  immediate: false\r\n});\r\n```\r\n\r\nThe above should be the api for `navigator.serviceWorker.unregister` and `self.unregister` within the serviceworker (although `scope` is ignored in the latter).\r\n\r\n`immediate` is the unregister equivalent of `.replace()` - if true the unregistration happens immediately across all pages in scope.\r\n\r\nThis makes the API similar to `register` (by having `scope` as an option), makes testing simpler, and makes rescue more immediate if the user shoots themselves in the foot, or someone shoots them in the foot."}}