Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 0b5fef9

Browse files
maltheglennsl
authored andcommitted
Make the 'features' argument of Window.open_ optional (#166)
1 parent 627f2bd commit 0b5fef9

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Changed `Window.open_` to have optional `features` argument
12

23
### 0.15.5 - (2019-10-09)
34
* Added `keypress` event handler API

lib/js/tests/Webapi/Webapi__Dom/Webapi__Dom__Window__test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ window.moveTo(120, 300);
120120

121121
window.open("http://...", "my window", "menubar=yes");
122122

123+
window.open("http://...", "my window", undefined);
124+
123125
window.postMessage("my message", "*");
124126

125127
window.print();

src/Webapi/Webapi__Dom/Webapi__Dom__Window.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module Impl = (T: {type t;}) => {
7777
[@bs.send.pipe : t_window] external matchMedia : string => mediaQueryList = ""; /* experimental, CSSOM View module */
7878
[@bs.send.pipe : t_window] external moveBy : (int, int) => unit = ""; /* experimental, CSSOM View module */
7979
[@bs.send.pipe : t_window] external moveTo : (int, int) => unit = ""; /* experimental, CSSOM View module */
80-
[@bs.send.pipe : t_window] [@bs.return nullable] external open_ : (~url: string, ~name: string, ~features: string) => option(Dom.window) = "open"; /* yes, features is a stringly typed list of key value pairs, sigh */
80+
[@bs.send.pipe : t_window] [@bs.return nullable] external open_ : (~url: string, ~name: string, ~features: string=?) => option(Dom.window) = "open"; /* yes, features is a stringly typed list of key value pairs, sigh */
8181
[@bs.send.pipe : t_window] external postMessage : ('a, string) => unit = ""; /* experimental-ish?, Web Messaging */
8282
[@bs.send.pipe : t_window] external postMessageWithTransfers : ('a, string, array(transferable)) => unit = "postMessage"; /* experimental-ish?, Web Messaging */
8383
[@bs.send.pipe : t_window] external print : unit = "";

tests/Webapi/Webapi__Dom/Webapi__Dom__Window__test.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ let _ = Window.matchMedia("max-height: 400", window);
5959
let _ = Window.moveBy(10, (-10), window);
6060
let _ = Window.moveTo(120, 300, window);
6161
let _ = Window.open_(~url="http://...", ~name="my window", ~features="menubar=yes", window);
62+
let _ = Window.open_(~url="http://...", ~name="my window", window);
6263
Window.postMessage("my message", "*", window) /* Currently no way to make transferables */; /*Window.postMessageWithTransfers "my message" "*" transfers window;*/
6364
Window.print(window);
6465
let _ = Window.prompt("type you password, please?", window);

0 commit comments

Comments
 (0)