diff --git a/src/Web/HTML/HTMLDocument.js b/src/Web/HTML/HTMLDocument.js index 753f0d0..6f28e1e 100644 --- a/src/Web/HTML/HTMLDocument.js +++ b/src/Web/HTML/HTMLDocument.js @@ -17,3 +17,9 @@ exports._activeElement = function (doc) { return doc.activeElement; }; }; + +exports._currentScript = function (doc) { + return function () { + return doc.currentScript; + }; +}; diff --git a/src/Web/HTML/HTMLDocument.purs b/src/Web/HTML/HTMLDocument.purs index 44d2720..79cacde 100644 --- a/src/Web/HTML/HTMLDocument.purs +++ b/src/Web/HTML/HTMLDocument.purs @@ -29,6 +29,7 @@ import Web.Event.EventTarget (EventTarget) import Web.HTML.HTMLDocument.ReadyState (ReadyState) import Web.HTML.HTMLDocument.ReadyState as ReadyState import Web.HTML.HTMLElement (HTMLElement) +import Web.HTML.HTMLScriptElement (HTMLScriptElement) import Web.Internal.FFI (unsafeReadProtoTagged) foreign import data HTMLDocument :: Type @@ -77,3 +78,8 @@ foreign import _activeElement :: HTMLDocument -> Effect (Nullable HTMLElement) activeElement :: HTMLDocument -> Effect (Maybe HTMLElement) activeElement = map toMaybe <<< _activeElement + +foreign import _currentScript :: HTMLDocument -> Effect (Nullable HTMLScriptElement) + +currentScript :: HTMLDocument -> Effect (Maybe HTMLScriptElement) +currentScript = map toMaybe <<< _currentScript