API

Window

Blink.AtomShell.WindowType
Window()
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

source
Blink.AtomShell.progressFunction
progress(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

source
Blink.AtomShell.flashframeFunction
flashframe(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

source
Blink.activeFunction
active(win::Window)::Bool
active(connection)::Bool

Indicates 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)
false
source

Misc

RPC

JSExpr.@jsMacro
@js win expr

Execute 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) end
source
Blink.@js_Macro
@js_ win expr

Execute 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) end
source
Blink.jsFunction
js(win, expr::JSString; callback=false)

Execute the javscript in expr, inside win.

If callback==true, returns the result of evaluating expr.

source
WebIO.JSStringType
JSString(str)

A wrapper around a string indicating the string contains javascript code.

source