Skip to content

Commit ec28897

Browse files
committed
add evaljs and alias of shown
1 parent 5175804 commit ec28897

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

webui.nim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,11 +778,23 @@ proc shown*(win: Window): bool =
778778

779779
bindings.isShown(win.impl)
780780

781+
proc showed*(win: Window): bool =
782+
## Synonym of [shown](#shown,Window)
783+
784+
bindings.isShown(win.impl)
785+
781786
proc script*(win: Window; script: var Script) =
782787
## Run Script `script`
783788

784789
bindings.script(win.impl, addr script.internalImpl)
785790

791+
proc evalJS*(win: Window; script: string; timeout: int = 0): JavascriptResult =
792+
## Evaluate Javascript code `script` and return the result
793+
794+
var js = newScript(script, timeout)
795+
796+
win.script(js)
797+
786798
# * for use With `bindInterface`. We use `bind` instead, so no need for it now.
787799
#proc interfaceHandler(elementId, windowId: cuint; elementName: cstring; window: ptr bindings.Window; data: cstring; response: cstringArray) {.cdecl.} =
788800
# var event: bindings.Event

0 commit comments

Comments
 (0)