title: How to register a service worker from a different domain
body: <p>I am trying to implement Push Notifications for Google Chrome. I want to register service worker from a different domain.</p>
  
  <p>Example: 
  Service Worker Code is located at: <a href="https://example.com/" rel="nofollow">https://example.com/</a></p>
  
  <p>I want to register the service worker (which is located at above domain) from a different domain: <a href="https://example2.com/" rel="nofollow">https://example2.com/</a></p>
  
  <p>Is there any way to achieve the same. Because when I try to include the service worker page (example) as an iFrame, the service worker throws an error while registering</p>
  
  <blockquote>
    <p>"Uncaught (in promise) DOMException: Registration failed - permission
    denied"</p>
  </blockquote>