service-worker-registration.js (1041B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 "use strict"; 5 6 const { 7 RetVal, 8 generateActorSpec, 9 } = require("resource://devtools/shared/protocol.js"); 10 11 const serviceWorkerRegistrationSpec = generateActorSpec({ 12 typeName: "serviceWorkerRegistration", 13 14 events: { 15 "push-subscription-modified": { 16 type: "push-subscription-modified", 17 }, 18 "registration-changed": { 19 type: "registration-changed", 20 }, 21 }, 22 23 methods: { 24 allowShutdown: { 25 request: {}, 26 }, 27 preventShutdown: { 28 request: {}, 29 }, 30 push: { 31 request: {}, 32 }, 33 start: { 34 request: {}, 35 }, 36 unregister: { 37 request: {}, 38 }, 39 getPushSubscription: { 40 request: {}, 41 response: { 42 subscription: RetVal("nullable:pushSubscription"), 43 }, 44 }, 45 }, 46 }); 47 48 exports.serviceWorkerRegistrationSpec = serviceWorkerRegistrationSpec;