1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 this.onpush = function(event) {
6 sendMessageToClients('push', event.data);
9 function sendMessageToClients(type, data) {
10 var message = JSON.stringify({
14 clients.getAll().then(function(clients) {
15 clients.forEach(function(client) {
16 client.postMessage(message);