Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Error
- data ProtocolError
- data EPBrowserVersion = EPBrowserVersion
- data EPAllTargets = EPAllTargets
- data EPCurrentProtocol = EPCurrentProtocol
- data EPOpenNewTab = EPOpenNewTab {
- unOpenNewTab :: URL
- data EPActivateTarget = EPActivateTarget {}
- data EPCloseTarget = EPCloseTarget {}
- data EPFrontend = EPFrontend
- class Endpoint ep
- type family EndpointResponse ep :: *
- data SomeEndpoint where
- SomeEndpoint :: Endpoint ep => ep -> SomeEndpoint
- data BrowserVersion = BrowserVersion {}
- data TargetInfo = TargetInfo {
- tiDescription :: Text
- tiDevtoolsFrontendUrl :: Text
- tiId :: Text
- tiTitle :: Text
- tiType :: Text
- tiUrl :: Text
- tiWebSocketDebuggerUrl :: Text
- type TargetId = Text
- parseUri :: String -> Maybe (String, Int, String)
- fromSomeEndpoint :: (forall ep. Endpoint ep => ep -> r) -> SomeEndpoint -> r
- endpoint :: Endpoint ep => Config -> ep -> IO (EndpointResponse ep)
- connectToTab :: Config -> URL -> IO TargetInfo
- type ClientApp b = Handle -> IO b
- data Handle
- data Config = Config {
- hostPort :: (String, Int)
- connectToBrowser :: Bool
- doLogResponses :: Bool
- commandTimeout :: Maybe Int
- runClient :: forall b. Config -> ClientApp b -> IO b
- data Subscription
- subscribe :: forall a. Event a => Handle -> (a -> IO ()) -> IO Subscription
- subscribeForSession :: forall a. Event a => Handle -> SessionId -> (a -> IO ()) -> IO Subscription
- unsubscribe :: Handle -> Subscription -> IO ()
- class (ToJSON cmd, FromJSON (CommandResponse cmd)) => Command cmd where
- type CommandResponse cmd :: *
- commandName :: Proxy cmd -> String
- fromJSON :: Proxy cmd -> Value -> Result (CommandResponse cmd)
- data SomeCommand where
- SomeCommand :: Command cmd => cmd -> SomeCommand
- data Promise a where
- fromSomeCommand :: (forall cmd. Command cmd => cmd -> r) -> SomeCommand -> r
- readPromise :: Promise a -> IO a
- sendCommand :: forall cmd. Command cmd => Handle -> cmd -> IO (Promise (CommandResponse cmd))
- sendCommandForSession :: forall cmd. Command cmd => Handle -> SessionId -> cmd -> IO (Promise (CommandResponse cmd))
- sendCommandWait :: Command cmd => Handle -> cmd -> IO (CommandResponse cmd)
- sendCommandForSessionWait :: Command cmd => Handle -> SessionId -> cmd -> IO (CommandResponse cmd)
- module CDP.Domains
Documentation
Instances
Eq Error Source # | |
Show Error Source # | |
Exception Error Source # | |
Defined in CDP.Internal.Utils toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # |
data ProtocolError Source #
PEParse String | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text |
PEInvalidRequest String | The JSON sent is not a valid Request object |
PEMethodNotFound String | The method does not exist / is not available |
PEInvalidParams String | Invalid method parameter (s) |
PEInternalError String | Internal JSON-RPC error |
PEServerError String | Server error |
PEOther String | An uncategorized error |
Instances
Eq ProtocolError Source # | |
Defined in CDP.Internal.Utils (==) :: ProtocolError -> ProtocolError -> Bool # (/=) :: ProtocolError -> ProtocolError -> Bool # | |
Show ProtocolError Source # | |
Defined in CDP.Internal.Utils showsPrec :: Int -> ProtocolError -> ShowS # show :: ProtocolError -> String # showList :: [ProtocolError] -> ShowS # | |
FromJSON ProtocolError Source # | |
Defined in CDP.Internal.Utils parseJSON :: Value -> Parser ProtocolError # parseJSONList :: Value -> Parser [ProtocolError] # | |
Exception ProtocolError Source # | |
Defined in CDP.Internal.Utils |
data EPBrowserVersion Source #
Instances
Endpoint EPBrowserVersion Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPBrowserVersion -> IO (EndpointResponse EPBrowserVersion) Source # epDecode :: Proxy EPBrowserVersion -> ByteString -> Either String (EndpointResponse EPBrowserVersion) Source # | |
type EndpointResponse EPBrowserVersion Source # | |
Defined in CDP.Endpoints |
data EPAllTargets Source #
Instances
Endpoint EPAllTargets Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPAllTargets -> IO (EndpointResponse EPAllTargets) Source # epDecode :: Proxy EPAllTargets -> ByteString -> Either String (EndpointResponse EPAllTargets) Source # | |
type EndpointResponse EPAllTargets Source # | |
Defined in CDP.Endpoints |
data EPCurrentProtocol Source #
Instances
Endpoint EPCurrentProtocol Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPCurrentProtocol Source # | |
Defined in CDP.Endpoints |
data EPOpenNewTab Source #
Instances
Endpoint EPOpenNewTab Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPOpenNewTab -> IO (EndpointResponse EPOpenNewTab) Source # epDecode :: Proxy EPOpenNewTab -> ByteString -> Either String (EndpointResponse EPOpenNewTab) Source # | |
type EndpointResponse EPOpenNewTab Source # | |
Defined in CDP.Endpoints |
data EPActivateTarget Source #
Instances
Endpoint EPActivateTarget Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPActivateTarget -> IO (EndpointResponse EPActivateTarget) Source # epDecode :: Proxy EPActivateTarget -> ByteString -> Either String (EndpointResponse EPActivateTarget) Source # | |
type EndpointResponse EPActivateTarget Source # | |
Defined in CDP.Endpoints |
data EPCloseTarget Source #
Instances
Endpoint EPCloseTarget Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPCloseTarget -> IO (EndpointResponse EPCloseTarget) Source # epDecode :: Proxy EPCloseTarget -> ByteString -> Either String (EndpointResponse EPCloseTarget) Source # | |
type EndpointResponse EPCloseTarget Source # | |
Defined in CDP.Endpoints |
data EPFrontend Source #
Instances
Endpoint EPFrontend Source # | |
Defined in CDP.Endpoints getEndpoint :: (String, Int) -> EPFrontend -> IO (EndpointResponse EPFrontend) Source # epDecode :: Proxy EPFrontend -> ByteString -> Either String (EndpointResponse EPFrontend) Source # | |
type EndpointResponse EPFrontend Source # | |
Defined in CDP.Endpoints |
Instances
type family EndpointResponse ep :: * Source #
Instances
type EndpointResponse EPFrontend Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPCloseTarget Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPActivateTarget Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPOpenNewTab Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPCurrentProtocol Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPAllTargets Source # | |
Defined in CDP.Endpoints | |
type EndpointResponse EPBrowserVersion Source # | |
Defined in CDP.Endpoints |
data SomeEndpoint where Source #
SomeEndpoint :: Endpoint ep => ep -> SomeEndpoint |
data BrowserVersion Source #
BrowserVersion | |
|
Instances
Eq BrowserVersion Source # | |
Defined in CDP.Endpoints (==) :: BrowserVersion -> BrowserVersion -> Bool # (/=) :: BrowserVersion -> BrowserVersion -> Bool # | |
Show BrowserVersion Source # | |
Defined in CDP.Endpoints showsPrec :: Int -> BrowserVersion -> ShowS # show :: BrowserVersion -> String # showList :: [BrowserVersion] -> ShowS # | |
FromJSON BrowserVersion Source # | |
Defined in CDP.Endpoints parseJSON :: Value -> Parser BrowserVersion # parseJSONList :: Value -> Parser [BrowserVersion] # |
data TargetInfo Source #
TargetInfo | |
|
Instances
Show TargetInfo Source # | |
Defined in CDP.Endpoints showsPrec :: Int -> TargetInfo -> ShowS # show :: TargetInfo -> String # showList :: [TargetInfo] -> ShowS # | |
FromJSON TargetInfo Source # | |
Defined in CDP.Endpoints parseJSON :: Value -> Parser TargetInfo # parseJSONList :: Value -> Parser [TargetInfo] # |
fromSomeEndpoint :: (forall ep. Endpoint ep => ep -> r) -> SomeEndpoint -> r Source #
endpoint :: Endpoint ep => Config -> ep -> IO (EndpointResponse ep) Source #
Sends a request with the given parameters to the corresponding endpoint
connectToTab :: Config -> URL -> IO TargetInfo Source #
Creates a session with a new tab
Config | |
|
runClient :: forall b. Config -> ClientApp b -> IO b Source #
Runs a client application.
By default, the connection is made to the browser. See the path
field in Config
.
The connection is closed once the IO action completes
data Subscription Source #
subscribe :: forall a. Event a => Handle -> (a -> IO ()) -> IO Subscription Source #
Subscribes to an event
subscribeForSession :: forall a. Event a => Handle -> SessionId -> (a -> IO ()) -> IO Subscription Source #
Subscribes to an event for a given session
unsubscribe :: Handle -> Subscription -> IO () Source #
Unsubscribes to an event
class (ToJSON cmd, FromJSON (CommandResponse cmd)) => Command cmd where Source #
type CommandResponse cmd :: * Source #
commandName :: Proxy cmd -> String Source #
fromJSON :: Proxy cmd -> Value -> Result (CommandResponse cmd) Source #
Instances
data SomeCommand where Source #
SomeCommand :: Command cmd => cmd -> SomeCommand |
fromSomeCommand :: (forall cmd. Command cmd => cmd -> r) -> SomeCommand -> r Source #
readPromise :: Promise a -> IO a Source #
Resolves a promise to its value
sendCommand :: forall cmd. Command cmd => Handle -> cmd -> IO (Promise (CommandResponse cmd)) Source #
Sends a command to the browser
sendCommandForSession :: forall cmd. Command cmd => Handle -> SessionId -> cmd -> IO (Promise (CommandResponse cmd)) Source #
Sends a command to the browser for a given session
sendCommandWait :: Command cmd => Handle -> cmd -> IO (CommandResponse cmd) Source #
Sends a command to the browser and waits until a response is received, for the timeout duration configured
sendCommandForSessionWait :: Command cmd => Handle -> SessionId -> cmd -> IO (CommandResponse cmd) Source #
Sends a command to the browser for a given session and waits until a response is received, for the timeout duration configured
module CDP.Domains