Open Bug 1410741 Opened 7 years ago Updated 2 years ago

Logged Service workers events are stringified

Categories

(DevTools :: Console, defect, P3)

58 Branch
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: heidi.kasemir, Unassigned)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20171022100058

Steps to reproduce:

register a simple service worker on an app with the following contents:

```
self.addEventListener('fetch', function(event) {
  console.log(event.request);
});
```


Actual results:

I see `[object Request]  sw.js:5:3` logged for each request


Expected results:

I'd like to be able to expand and inspect this request object, as you can on chrome, (see screen shot with chrome on the left, firefox nightly on the right)
Component: Untriaged → Developer Tools: Console
So, this is not an issue with the Request object itself, since the following :

> fetch("https://jsonplaceholder.typicode.com/posts").then(console.log)

do print 
> Response { type: "basic", url: "https://jsonplaceholder.typicode.com/posts", redirected: false, status: 200, ok: true, statusText: "OK", headers: Headers, bodyUsed: false }
Steps to reproduce:
1. Go to https://devtools-html-simple-service-worker.glitch.me/
2. Open the console

Expected results:
I see the Event objects logged from the 

Actual results:
The console shows logs like : 
>  I am installing. [object ExtendableEvent]

The event object seems to be replaced by its `.toString()` equivalent.

---

Here is the service worker code: 

    self.addEventListener('install', event => {
      console.log('I am installing.', event);
    });
    
    self.addEventListener('activate', event => {
      console.log('I am alive!', event);
    });
    
    self.addEventListener('fetch', event => {
      console.log('Someone tried to fetch something. ☺️', event);
    });
Summary: allow inspecting Request objects in the console → Allow inspecting service workers events in the console
Comment 1 is erroneous, since I tested the response object.
Here is a test for Request: 
> new Request("https://jsonplaceholder.typicode.com/posts")

The Request object is displayed as expected
Priority: -- → P3
Product: Firefox → DevTools
Summary: Allow inspecting service workers events in the console → Logged Service workers events are stringified
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: