API
Window
Blink.AtomShell.Window — TypeWindow()
Window(electron_options::Dict; async=true)Create and open a new Window through Electron.
If async==false, this function blocks until the Window is fully initialized and ready for you to communicate with it via javascript or the Blink API.
The electron_options dict is used to initialize the Electron window. See here for the full set of Electron options: https://electronjs.org/docs/api/browser-window#new-browserwindowoptions
Blink.AtomShell.title — Functiontitle(win::Window, title)Set win's title to title.
title(win::Window)Get the window's title.
Blink.AtomShell.progress — Functionprogress(win::Window, p=-1)Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1.
https://github.com/electron/electron/blob/master/docs/api/browser-window.md#winsetprogressbarprogress-options
Blink.AtomShell.flashframe — Functionflashframe(win::Window, on=true)Start or stop "flashing" the window to get the user's attention.
In Windows, flashes the window frame. In MacOS, bounces the app in the Dock. https://github.com/electron/electron/blob/master/docs/api/browser-window.md#winflashframeflag
Blink.active — Functionactive(win::Window)::Bool
active(connection)::BoolIndicates whether the specified Window (or Page, shell, or other internal component) is currently "active," meaning it has an open connection to its Electron component.
julia> w = Window();
julia> active(w)
true
julia> close(w)
julia> active(w)
falseMisc
Blink.AtomShell.opentools — FunctionBlink.AtomShell.closetools — FunctionBlink.AtomShell.tools — FunctionRPC
JSExpr.@js — Macro@js win exprExecute expr, converted to javascript, inside win, and return the result.
expr will be parsed as julia code, and then converted directly to the equivalent javascript. Language keywords that don't exist in julia can be represented with their macro equivalents, @var, @new, etc.
See also: @js_, the asynchronous version.
Examples
julia> @js win x = 5
5
julia> @js_ win for i in 1:x console.log(i) endBlink.@js_ — Macro@js_ win exprExecute expr, converted to javascript, asynchronously inside win, and return immediately.
expr will be parsed as julia code, and then converted directly to the equivalent javascript. Language keywords that don't exist in julia can be represented with their macro equivalents, @var, @new, etc.
See also: @js, the synchronous version that returns its result.
Examples
julia> @js win x = 5
5
julia> @js_ win for i in 1:x console.log(i) endBlink.js — Functionjs(win, expr::JSString; callback=false)Execute the javscript in expr, inside win.
If callback==true, returns the result of evaluating expr.
WebIO.JSString — TypeJSString(str)A wrapper around a string indicating the string contains javascript code.