Skip to content

Commit

Permalink
Improve API for getting current window
Browse files Browse the repository at this point in the history
  • Loading branch information
fxfactorial committed Nov 3, 2015
1 parent 4344e94 commit edc3a19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/electron_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ module Browser_window = struct

end

class browser_window ?(remote=false) ?opts ?existing = object
class browser_window ?(remote=false) ?opts existing = object

val raw_js =
let result = match opts with
Expand Down
8 changes: 3 additions & 5 deletions src/electron_renderer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ module Remote = struct
val raw_js = require_module "remote"

method browser_window (o : b_opts) =
new B.browser_window ~remote:true ~existing:None ~opts:o
new B.browser_window ~remote:true ~opts:o None

method get_current_window =
new B.browser_window
~remote:false
~existing:(m raw_js "getCurrentWindow" [||])
?opts:None
(Some (m raw_js "getCurrentWindow" [||]))
|> new B.browser_window ~remote:false ?opts:None

(* method get_current_web_contents *)

Expand Down

0 comments on commit edc3a19

Please sign in to comment.