001package Torello.Browser.BrowserAPI;
002
003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
004// Java-HTML Imports
005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
006
007import Torello.Browser.*;
008import Torello.Browser.helper.*;
009import Torello.Browser.JavaScriptAPI.*;
010import Torello.JSON.*;
011
012import Torello.Java.ReadOnly.ReadOnlyList;
013import Torello.Java.ReadOnly.ReadOnlyArrayList;
014
015import Torello.JavaDoc.Annotations.StaticFunctional;
016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg;
017
018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.ServiceWorker$$Commands;
019
020
021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
022// JDK Imports
023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
024
025import javax.json.JsonObject;
026import javax.json.JsonValue;
027
028/**
029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN>
030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE>
031 */
032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE")
033public class ServiceWorker
034{
035    // No Pubic Constructors
036    private ServiceWorker() { }
037
038
039    // ********************************************************************************************
040    // ********************************************************************************************
041    // Eliminated Types
042    // ********************************************************************************************
043    // ********************************************************************************************
044
045
046    /**
047     * <CODE>[No Description Provided by Google]</CODE>
048
049     * <EMBED CLASS='external-html' DATA-CTAS='String' DATA-FILE-ID=CDP.EliminatedType
050     *     DATA-NAME=RegistrationID>
051     */
052    public static final String RegistrationID =
053        "RegistrationID has been eliminated.\n" +
054        "It was replaced with the standard Java-Type: String";
055
056
057    // ********************************************************************************************
058    // ********************************************************************************************
059    // Enumerated String Constants Lists
060    // ********************************************************************************************
061    // ********************************************************************************************
062
063
064    /**
065     * <CODE>[No Description Provided by Google]</CODE>
066     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
067     */
068    public static final ReadOnlyList<String> ServiceWorkerVersionRunningStatus = new ReadOnlyArrayList<>
069        (String.class, "running", "starting", "stopped", "stopping");
070
071    /**
072     * <CODE>[No Description Provided by Google]</CODE>
073     * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B>
074     */
075    public static final ReadOnlyList<String> ServiceWorkerVersionStatus = new ReadOnlyArrayList<>
076        (String.class, "activated", "activating", "installed", "installing", "new", "redundant");
077
078
079
080    // ********************************************************************************************
081    // ********************************************************************************************
082    // Basic Types
083    // ********************************************************************************************
084    // ********************************************************************************************
085
086
087    /**
088     * ServiceWorker error message.
089     * 
090     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
091     */
092    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
093    public static class ServiceWorkerErrorMessage
094        extends BaseType<ServiceWorkerErrorMessage>
095        implements java.io.Serializable
096    {
097        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
098        protected static final long serialVersionUID = 1;
099
100        private static final NestedHelper<ServiceWorker.ServiceWorkerErrorMessage> singleton =
101            Torello.Browser.BrowserAPI.NestedHelpers.Types.
102                ServiceWorker$$ServiceWorkerErrorMessage$$.singleton;
103
104        /** <CODE>[No Description Provided by Google]</CODE> */
105        public final String errorMessage;
106
107        /** <CODE>[No Description Provided by Google]</CODE> */
108        public final String registrationId;
109
110        /** <CODE>[No Description Provided by Google]</CODE> */
111        public final String versionId;
112
113        /** <CODE>[No Description Provided by Google]</CODE> */
114        public final String sourceURL;
115
116        /** <CODE>[No Description Provided by Google]</CODE> */
117        public final int lineNumber;
118
119        /** <CODE>[No Description Provided by Google]</CODE> */
120        public final int columnNumber;
121
122        /** Constructor.  Please review this class' fields for documentation. */
123        public ServiceWorkerErrorMessage(
124                ReadOnlyList<Boolean> isPresent, String errorMessage, String registrationId,
125                String versionId, String sourceURL, int lineNumber, int columnNumber
126            )
127        {
128            super(singleton, Domains.ServiceWorker, "ServiceWorkerErrorMessage", 6);
129
130            this.errorMessage   = errorMessage;
131            this.registrationId = registrationId;
132            this.versionId      = versionId;
133            this.sourceURL      = sourceURL;
134            this.lineNumber     = lineNumber;
135            this.columnNumber   = columnNumber;
136
137            this.isPresent = (isPresent == null)
138                ? singleton.generateIsPresentList(this)
139                : THROWS.check(isPresent, 6, "ServiceWorker.ServiceWorkerErrorMessage");
140        }
141
142        /** Creates an instance of this class from a {@link JsonObject}.*/
143        public static ServiceWorkerErrorMessage fromJSON(JsonObject jo)
144        { return singleton.fromJSON(jo); }
145
146        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
147        public static NestedDescriptor<ServiceWorkerErrorMessage> descriptor()
148        { return singleton.descriptor(); }
149    }
150
151    /**
152     * ServiceWorker registration.
153     * 
154     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
155     */
156    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
157    public static class ServiceWorkerRegistration
158        extends BaseType<ServiceWorkerRegistration>
159        implements java.io.Serializable
160    {
161        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
162        protected static final long serialVersionUID = 1;
163
164        private static final NestedHelper<ServiceWorker.ServiceWorkerRegistration> singleton =
165            Torello.Browser.BrowserAPI.NestedHelpers.Types.
166                ServiceWorker$$ServiceWorkerRegistration$$.singleton;
167
168        /** <CODE>[No Description Provided by Google]</CODE> */
169        public final String registrationId;
170
171        /** <CODE>[No Description Provided by Google]</CODE> */
172        public final String scopeURL;
173
174        /** <CODE>[No Description Provided by Google]</CODE> */
175        public final boolean isDeleted;
176
177        /** Constructor.  Please review this class' fields for documentation. */
178        public ServiceWorkerRegistration(
179                ReadOnlyList<Boolean> isPresent, String registrationId, String scopeURL,
180                boolean isDeleted
181            )
182        {
183            super(singleton, Domains.ServiceWorker, "ServiceWorkerRegistration", 3);
184
185            this.registrationId = registrationId;
186            this.scopeURL       = scopeURL;
187            this.isDeleted      = isDeleted;
188
189            this.isPresent = (isPresent == null)
190                ? singleton.generateIsPresentList(this)
191                : THROWS.check(isPresent, 3, "ServiceWorker.ServiceWorkerRegistration");
192        }
193
194        /** Creates an instance of this class from a {@link JsonObject}.*/
195        public static ServiceWorkerRegistration fromJSON(JsonObject jo)
196        { return singleton.fromJSON(jo); }
197
198        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
199        public static NestedDescriptor<ServiceWorkerRegistration> descriptor()
200        { return singleton.descriptor(); }
201    }
202
203    /**
204     * ServiceWorker version.
205     * 
206     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
207     */
208    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI")
209    public static class ServiceWorkerVersion
210        extends BaseType<ServiceWorkerVersion>
211        implements java.io.Serializable
212    {
213        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
214        protected static final long serialVersionUID = 1;
215
216        private static final NestedHelper<ServiceWorker.ServiceWorkerVersion> singleton =
217            Torello.Browser.BrowserAPI.NestedHelpers.Types.
218                ServiceWorker$$ServiceWorkerVersion$$.singleton;
219
220        /** <CODE>[No Description Provided by Google]</CODE> */
221        public final String versionId;
222
223        /** <CODE>[No Description Provided by Google]</CODE> */
224        public final String registrationId;
225
226        /** <CODE>[No Description Provided by Google]</CODE> */
227        public final String scriptURL;
228
229        /**
230         * <CODE>[No Description Provided by Google]</CODE>
231         * <EMBED CLASS='external-html' DATA-D=ServiceWorker DATA-C=ServiceWorkerVersionRunningStatus DATA-F=runningStatus DATA-FILE-ID=CDP.EL2>
232         * @see BaseType#enumStrList(String)
233         */
234        public final String runningStatus;
235
236        /**
237         * <CODE>[No Description Provided by Google]</CODE>
238         * <EMBED CLASS='external-html' DATA-D=ServiceWorker DATA-C=ServiceWorkerVersionStatus DATA-F=status DATA-FILE-ID=CDP.EL2>
239         * @see BaseType#enumStrList(String)
240         */
241        public final String status;
242
243        /**
244         * The Last-Modified header value of the main script.
245         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
246         */
247        public final Number scriptLastModified;
248
249        /**
250         * The time at which the response headers of the main script were received from the server.
251         * For cached script it is the last time the cache entry was validated.
252         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
253         */
254        public final Number scriptResponseTime;
255
256        /**
257         * <CODE>[No Description Provided by Google]</CODE>
258         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
259         */
260        public final String[] controlledClients;
261
262        /**
263         * <CODE>[No Description Provided by Google]</CODE>
264         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
265         */
266        public final String targetId;
267
268        /**
269         * <CODE>[No Description Provided by Google]</CODE>
270         * <BR /><B CLASS=Opt-Top>OPTIONAL</B>
271         */
272        public final String routerRules;
273
274        /** Constructor.  Please review this class' fields for documentation. */
275        public ServiceWorkerVersion(
276                ReadOnlyList<Boolean> isPresent, String versionId, String registrationId,
277                String scriptURL, String runningStatus, String status, Number scriptLastModified,
278                Number scriptResponseTime, String[] controlledClients, String targetId,
279                String routerRules
280            )
281        {
282            super(singleton, Domains.ServiceWorker, "ServiceWorkerVersion", 10);
283
284            this.versionId          = versionId;
285            this.registrationId     = registrationId;
286            this.scriptURL          = scriptURL;
287            this.runningStatus      = runningStatus;
288            this.status             = status;
289            this.scriptLastModified = scriptLastModified;
290            this.scriptResponseTime = scriptResponseTime;
291            this.controlledClients  = controlledClients;
292            this.targetId           = targetId;
293            this.routerRules        = routerRules;
294
295            this.isPresent = (isPresent == null)
296                ? singleton.generateIsPresentList(this)
297                : THROWS.check(isPresent, 10, "ServiceWorker.ServiceWorkerVersion");
298        }
299
300        /** Creates an instance of this class from a {@link JsonObject}.*/
301        public static ServiceWorkerVersion fromJSON(JsonObject jo)
302        { return singleton.fromJSON(jo); }
303
304        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
305        public static NestedDescriptor<ServiceWorkerVersion> descriptor()
306        { return singleton.descriptor(); }
307    }
308
309
310    // ********************************************************************************************
311    // ********************************************************************************************
312    // Event Types
313    // ********************************************************************************************
314    // ********************************************************************************************
315
316
317    /**
318     * <CODE>[No Description Provided by Google]</CODE>
319     * 
320     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
321     */
322    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
323    public static class workerErrorReported
324        extends BrowserEvent<workerErrorReported>
325        implements java.io.Serializable
326    {
327        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
328        protected static final long serialVersionUID = 1;
329
330        private static final NestedHelper<ServiceWorker.workerErrorReported> singleton =
331            Torello.Browser.BrowserAPI.NestedHelpers.Events.
332                ServiceWorker$$workerErrorReported$$.singleton;
333
334        /** <CODE>[No Description Provided by Google]</CODE> */
335        public final ServiceWorker.ServiceWorkerErrorMessage errorMessage;
336
337        /** Constructor.  Please review this class' fields for documentation. */
338        public workerErrorReported
339            (ReadOnlyList<Boolean> isPresent, ServiceWorkerErrorMessage errorMessage)
340        {
341            super(singleton, Domains.ServiceWorker, "workerErrorReported", 1);
342
343            this.errorMessage = errorMessage;
344
345            this.isPresent = (isPresent == null)
346                ? singleton.generateIsPresentList(this)
347                : THROWS.check(isPresent, 1, "ServiceWorker.workerErrorReported");
348        }
349
350        /** Creates an instance of this class from a {@link JsonObject}.*/
351        public static workerErrorReported fromJSON(JsonObject jo)
352        { return singleton.fromJSON(jo); }
353
354        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
355        public static NestedDescriptor<workerErrorReported> descriptor()
356        { return singleton.descriptor(); }
357    }
358
359    /**
360     * <CODE>[No Description Provided by Google]</CODE>
361     * 
362     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
363     */
364    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
365    public static class workerRegistrationUpdated
366        extends BrowserEvent<workerRegistrationUpdated>
367        implements java.io.Serializable
368    {
369        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
370        protected static final long serialVersionUID = 1;
371
372        private static final NestedHelper<ServiceWorker.workerRegistrationUpdated> singleton =
373            Torello.Browser.BrowserAPI.NestedHelpers.Events.
374                ServiceWorker$$workerRegistrationUpdated$$.singleton;
375
376        /** <CODE>[No Description Provided by Google]</CODE> */
377        public final ServiceWorker.ServiceWorkerRegistration[] registrations;
378
379        /** Constructor.  Please review this class' fields for documentation. */
380        public workerRegistrationUpdated
381            (ReadOnlyList<Boolean> isPresent, ServiceWorkerRegistration[] registrations)
382        {
383            super(singleton, Domains.ServiceWorker, "workerRegistrationUpdated", 1);
384
385            this.registrations = registrations;
386
387            this.isPresent = (isPresent == null)
388                ? singleton.generateIsPresentList(this)
389                : THROWS.check(isPresent, 1, "ServiceWorker.workerRegistrationUpdated");
390        }
391
392        /** Creates an instance of this class from a {@link JsonObject}.*/
393        public static workerRegistrationUpdated fromJSON(JsonObject jo)
394        { return singleton.fromJSON(jo); }
395
396        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
397        public static NestedDescriptor<workerRegistrationUpdated> descriptor()
398        { return singleton.descriptor(); }
399    }
400
401    /**
402     * <CODE>[No Description Provided by Google]</CODE>
403     * 
404     * <EMBED CLASS=globalDefs DATA-DOMAIN=ServiceWorker DATA-API=BrowserAPI>
405     */
406    @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI")
407    public static class workerVersionUpdated
408        extends BrowserEvent<workerVersionUpdated>
409        implements java.io.Serializable
410    {
411        /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */
412        protected static final long serialVersionUID = 1;
413
414        private static final NestedHelper<ServiceWorker.workerVersionUpdated> singleton =
415            Torello.Browser.BrowserAPI.NestedHelpers.Events.
416                ServiceWorker$$workerVersionUpdated$$.singleton;
417
418        /** <CODE>[No Description Provided by Google]</CODE> */
419        public final ServiceWorker.ServiceWorkerVersion[] versions;
420
421        /** Constructor.  Please review this class' fields for documentation. */
422        public workerVersionUpdated
423            (ReadOnlyList<Boolean> isPresent, ServiceWorkerVersion[] versions)
424        {
425            super(singleton, Domains.ServiceWorker, "workerVersionUpdated", 1);
426
427            this.versions = versions;
428
429            this.isPresent = (isPresent == null)
430                ? singleton.generateIsPresentList(this)
431                : THROWS.check(isPresent, 1, "ServiceWorker.workerVersionUpdated");
432        }
433
434        /** Creates an instance of this class from a {@link JsonObject}.*/
435        public static workerVersionUpdated fromJSON(JsonObject jo)
436        { return singleton.fromJSON(jo); }
437
438        /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/
439        public static NestedDescriptor<workerVersionUpdated> descriptor()
440        { return singleton.descriptor(); }
441    }
442
443
444
445
446    // ********************************************************************************************
447    // ********************************************************************************************
448    // Commands
449    // ********************************************************************************************
450    // ********************************************************************************************
451
452
453    /**
454     * <CODE>[No Description Provided by Google]</CODE>
455     * 
456     * @param origin -
457     * 
458     * @param registrationId -
459     * 
460     * @param data -
461     * 
462     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
463     *
464     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
465     * browser receives the invocation-request.
466     *
467     * <BR /><BR /><DIV CLASS=JDHint>
468     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
469     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
470     * the Browser Function has run to completion.
471     * </DIV>
472     */
473    public static Script<Void> deliverPushMessage
474        (String origin, String registrationId, String data)
475    {
476        // Convert all Method Parameters into a JSON Request-Object (as a String)
477        final String requestJSON = WriteJSON.get(
478            ServiceWorker$$Commands.deliverPushMessage$$, "ServiceWorker.deliverPushMessage",
479            origin, registrationId, data
480        );
481
482        return Script.NO_RET(Domains.ServiceWorker, "deliverPushMessage", requestJSON);
483    }
484
485    /**
486     * <CODE>[No Description Provided by Google]</CODE>
487     * 
488     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
489     *
490     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
491     * browser receives the invocation-request.
492     *
493     * <BR /><BR /><DIV CLASS=JDHint>
494     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
495     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
496     * the Browser Function has run to completion.
497     * </DIV>
498     */
499    public static Script<Void> disable()
500    {
501        // Ultra-Simple Request JSON - Because this method has no parameters
502        final String requestJSON = "{\"method\":\"ServiceWorker.disable\"}";
503
504        return Script.NO_RET(Domains.ServiceWorker, "disable", requestJSON);
505    }
506
507    /**
508     * <CODE>[No Description Provided by Google]</CODE>
509     * 
510     * @param origin -
511     * 
512     * @param registrationId -
513     * 
514     * @param tag -
515     * 
516     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
517     *
518     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
519     * browser receives the invocation-request.
520     *
521     * <BR /><BR /><DIV CLASS=JDHint>
522     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
523     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
524     * the Browser Function has run to completion.
525     * </DIV>
526     */
527    public static Script<Void> dispatchPeriodicSyncEvent
528        (String origin, String registrationId, String tag)
529    {
530        // Convert all Method Parameters into a JSON Request-Object (as a String)
531        final String requestJSON = WriteJSON.get(
532            ServiceWorker$$Commands.dispatchPeriodicSyncEvent$$,
533            "ServiceWorker.dispatchPeriodicSyncEvent",
534            origin, registrationId, tag
535        );
536
537        return Script.NO_RET(Domains.ServiceWorker, "dispatchPeriodicSyncEvent", requestJSON);
538    }
539
540    /**
541     * <CODE>[No Description Provided by Google]</CODE>
542     * 
543     * @param origin -
544     * 
545     * @param registrationId -
546     * 
547     * @param tag -
548     * 
549     * @param lastChance -
550     * 
551     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
552     *
553     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
554     * browser receives the invocation-request.
555     *
556     * <BR /><BR /><DIV CLASS=JDHint>
557     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
558     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
559     * the Browser Function has run to completion.
560     * </DIV>
561     */
562    public static Script<Void> dispatchSyncEvent
563        (String origin, String registrationId, String tag, boolean lastChance)
564    {
565        // Convert all Method Parameters into a JSON Request-Object (as a String)
566        final String requestJSON = WriteJSON.get(
567            ServiceWorker$$Commands.dispatchSyncEvent$$, "ServiceWorker.dispatchSyncEvent",
568            origin, registrationId, tag, lastChance
569        );
570
571        return Script.NO_RET(Domains.ServiceWorker, "dispatchSyncEvent", requestJSON);
572    }
573
574    /**
575     * <CODE>[No Description Provided by Google]</CODE>
576     * 
577     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
578     *
579     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
580     * browser receives the invocation-request.
581     *
582     * <BR /><BR /><DIV CLASS=JDHint>
583     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
584     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
585     * the Browser Function has run to completion.
586     * </DIV>
587     */
588    public static Script<Void> enable()
589    {
590        // Ultra-Simple Request JSON - Because this method has no parameters
591        final String requestJSON = "{\"method\":\"ServiceWorker.enable\"}";
592
593        return Script.NO_RET(Domains.ServiceWorker, "enable", requestJSON);
594    }
595
596    /**
597     * <CODE>[No Description Provided by Google]</CODE>
598     * 
599     * @param forceUpdateOnPageLoad -
600     * 
601     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
602     *
603     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
604     * browser receives the invocation-request.
605     *
606     * <BR /><BR /><DIV CLASS=JDHint>
607     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
608     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
609     * the Browser Function has run to completion.
610     * </DIV>
611     */
612    public static Script<Void> setForceUpdateOnPageLoad(boolean forceUpdateOnPageLoad)
613    {
614        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
615        final String requestJSON = WriteJSON.get(
616            CDPTypes.PRIMITIVE_BOOLEAN, "forceUpdateOnPageLoad", false,
617            "ServiceWorker.setForceUpdateOnPageLoad", forceUpdateOnPageLoad
618        );
619
620        return Script.NO_RET(Domains.ServiceWorker, "setForceUpdateOnPageLoad", requestJSON);
621    }
622
623    /**
624     * <CODE>[No Description Provided by Google]</CODE>
625     * 
626     * @param scopeURL -
627     * 
628     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
629     *
630     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
631     * browser receives the invocation-request.
632     *
633     * <BR /><BR /><DIV CLASS=JDHint>
634     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
635     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
636     * the Browser Function has run to completion.
637     * </DIV>
638     */
639    public static Script<Void> skipWaiting(String scopeURL)
640    {
641        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
642        final String requestJSON = WriteJSON.get
643            (CDPTypes.STRING, "scopeURL", false, "ServiceWorker.skipWaiting", scopeURL);
644
645        return Script.NO_RET(Domains.ServiceWorker, "skipWaiting", requestJSON);
646    }
647
648    /**
649     * <CODE>[No Description Provided by Google]</CODE>
650     * 
651     * @param scopeURL -
652     * 
653     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
654     *
655     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
656     * browser receives the invocation-request.
657     *
658     * <BR /><BR /><DIV CLASS=JDHint>
659     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
660     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
661     * the Browser Function has run to completion.
662     * </DIV>
663     */
664    public static Script<Void> startWorker(String scopeURL)
665    {
666        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
667        final String requestJSON = WriteJSON.get
668            (CDPTypes.STRING, "scopeURL", false, "ServiceWorker.startWorker", scopeURL);
669
670        return Script.NO_RET(Domains.ServiceWorker, "startWorker", requestJSON);
671    }
672
673    /**
674     * <CODE>[No Description Provided by Google]</CODE>
675     * 
676     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
677     *
678     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
679     * browser receives the invocation-request.
680     *
681     * <BR /><BR /><DIV CLASS=JDHint>
682     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
683     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
684     * the Browser Function has run to completion.
685     * </DIV>
686     */
687    public static Script<Void> stopAllWorkers()
688    {
689        // Ultra-Simple Request JSON - Because this method has no parameters
690        final String requestJSON = "{\"method\":\"ServiceWorker.stopAllWorkers\"}";
691
692        return Script.NO_RET(Domains.ServiceWorker, "stopAllWorkers", requestJSON);
693    }
694
695    /**
696     * <CODE>[No Description Provided by Google]</CODE>
697     * 
698     * @param versionId -
699     * 
700     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
701     *
702     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
703     * browser receives the invocation-request.
704     *
705     * <BR /><BR /><DIV CLASS=JDHint>
706     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
707     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
708     * the Browser Function has run to completion.
709     * </DIV>
710     */
711    public static Script<Void> stopWorker(String versionId)
712    {
713        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
714        final String requestJSON = WriteJSON.get
715            (CDPTypes.STRING, "versionId", false, "ServiceWorker.stopWorker", versionId);
716
717        return Script.NO_RET(Domains.ServiceWorker, "stopWorker", requestJSON);
718    }
719
720    /**
721     * <CODE>[No Description Provided by Google]</CODE>
722     * 
723     * @param scopeURL -
724     * 
725     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
726     *
727     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
728     * browser receives the invocation-request.
729     *
730     * <BR /><BR /><DIV CLASS=JDHint>
731     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
732     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
733     * the Browser Function has run to completion.
734     * </DIV>
735     */
736    public static Script<Void> unregister(String scopeURL)
737    {
738        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
739        final String requestJSON = WriteJSON.get
740            (CDPTypes.STRING, "scopeURL", false, "ServiceWorker.unregister", scopeURL);
741
742        return Script.NO_RET(Domains.ServiceWorker, "unregister", requestJSON);
743    }
744
745    /**
746     * <CODE>[No Description Provided by Google]</CODE>
747     * 
748     * @param scopeURL -
749     * 
750     * @return An instance of <CODE>{@link Script}&lt;Void&gt;</CODE>
751     *
752     * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the
753     * browser receives the invocation-request.
754     *
755     * <BR /><BR /><DIV CLASS=JDHint>
756     * This Browser-Function <I>does not have</I> a return-value.  You may choose to
757     * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that
758     * the Browser Function has run to completion.
759     * </DIV>
760     */
761    public static Script<Void> updateRegistration(String scopeURL)
762    {
763        // Build the JSON Request-Object (as a String); only 1 Parameter is passed
764        final String requestJSON = WriteJSON.get
765            (CDPTypes.STRING, "scopeURL", false, "ServiceWorker.updateRegistration", scopeURL);
766
767        return Script.NO_RET(Domains.ServiceWorker, "updateRegistration", requestJSON);
768    }
769
770
771}