org.openqa.selenium.devtools.v85.applicationcache.ApplicationCache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenium-devtools-v85 Show documentation
Show all versions of selenium-devtools-v85 Show documentation
Selenium automates browsers. That's it! What you do with that power is entirely up to you.
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 com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;
@Beta()
public class ApplicationCache {
/**
* Enables application cache domain notifications.
*/
public static Command enable() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("ApplicationCache.enable", params.build());
}
/**
* 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");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("frameId", frameId);
return new Command<>("ApplicationCache.getApplicationCacheForFrame", params.build(), 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() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("ApplicationCache.getFramesWithManifests", params.build(), ConverterFunctions.map("frameIds", new com.google.common.reflect.TypeToken>() {
}.getType()));
}
/**
* 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");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("frameId", frameId);
return new Command<>("ApplicationCache.getManifestForFrame", params.build(), 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));
}
}