New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 597538 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug-Regression



Sign in to add a comment

'Push' button disappeared from chrome://serviceworker-internals

Project Member Reported by owe...@chromium.org, Mar 24 2016

Issue description

I used the 'push' button on chrome://serviceworker-internals all the time, and know some developers use it with WebDriver to test their push notification implementations locally (crazy but awesome).

Can we bring it back? Bonus marks if we add the ability to pass in arbitrary payload...
 
Status: Available (was: Untriaged)
Peter, as far as I can tell we removed it on purpose didn't we? Assuming there was a good reason perhaps we could add something to chrome://gcm-internals. It is very quickly becoming my favourite debugging page. :)
Owner: mvanouwe...@chromium.org
Status: WontFix (was: Available)
We removed this from chrome://serviceworker-internals because there's better tooling in DevTools now:

1. Go to a page with a service worker like https://tests.peter.sh/notification-generator/
2. Open DevTools > Resources > Service Workers
3. For one of the workers click the bell icon (Emulate push event)

If that does not address the use case, please reopen.

Comment 3 by n...@fb.com, Mar 25 2016

Labels: DevRel-Facebook
Is there a way to use that button without having the site open? The value of having this button on serviceworker-internals is that you can push even when there are no tabs for the site open.

Comment 4 by owe...@chromium.org, Mar 31 2016

Nate makes a good point, not being able to press that button without the page open would be a significant regression. Is there a way of still achieving that without the push button on sw-internals?

Comment 5 by owe...@chromium.org, Mar 31 2016

Status: Unconfirmed (was: WontFix)
[bouncing back to unconfirmed until we resolve the issue Nate raised]

Comment 6 by n...@fb.com, Mar 31 2016

This is somewhat of an aside, but, I think it's important that the chrome://serviceworker-internals page doesn't go away all together. There is a lot of value in being able to update and inspect service workers before a page is open and the service worker has gotten its first fetch event. If I want to inspect a service worker and change what's in it's cache before it get's a fetch request then there's no way to do that if chrome://serviceworker-internals goes away all together.

Comment 7 by peter@chromium.org, Apr 1 2016

Cc: horo@chromium.org
I agree with the point in #3, but I'd like to approach this as a problem rather than linking it to the previous solution. (Which we should reconsider, at least for M50.)

In an ideal world, whatever solution we come up with would be usable for automated testing as well as manual testing, i.e. using DevTools with its protocol. The three primitives we need would be (1) forcefully shut down Service Worker, (2) fake the SW's clients and (3) fake a push message.

I believe we only offer (3) today. horo@, did you consider anything like this in your previous explorations?

Comment 8 by horo@chromium.org, Apr 4 2016

Cc: pfeldman@chromium.org
+CC:pfeldman@
I think "show all" checkbox in Service Workers view in DevTools will solve this problem.
https://codereview.chromium.org/1853073003/

Comment 9 by horo@chromium.org, Apr 4 2016

Components: Blink>ServiceWorker Platform>DevTools
@horo: while the CL that you sent out seems to be a very pragmatic solution to the problem, it is still broken end-to-end in many ways. I could not get the https://tests.peter.sh/notification-generator/ sample to work with it, neither I could try out examples from the web (https://gauntface.com/blog/2014/12/15/push-notifications-service-worker).

These seem to be all wrong and need improvement:

- DevTools is for the page, I should not see unrelated SW there. We need to pull chrome://inspect into the DevTools to show multiple targets there, so I'd 
rather we had push-to-wake service worker in chrome://inspect first

- Once I open DevTools for the SW itself, I don't have the Resources / SW and hence can not emit notification events

- There is no way to visually observe the notification and action upon it.

- There is no way to control notification-related data


Cc: kenjibaheux@chromium.org

Comment 12 by horo@chromium.org, Apr 6 2016

> @horo: while the CL that you sent out seems to be a very pragmatic solution to the problem, it is still broken end-to-end in many ways. I could not get the https://tests.peter.sh/notification-generator/ sample to work with it, neither I could try out examples from the web (https://gauntface.com/blog/2014/12/15/push-notifications-service-worker).

https://tests.peter.sh/notification-generator/ is not using "Push" notification now. It is using serviceWorker.showNotification().
So the push button doesn't do anything in this site.
You can try the button on Facebook or https://locchat.com if you have accepted the permission.


> These seem to be all wrong and need improvement:
>
> - DevTools is for the page, I should not see unrelated SW there. We need to pull chrome://inspect into the DevTools to show multiple targets there, so I'd rather we had push-to-wake service worker in chrome://inspect first

chrome://inspect shows only running Service Workers.
Do you think it should show all stopped Service Workers?
Or are you saying about chrome://serviceworker-internals?

> - Once I open DevTools for the SW itself, I don't have the Resources / SW and hence can not emit notification events

Yes, it is a bug. Filed  Issue 600901 .


> - There is no way to visually observe the notification and action upon it.

You can set a breakpoint in the push event handler in SW.

> - There is no way to control notification-related data

Yes, it is a bug. Filed  Issue 600902 .

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f17e936b00b806271cde194bb570e4b3790846a

commit 1f17e936b00b806271cde194bb570e4b3790846a
Author: horo <horo@chromium.org>
Date: Wed Apr 06 03:07:17 2016

[DevTools] Add "Show all" check box in Service Worker view.

There are some requests from web developers to provide a way to debug SWs before opening the page.
This cl adds "Show all" check box which shows all SWs in DevTools.

BUG= 597538 

Review URL: https://codereview.chromium.org/1853073003

Cr-Commit-Position: refs/heads/master@{#385372}

[modify] https://crrev.com/1f17e936b00b806271cde194bb570e4b3790846a/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
[modify] https://crrev.com/1f17e936b00b806271cde194bb570e4b3790846a/third_party/WebKit/Source/devtools/front_end/resources/serviceWorkersView.css

My comment #10 was by no means critics. I am rather offering my own help in resolving these - we seem to have a lot to add and fix in our SW support.

Comment 15 by horo@chromium.org, Apr 28 2016

Owner: horo@chromium.org
Status: Fixed (was: Unconfirmed)
Now we have "Show all" checkbox in DevTools SWView.
So we can click "push" without opening the site.

Sign in to add a comment