Header menu logo issie

Main Module

Functions and values

Function or value Description

addListeners window

Full Usage: addListeners window

Parameters:
Returns: BrowserWindow
window : BrowserWindow
Returns: BrowserWindow

appStarted

Full Usage: appStarted

Returns: bool

Set once the app's own start-up has been let go. Three things race to do that - the splash painting, the splash failing to load, and a backstop timer - and exactly one must win. This is process lifecycle rather than model state, which is what makes a mutable right here (see docs/mutableState.md).

Returns: bool

argFlagIsOn flags

Full Usage: argFlagIsOn flags

Parameters:
    flags : string list

Returns: bool

Returns true if any of flags are present as command line argument.

flags : string list
Returns: bool

args

Full Usage: args

Returns: string list
Returns: string list

closeAfterSave

Full Usage: closeAfterSave

Returns: bool
Returns: bool

createMainWindow ()

Full Usage: createMainWindow ()

Parameters:
    () : unit

Returns: BrowserWindow
() : unit
Returns: BrowserWindow

createSplashWindow onPainted

Full Usage: createSplashWindow onPainted

Parameters:
    onPainted : unit -> unit

Issie's renderer takes a noticeable time to start, and until it does the app window has nothing in it. This frameless window covers that gap: it is the first thing on screen, and the main window stays hidden behind it until its content has finished loading. It stays hidden until it has painted. Chromium fills a new window with white until its web contents produce a frame - backgroundColor does not change that - and a renderer process takes long enough to spawn that showing the window on creation put a white rectangle on screen for most of the start. onPainted then runs, and is where the app's own load is started from.

onPainted : unit -> unit

debug

Full Usage: debug

Returns: bool
Returns: bool

devServerUrl

Full Usage: devServerUrl

Returns: string

URL of the webpack dev server used in development mode. Must match renderSrvOpts {port:} in scripts/start.js

Returns: string

dispatchToRenderer (arg1, arg2)

Full Usage: dispatchToRenderer (arg1, arg2)

Parameters:
    arg0 : string
    arg1 : string

arg0 : string
arg1 : string

hardenWebContents webContents

Full Usage: hardenWebContents webContents

Parameters:

The renderer runs with nodeIntegration enabled, so any page loaded into it gets full Node access. Refuse to navigate the app window away from Issie's own content, and refuse to open popup windows at all: external links are handed to the OS browser, which has no such privileges.

webContents : WebContents

hasDebugArgs ()

Full Usage: hasDebugArgs ()

Parameters:
    () : unit

Returns: bool
() : unit
Returns: bool

isAppUrl url

Full Usage: isAppUrl url

Parameters:
    url : string

Returns: bool

True only for Issie's own content: the dev server in development, the packaged bundle otherwise. Everything else counts as external.

url : string
Returns: bool

isMacos

Full Usage: isMacos

Returns: bool
Returns: bool

isWin

Full Usage: isWin

Returns: bool
Returns: bool

jsFlags

Full Usage: jsFlags

Returns: string
Returns: string

loadAppIntoWidowWhenReady window

Full Usage: loadAppIntoWidowWhenReady window

Parameters:
window : BrowserWindow

mainWindow

Full Usage: mainWindow

Returns: BrowserWindow option
Returns: BrowserWindow option

openExternally url

Full Usage: openExternally url

Parameters:
    url : string

Open a link in the user's default browser. Restricted to http(s) so a link cannot be used to invoke an arbitrary OS protocol handler.

url : string

printListeners ()

Full Usage: printListeners ()

Parameters:
    () : unit

() : unit

processUptime ()

Full Usage: processUptime ()

Parameters:
    () : unit

Returns: float

Seconds since this process was launched. Startup has to be measured from here and not from the first line of this module: everything before that is Electron booting, and it is a phase like any other.

() : unit
Returns: float

revealMainWindow window

Full Usage: revealMainWindow window

Parameters:

Take the splash down and put the app window on screen. Called when the renderer finishes loading and again from a timeout, so a renderer that never loads cannot leave Issie with no visible window at all - which means this must be safe to call more than once.

window : BrowserWindow

splashPagePath ()

Full Usage: splashPagePath ()

Parameters:
    () : unit

Returns: string

Where splash.html lives. __static is a compile-time substitution, and the production one expands to a template literal over a bare `path` identifier that webpack's bundle does not bind - so reading it unconditionally throws before any window exists. Every other consumer (the icon below, FilesIO) branches around it for exactly this reason.

() : unit
Returns: string

splashWindow

Full Usage: splashWindow

Returns: BrowserWindow option

Splash shown while the renderer loads. Held here for the same reason as mainWindow.

Returns: BrowserWindow option

stampStartup phase

Full Usage: stampStartup phase

Parameters:
    phase : string

Stamp a startup phase on stdout. The only useful question about a slow start is which phase costs the seconds - Electron's boot, the splash's first paint, or the renderer's bundle - and that is unanswerable unless each one says when it happened.

phase : string

startRenderer doAfterReady

Full Usage: startRenderer doAfterReady

Parameters:
doAfterReady : BrowserWindow -> Unit

startup ()

Full Usage: startup ()

Parameters:
    () : unit

() : unit

staticDir ()

Full Usage: staticDir ()

Parameters:
    () : unit

Returns: string
() : unit
Returns: string

wait n cont

Full Usage: wait n cont

Parameters:
    n : int
    cont : unit -> unit

n : int
cont : unit -> unit

Type something to start searching.