{"action":"created","issue":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/187","labels_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/187/comments","events_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/187/events","html_url":"https://github.com/scala-js/scala-js-dom/pull/187","id":121934522,"number":187,"title":"Add ChannelMessagingApi (SharedWorker, WorkerScopes) (fixes #186)","user":{"login":"danielwegener","id":2953619,"avatar_url":"https://avatars.githubusercontent.com/u/2953619?v=3","gravatar_id":"","url":"https://api.github.com/users/danielwegener","html_url":"https://github.com/danielwegener","followers_url":"https://api.github.com/users/danielwegener/followers","following_url":"https://api.github.com/users/danielwegener/following{/other_user}","gists_url":"https://api.github.com/users/danielwegener/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwegener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwegener/subscriptions","organizations_url":"https://api.github.com/users/danielwegener/orgs","repos_url":"https://api.github.com/users/danielwegener/repos","events_url":"https://api.github.com/users/danielwegener/events{/privacy}","received_events_url":"https://api.github.com/users/danielwegener/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-13T18:08:43Z","updated_at":"2015-12-14T08:59:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/187","html_url":"https://github.com/scala-js/scala-js-dom/pull/187","diff_url":"https://github.com/scala-js/scala-js-dom/pull/187.diff","patch_url":"https://github.com/scala-js/scala-js-dom/pull/187.patch"},"body":"This PR adds interfaces for the following ChannelMessagingApi interfaces (all in the experimental package for now - even they are not really tagged as experimental in MDN):\r\n\r\n- NavigatorLanguage (mixed into Navigator)\r\n- WorkerNavigator\r\n- WorkerLocation\r\n- WorkerGlobalScope\r\n- DedicatedWorkerGlobalScope\r\n- SharedWorkerGlobalScope\r\n- ServiceWorkerGlobalScope\r\n\r\nThe following interfaces for ServiceWorkers are added\r\n- ClientType\r\n- ClientQueryOptions\r\n- Clients\r\n\r\nThe idea is that a user can create a `serviceWorker.js` with scala.js ([with a wrapper that directly calls the main method](https://gitter.im/scala-js/scala-js?at=5625da510b33c42d5f81e968)) like this (note that the message event comes from ServiceWorker):\r\n\r\n```scala\r\n@JSExport\r\nobject SharedServiceWorker {\r\n  val self = SharedWorkerGlobalScope.self\r\n  @JSExport\r\n  def main(): Unit = {\r\n    self.onconnect = (m:MessageEvent) => {\r\n      m.ports(0).postMessage(s\"hello client! I am ${self.name}\")\r\n    }\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/comments/164382067","html_url":"https://github.com/scala-js/scala-js-dom/pull/187#issuecomment-164382067","issue_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/187","id":164382067,"user":{"login":"mseddon","id":4021991,"avatar_url":"https://avatars.githubusercontent.com/u/4021991?v=3","gravatar_id":"","url":"https://api.github.com/users/mseddon","html_url":"https://github.com/mseddon","followers_url":"https://api.github.com/users/mseddon/followers","following_url":"https://api.github.com/users/mseddon/following{/other_user}","gists_url":"https://api.github.com/users/mseddon/gists{/gist_id}","starred_url":"https://api.github.com/users/mseddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mseddon/subscriptions","organizations_url":"https://api.github.com/users/mseddon/orgs","repos_url":"https://api.github.com/users/mseddon/repos","events_url":"https://api.github.com/users/mseddon/events{/privacy}","received_events_url":"https://api.github.com/users/mseddon/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T08:59:54Z","updated_at":"2015-12-14T08:59:54Z","body":"Yep, This is what happens when things go in the wrong place. :/"}}