{"action":"created","issue":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/612","labels_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/612/labels{/name}","comments_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/612/comments","events_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/612/events","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/612","id":56001196,"number":612,"title":"Should an IFRAME without src be controlled by SW when its parent is controlled?","user":{"login":"kinu","id":860295,"avatar_url":"https://avatars.githubusercontent.com/u/860295?v=3","gravatar_id":"","url":"https://api.github.com/users/kinu","html_url":"https://github.com/kinu","followers_url":"https://api.github.com/users/kinu/followers","following_url":"https://api.github.com/users/kinu/following{/other_user}","gists_url":"https://api.github.com/users/kinu/gists{/gist_id}","starred_url":"https://api.github.com/users/kinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinu/subscriptions","organizations_url":"https://api.github.com/users/kinu/orgs","repos_url":"https://api.github.com/users/kinu/repos","events_url":"https://api.github.com/users/kinu/events{/privacy}","received_events_url":"https://api.github.com/users/kinu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-30T06:56:00Z","updated_at":"2015-01-30T12:08:54Z","closed_at":null,"body":"Currently when an IFRAME is created without src= it's not controlled by any SW, so opening a document inside the iframe and loading subresources by frame.contentDocument.write(...) isn't handled by SW either.\r\n\r\nPer spec document.open() (and write()) does similar to 'navigation' but open and navigation are not really the same concept:\r\nhttps://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open\r\nhttps://html.spec.whatwg.org/multipage/browsers.html#navigate\r\n\r\nMore specifically, should the following code show the same controller twice for the parent and iframe?\r\n\r\n    <!doctype html>\r\n    <iframe id=x></iframe>\r\n    <script>\r\n    var x = document.getElementById('x');\r\n    console.log(navigator.serviceWorker.controller);  // <-- for parent doc\r\n    console.log(x.contentWindow.navigator.serviceWorker.controller);  // for iframe\r\n    </script>\r\n\r\nRelated chromium issue: https://code.google.com/p/chromium/issues/detail?id=439697\r\n\r\n(As a side note: from implementor's pov making no-src iframe controlled by SW is not that straightforward)\r\n"},"comment":{"url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/comments/72191938","html_url":"https://github.com/slightlyoff/ServiceWorker/issues/612#issuecomment-72191938","issue_url":"https://api.github.com/repos/slightlyoff/ServiceWorker/issues/612","id":72191938,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars.githubusercontent.com/u/1544111?v=3","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T12:08:54Z","updated_at":"2015-01-30T12:08:54Z","body":"Sure. The solution here is probably the same as it is for CSP et al, some kind of inheritance."}}