diff --git a/README.md b/README.md index 81a41c4..ac5f3a9 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ You can pass an optional options object into the `menubar({ ... })` function: - `tooltip` (default empty) - menubar tray icon tooltip text - `tray` (default created on-the-fly) - an electron `Tray` instance. if provided `opts.icon` will be ignored - `preloadWindow` (default false) - Create [BrowserWindow](https://electronjs.org/docs/api/browser-window#new-browserwindowoptions) instance before it is used -- increasing resource usage, but making the click on the menubar load faster. +- `loadUrlOptions` - (default undefined) The options passed when loading the index URL in the menubar's browserWindow. Everything browserWindow.loadURL supports is supported; this object is simply passed onto [browserWindow.loadURL](https://electronjs.org/docs/api/browser-window#winloadurlurl-options) - `showOnAllWorkspaces` (default true) - Makes the window available on all OS X workspaces. - `windowPosition` (default trayCenter and trayBottomCenter on Windows) - Sets the window position (x and y will still override this), check [positioner docs](https://github.com/jenslind/electron-positioner#docs) for valid values. - `showDockIcon` (default false) - Configure the visibility of the application dock icon. @@ -128,7 +129,7 @@ See the reference [API docs](./docs/globals.md). ## Tips -- Use `mb.on('after-create-window', callback)` to run things after your app has loaded. For example you could run `mb.window.openDevTools()` to open the developer tools for debugging, or load a different URL with `mb.window.loadUrl()` +- Use `mb.on('after-create-window', callback)` to run things after your app has loaded. For example you could run `mb.window.openDevTools()` to open the developer tools for debugging, or load a different URL with `mb.window.loadURL()` - Use `mb.on('focus-lost')` if you would like to perform some operation when using the option `browserWindow.alwaysOnTop: true` - To restore focus of previous window after menubar hide, use `mb.on('after-hide', () => { mb.app.hide() } )` or similar - To create a native menu, you can use `tray.setContextMenu(contextMenu)`, and pass this custom tray to menubar: `const mb = menubar({ tray });`. See [this example](https://github.com/maxogden/menubar/tree/master/examples/native-menu) for more information. diff --git a/src/types.ts b/src/types.ts index 74dc3cd..a861a5d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -35,7 +35,7 @@ export interface Options { /** * The URL to load the menubar's browserWindow with. The url can be a remote * address (e.g. `http://`) or a path to a local HTML file using the - * `file://` protocol. If false, then menubar won't call `loadUrl` on + * `file://` protocol. If false, then menubar won't call `loadURL` on * start. * @default `file:// + options.dir + index.html` * @see https://electronjs.org/docs/api/browser-window#winloadurlurl-options @@ -43,8 +43,8 @@ export interface Options { index: string | false; /** * The options passed when loading the index URL in the menubar's - * browserWindow. Everything browserWindow.loadUrl supports is supported; - * this object is simply passed onto browserWindow.loadUrl + * browserWindow. Everything browserWindow.loadURL supports is supported; + * this object is simply passed onto browserWindow.loadURL * @default `{}` * @see https://electronjs.org/docs/api/browser-window#winloadurlurl-options */