All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.hubspot.chrome.devtools.client.core.serviceworker.ServiceWorker Maven / Gradle / Ivy
package com.hubspot.chrome.devtools.client.core.serviceworker;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.hubspot.chrome.devtools.base.ChromeRequest;
import com.hubspot.chrome.devtools.base.ChromeSessionCore;
public final class ServiceWorker {
ChromeSessionCore chromeSession;
ObjectMapper objectMapper;
public ServiceWorker(ChromeSessionCore chromeSession, ObjectMapper objectMapper) {
this.chromeSession = chromeSession;
this.objectMapper = objectMapper;
}
public void deliverPushMessage(String origin, String registrationId, String data) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.deliverPushMessage");
chromeRequest
.putParams("origin", origin)
.putParams("registrationId", registrationId)
.putParams("data", data);
chromeSession.send(chromeRequest);
}
public void deliverPushMessageAsync(String origin, String registrationId, String data) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.deliverPushMessage");
chromeRequest
.putParams("origin", origin)
.putParams("registrationId", registrationId)
.putParams("data", data);
chromeSession.sendAsync(chromeRequest);
}
public void disable() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.disable");
chromeSession.send(chromeRequest);
}
public void disableAsync() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.disable");
chromeSession.sendAsync(chromeRequest);
}
public void dispatchSyncEvent(String origin, String registrationId, String tag,
Boolean lastChance) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.dispatchSyncEvent");
chromeRequest
.putParams("origin", origin)
.putParams("registrationId", registrationId)
.putParams("tag", tag)
.putParams("lastChance", lastChance);
chromeSession.send(chromeRequest);
}
public void dispatchSyncEventAsync(String origin, String registrationId, String tag,
Boolean lastChance) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.dispatchSyncEvent");
chromeRequest
.putParams("origin", origin)
.putParams("registrationId", registrationId)
.putParams("tag", tag)
.putParams("lastChance", lastChance);
chromeSession.sendAsync(chromeRequest);
}
public void enable() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.enable");
chromeSession.send(chromeRequest);
}
public void enableAsync() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.enable");
chromeSession.sendAsync(chromeRequest);
}
public void inspectWorker(String versionId) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.inspectWorker");
chromeRequest
.putParams("versionId", versionId);
chromeSession.send(chromeRequest);
}
public void inspectWorkerAsync(String versionId) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.inspectWorker");
chromeRequest
.putParams("versionId", versionId);
chromeSession.sendAsync(chromeRequest);
}
public void setForceUpdateOnPageLoad(Boolean forceUpdateOnPageLoad) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.setForceUpdateOnPageLoad");
chromeRequest
.putParams("forceUpdateOnPageLoad", forceUpdateOnPageLoad);
chromeSession.send(chromeRequest);
}
public void setForceUpdateOnPageLoadAsync(Boolean forceUpdateOnPageLoad) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.setForceUpdateOnPageLoad");
chromeRequest
.putParams("forceUpdateOnPageLoad", forceUpdateOnPageLoad);
chromeSession.sendAsync(chromeRequest);
}
public void skipWaiting(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.skipWaiting");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.send(chromeRequest);
}
public void skipWaitingAsync(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.skipWaiting");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.sendAsync(chromeRequest);
}
public void startWorker(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.startWorker");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.send(chromeRequest);
}
public void startWorkerAsync(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.startWorker");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.sendAsync(chromeRequest);
}
public void stopAllWorkers() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.stopAllWorkers");
chromeSession.send(chromeRequest);
}
public void stopAllWorkersAsync() {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.stopAllWorkers");
chromeSession.sendAsync(chromeRequest);
}
public void stopWorker(String versionId) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.stopWorker");
chromeRequest
.putParams("versionId", versionId);
chromeSession.send(chromeRequest);
}
public void stopWorkerAsync(String versionId) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.stopWorker");
chromeRequest
.putParams("versionId", versionId);
chromeSession.sendAsync(chromeRequest);
}
public void unregister(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.unregister");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.send(chromeRequest);
}
public void unregisterAsync(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.unregister");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.sendAsync(chromeRequest);
}
public void updateRegistration(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.updateRegistration");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.send(chromeRequest);
}
public void updateRegistrationAsync(String scopeURL) {
ChromeRequest chromeRequest = new ChromeRequest("ServiceWorker.updateRegistration");
chromeRequest
.putParams("scopeURL", scopeURL);
chromeSession.sendAsync(chromeRequest);
}
}