java.lang.Object
org.openqa.selenium.devtools.v127.pwa.PWA

@Beta public class PWA extends Object
This domain allows interacting with the browser to control PWAs.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PWA()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.openqa.selenium.devtools.Command<PWA.GetOsAppStateResponse>
    getOsAppState(String manifestId)
    Returns the following OS state for the given manifest id.
    static org.openqa.selenium.devtools.Command<Void>
    install(String manifestId, Optional<String> installUrlOrBundleUrl)
    Installs the given manifest identity, optionally using the given install_url or IWA bundle location.
    static org.openqa.selenium.devtools.Command<TargetID>
    launch(String manifestId, Optional<String> url)
    Launches the installed web app, or an url in the same web app instead of the default start url if it is provided.
    static org.openqa.selenium.devtools.Command<List<TargetID>>
    launchFilesInApp(String manifestId, List<String> files)
    Opens one or more local files from an installed web app identified by its manifestId.
    static org.openqa.selenium.devtools.Command<Void>
    Opens the current page in its web app identified by the manifest id, needs to be called on a page target.
    static org.openqa.selenium.devtools.Command<Void>
    uninstall(String manifestId)
    Uninstals the given manifest_id and closes any opened app windows.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PWA

      public PWA()
  • Method Details

    • getOsAppState

      public static org.openqa.selenium.devtools.Command<PWA.GetOsAppStateResponse> getOsAppState(String manifestId)
      Returns the following OS state for the given manifest id.
    • install

      public static org.openqa.selenium.devtools.Command<Void> install(String manifestId, Optional<String> installUrlOrBundleUrl)
      Installs the given manifest identity, optionally using the given install_url or IWA bundle location. TODO(crbug.com/337872319) Support IWA to meet the following specific requirement. IWA-specific install description: If the manifest_id is isolated-app://, install_url_or_bundle_url is required, and can be either an http(s) URL or file:// URL pointing to a signed web bundle (.swbn). The .swbn file's signing key must correspond to manifest_id. If Chrome is not in IWA dev mode, the installation will fail, regardless of the state of the allowlist.
    • uninstall

      public static org.openqa.selenium.devtools.Command<Void> uninstall(String manifestId)
      Uninstals the given manifest_id and closes any opened app windows.
    • launch

      public static org.openqa.selenium.devtools.Command<TargetID> launch(String manifestId, Optional<String> url)
      Launches the installed web app, or an url in the same web app instead of the default start url if it is provided. Returns a page Target.TargetID which can be used to attach to via Target.attachToTarget or similar APIs.
    • launchFilesInApp

      public static org.openqa.selenium.devtools.Command<List<TargetID>> launchFilesInApp(String manifestId, List<String> files)
      Opens one or more local files from an installed web app identified by its manifestId. The web app needs to have file handlers registered to process the files. The API returns one or more page Target.TargetIDs which can be used to attach to via Target.attachToTarget or similar APIs. If some files in the parameters cannot be handled by the web app, they will be ignored. If none of the files can be handled, this API returns an error. If no files provided as the parameter, this API also returns an error. According to the definition of the file handlers in the manifest file, one Target.TargetID may represent a page handling one or more files. The order of the returned Target.TargetIDs is not guaranteed. TODO(crbug.com/339454034): Check the existences of the input files.
    • openCurrentPageInApp

      public static org.openqa.selenium.devtools.Command<Void> openCurrentPageInApp(String manifestId)
      Opens the current page in its web app identified by the manifest id, needs to be called on a page target. This function returns immediately without waiting for the app finishing loading.