Skip to content

Commit

Permalink
Support BrowserContext
Browse files Browse the repository at this point in the history
Fixes #58.
  • Loading branch information
zploskey committed Jun 10, 2018
1 parent 68d1253 commit 18e2a94
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/js/src/BrowserContext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Browser.re
Expand Up @@ -2,8 +2,14 @@ type t = Types.browser;

external empty : unit => t = "%identity";

[@bs.send] external browserContexts : t => array(BrowserContext.t) = "";

[@bs.send] external close : t => Js.Promise.t(unit) = "";

[@bs.send]
external createIncognitoBrowserContext : t => Js.Promise.t(BrowserContext.t) =
"";

[@bs.send] external disconnect : t => unit = "";

[@bs.send] external newPage : t => Js.Promise.t(Page.t) = "";
Expand Down
11 changes: 11 additions & 0 deletions src/BrowserContext.re
@@ -0,0 +1,11 @@
type t;

[@bs.send] external browser : t => Types.browser = "";

[@bs.send] external close : t => Js.Promise.t(unit) = "";

[@bs.send] external isIncognito : t => bool = "";

[@bs.send] external newPage : t => Js.Promise.t(Page.t) = "";

[@bs.send] external targets : t => array(Types.target) = "";
2 changes: 1 addition & 1 deletion src/Target.re
Expand Up @@ -22,7 +22,7 @@ let pageTypeFromJs = targetTypeFromJs;

[@bs.send] external browser : t => Types.browser = "";

/* TODO: browserContext() */
[@bs.send] external browserContext : t => BrowserContext.t = "";

[@bs.send] external createCDPSession : t => Js.Promise.t(CDPSession.t) = "";

Expand Down

0 comments on commit 18e2a94

Please sign in to comment.