All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openqa.selenium.devtools.v85.applicationcache.ApplicationCache Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 4.26.0
Show newest version
package org.openqa.selenium.devtools.v85.applicationcache;

import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import java.util.Map;
import java.util.LinkedHashMap;
import org.openqa.selenium.json.JsonInput;

@Beta()
public class ApplicationCache {

    /**
     * Enables application cache domain notifications.
     */
    public static Command enable() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("ApplicationCache.enable", Map.copyOf(params));
    }

    /**
     * Returns relevant application cache data for the document in given frame.
     */
    public static Command getApplicationCacheForFrame(org.openqa.selenium.devtools.v85.page.model.FrameId frameId) {
        java.util.Objects.requireNonNull(frameId, "frameId is required");
        LinkedHashMap params = new LinkedHashMap<>();
        params.put("frameId", frameId);
        return new Command<>("ApplicationCache.getApplicationCacheForFrame", Map.copyOf(params), ConverterFunctions.map("applicationCache", org.openqa.selenium.devtools.v85.applicationcache.model.ApplicationCache.class));
    }

    /**
     * Returns array of frame identifiers with manifest urls for each frame containing a document
     * associated with some application cache.
     */
    public static Command> getFramesWithManifests() {
        LinkedHashMap params = new LinkedHashMap<>();
        return new Command<>("ApplicationCache.getFramesWithManifests", Map.copyOf(params), ConverterFunctions.map("frameIds", input -> input.readArray(org.openqa.selenium.devtools.v85.applicationcache.model.FrameWithManifest.class)));
    }

    /**
     * Returns manifest URL for document in the given frame.
     */
    public static Command getManifestForFrame(org.openqa.selenium.devtools.v85.page.model.FrameId frameId) {
        java.util.Objects.requireNonNull(frameId, "frameId is required");
        LinkedHashMap params = new LinkedHashMap<>();
        params.put("frameId", frameId);
        return new Command<>("ApplicationCache.getManifestForFrame", Map.copyOf(params), ConverterFunctions.map("manifestURL", java.lang.String.class));
    }

    public static Event applicationCacheStatusUpdated() {
        return new Event<>("ApplicationCache.applicationCacheStatusUpdated", input -> input.read(org.openqa.selenium.devtools.v85.applicationcache.model.ApplicationCacheStatusUpdated.class));
    }

    public static Event networkStateUpdated() {
        return new Event<>("ApplicationCache.networkStateUpdated", ConverterFunctions.map("isNowOnline", java.lang.Boolean.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy