Define event handlers on ServiceWorkerGlobalScope.