Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 9621415

Browse files
authored
Merge pull request #135 from beckyconning/contentWindow
HTMLIFrameElement.contentWindow
2 parents c7669b6 + ac1fd9e commit 9621415

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/DOM/HTML/HTMLIFrameElement.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,9 @@ exports._contentDocument = function (iframe) {
8585
return iframe.contentDocument;
8686
};
8787
};
88+
89+
exports._contentWindow = function (iframe) {
90+
return function () {
91+
return iframe.contentWindow;
92+
};
93+
};

src/DOM/HTML/HTMLIFrameElement.purs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module DOM.HTML.HTMLIFrameElement
1010
, height
1111
, setHeight
1212
, contentDocument
13+
, contentWindow
1314
) where
1415

1516
import Prelude
@@ -20,7 +21,7 @@ import Data.Maybe (Maybe)
2021
import Data.Nullable (Nullable, toMaybe)
2122

2223
import DOM (DOM)
23-
import DOM.HTML.Types (HTMLIFrameElement)
24+
import DOM.HTML.Types (Window, HTMLIFrameElement)
2425
import DOM.Node.Types (Document)
2526

2627
foreign import src :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff) String
@@ -41,8 +42,10 @@ foreign import height :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff)
4142
foreign import setHeight :: forall eff. String -> HTMLIFrameElement -> Eff (dom :: DOM | eff) Unit
4243

4344
foreign import _contentDocument :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff) (Nullable Document)
45+
foreign import _contentWindow :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff) (Nullable Window)
4446

4547
contentDocument :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff) (Maybe Document)
4648
contentDocument = map toMaybe <<< _contentDocument
4749

48-
-- readonly attribute WindowProxy? contentWindow;
50+
contentWindow :: forall eff. HTMLIFrameElement -> Eff (dom :: DOM | eff) (Maybe Window)
51+
contentWindow = map toMaybe <<< _contentWindow

0 commit comments

Comments
 (0)