Service Worker: Infrastructure: navigator.serviceWorker.controller is null despite active Service Worker

Issue #12459883 • Assigned to Steve B.

Details

Author
Thomas S.
Created
Jun 23, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
Service Workers 1

Found in build #
15.16199
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Context:

  • Edge:
    • Microsoft Edge 41.16199.1000.0
    • Microsoft EdgeHTML 15.16199
  • Windows:
    • Windows 10 Pro Insider Preview
    • Version: 1703
    • OS Build 16199.1000

Steps to reproduce:

  • Turn on the flags for Service Worker support in Edge.

  • Navigate to https://airhorner.com/.

  • Refresh the page twice (to let the Service Worker get installed and activated).

  • Open the console. It should log something like this:

    HTML1300: Navigation occurred.
    airhorner.com
    Current window: airhorner.com
    Service Worker Registered
    Service Worker Ready
    
  • See if the offline cache worked.

    caches.keys().then(keys => console.log(keys))
    // ✅ Prints "airhorner"
    caches.open('airhorner').then(cache => cache.keys()).then(keys => console.log(keys))
    // ✅ Prints the keys
    
  • See the ServiceWorkerRegistration.

    navigator.serviceWorker.ready.then(registration => console.log(registration))
    // ✅ Prints the registration object
    
  • See the controller.

    navigator.serviceWorker.controller
    // ❌ Prints null
    

Expected output

  • The ServiceWorker object should be printed (see attached chrome.jpg file) according to the spec.

Copied from Description when changed from Task to Bug

Copied from Repro Steps when changed from Bug to Task

Context:

  • Edge:
    • Microsoft Edge 41.16199.1000.0
    • Microsoft EdgeHTML 15.16199
  • Windows:
    • Windows 10 Pro Insider Preview
    • Version: 1703
    • OS Build 16199.1000

Steps to reproduce:

  • Turn on the flags for Service Worker support in Edge.

  • Navigate to https://airhorner.com/.

  • Refresh the page twice (to let the Service Worker get installed and activated).

  • Open the console. It should log something like this:

    HTML1300: Navigation occurred.
    airhorner.com
    Current window: airhorner.com
    Service Worker Registered
    Service Worker Ready
    
  • See if the offline cache worked.

    caches.keys().then(keys => console.log(keys))
    // ✅ Prints "airhorner"
    caches.open('airhorner').then(cache => cache.keys()).then(keys => console.log(keys))
    // ✅ Prints the keys
    
  • See the ServiceWorkerRegistration.

    navigator.serviceWorker.ready.then(registration => console.log(registration))
    // ✅ Prints the registration object
    
  • See the controller.

    navigator.serviceWorker.controller
    // ❌ Prints null
    

Expected output

  • The ServiceWorker object should be printed (see attached chrome.jpg file) according to the spec.

Attachments

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

    Changed Assigned To from “James M.” to “Steve B.”

    Changed Title from “navigator.serviceWorker.controller is null despite active Service Worker” to “Service Worker: Infrastructure: navigator.serviceWorker.controller is null despite active Service Worker”

  • This seems to be working fine now as of Preview Build 16241, running Edge/16.16241. See the screenshot in this tweet for details.

  • Microsoft Edge Team

    Changed Steps to Reproduce

You need to sign in to your Microsoft account to add a comment.

Sign in