{"action":"created","issue":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/586","labels_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/586/comments","events_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/586/events","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/586","id":51595860,"number":586,"title":"Add an API to take over uncontrolled pages (or pages controlled by another service worker)","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/lifecycle","name":"lifecycle","color":"5319e7"},{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/labels/needs%20spec","name":"needs spec","color":"fbca04"}],"state":"open","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":13,"closed_issues":9,"state":"open","created_at":"2014-10-14T08:25:32Z","updated_at":"2015-01-23T07:03:02Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2014-12-10T18:51:33Z","updated_at":"2015-01-23T07:09:52Z","closed_at":null,"body":"This used to be part of `installEvent.replace()`, but we've separated out the skip-waiting part into `self.skipWaiting`, but we still need the other part.\r\n\r\nLoosely, this would:\r\n\r\n1. If this worker isn't active, either wait or reject (TODO: not sure what's best yet)\r\n1. For each client\r\n  1. Let registration be the result of \"Match Service Worker Registration\" for that client\r\n  1. If registration is not the registration already in use by the client:\r\n    1. If registration is this serviceworker's registration:\r\n      1. Make the client use registration, fire `controllerchange` event\r\n1. Resolve promise with undefined\r\n\r\nNeed to have a think about step 1. Also, maybe it should resolve true/false depending on if anything actually changed.\r\n\r\n@slightlyoff suggested `clients.claim()` as a API name/location, which works for me."},"comment":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/comments/71155605","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/586#issuecomment-71155605","issue_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/586","id":71155605,"user":{"login":"jungkees","id":1331169,"avatar_url":"https://avatars.githubusercontent.com/u/1331169?v=3","gravatar_id":"","url":"https://api.github.com/users/jungkees","html_url":"https://github.com/jungkees","followers_url":"https://api.github.com/users/jungkees/followers","following_url":"https://api.github.com/users/jungkees/following{/other_user}","gists_url":"https://api.github.com/users/jungkees/gists{/gist_id}","starred_url":"https://api.github.com/users/jungkees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jungkees/subscriptions","organizations_url":"https://api.github.com/users/jungkees/orgs","repos_url":"https://api.github.com/users/jungkees/repos","events_url":"https://api.github.com/users/jungkees/events{/privacy}","received_events_url":"https://api.github.com/users/jungkees/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T07:09:52Z","updated_at":"2015-01-23T07:09:52Z","body":"Specified `Clients.claim()`: aeee6b9d5fa3eb071cb9667f1d599ecf90a78410. A non-active worker's claim rejects for now."}}