WebIO.JSString
— TypeJSString(str)
A wrapper around a string indicating the string contains javascript code.
Blink.js
— Functionjs(win, expr::JSString; callback=false)
Execute the javscript in expr
, inside win
.
If callback==true
, returns the result of evaluating expr
.
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
JSExpr.@js
— Macro@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
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.closetools
— MethodBlink.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.AtomShell.opentools
— MethodBlink.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.resolve_blink_asset
— Methodresolveblinkasset(path...)
Find a file, expressed as a relative path from the Blink package folder. Example:
resolveblinkasset("src", "Blink.jl") -> /home/<user>/.julia/v0.6/Blink/src/Blink.jl
Blink.AtomShell.shell
— Methodshell(; debug=false)
Get the currently active Electron
shell instance (or activate one if none exists yet).
NOTE: The debug
keyword argument only takes effect if there is not an active Electron
instance. If there is an active instance, this function returns that instance without regards to whether or not the debug
flag matches.
Blink.AtomShell.title
— Methodtitle(win::Window, title)
Set win
's title to title.
Blink.AtomShell.title
— Methodtitle(win::Window)
Get the window's title.
Blink.AtomShell.tools
— MethodBlink.active
— Functionactive(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