ExtendableMessageEvent `origin` is set incorrectly

NEW
Unassigned

Status

()

defect
P5
normal
2 years ago
Last year

People

(Reporter: jugglinmike, Unassigned)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

2 years ago
Steps to reproduce:

1. Create a service worker with the following source code:

       self.onmessage = function(event) {
         console.log(event.origin);
       };

2. Register a new service worker and transmit data to it via the `postMessage`
   API

Expected result: the value of the client's origin (e.g. `location.origin`)
should be printed to the developer's console.

Actual result: the empty string (`""`) is printed to the developer's console.

Operating System: Ubuntu 16.04 (x86_64)
Browser: Firefox Nightly
Contents of `platform.ini` file:
    [Build]
    BuildID=20170316110253
    Milestone=55.0a1
    SourceRepository=https://hg.mozilla.org/mozilla-central
    SourceStamp=ff04d410e74b69acfab17ef7e73e7397602d5a68


Reference: https://w3c.github.io/ServiceWorker/#extendablemessage-event-origin

> 4.8.2. event.origin
> 
> The `origin` attribute must return the value it was initialized to. When the
> object is created, this attribute must be initialized to the empty string. It
> represents the origin of the service worker client that sent the message.
I expect this to be fixed as part of my work in bug 1293277.
No longer blocks: ServiceWorkers-stability
Depends on: 1293277
Priority: -- → P2
Priority: P2 → P5
Duplicate of this bug: 1448740
Note, this was not fixed as part of bug 1293277.  Its probably a one line fix to set this properly.
You need to log in before you can comment on or make changes to this bug.