new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · API · all subjects

webcontents: macos specific

27 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

win.getRepresentedFilename() - macOS only

Returns a string containing the pathname of the file the window represents.

win.tabbingIdentifier property (macOS)

A read-only string property (optional) that is equal to the tabbingIdentifier passed to the BrowserWindow constructor, or undefined if none was set.

win.representedFilename property (macOS)

A string property that determines the pathname of the file the window represents. The icon of the file will show in the window's title bar.

win.excludedFromShownWindowsMenu property (macOS)

A boolean property that determines whether the window is excluded from the application's Windows menu. Defaults to false.

win.setSimpleFullScreen(flag) method (macOS)

Enters or leaves simple fullscreen mode. Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).

win.isSimpleFullScreen() method (macOS)

Returns boolean - whether the window is in simple (pre-Lion) fullscreen mode.

win.isHiddenInMissionControl() - macOS only

Returns a boolean indicating whether the window will be hidden when the user toggles into mission control.

win.setSheetOffset(offsetY[, offsetX]) - macOS only

Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. offsetY is a required Float parameter, and offsetX is an optional Float parameter.

win.setSheetOffset() example - macOS

const { BrowserWindow } = require('electron') const win = new BrowserWindow() const toolbarRect = document.getElementById('toolbar').getBoundingClientRect() win.setSheetOffset(toolbarRect.height)

win.setRepresentedFilename(filename) - macOS only

Sets the pathname of the file the window represents, and the icon of the file will show in the window's title bar. Takes a string parameter for the filename.

win.setDocumentEdited(edited) - macOS only

Specifies whether the window's document has been edited. When set to true, the icon in the title bar will become gray. Takes a boolean parameter.

win.isDocumentEdited() - macOS only

Returns a boolean indicating whether the window's document has been edited.

win.invalidateShadow() - macOS only

Invalidates the window shadow so that it is recomputed based on the current window shape. BrowserWindows that are transparent can sometimes leave behind visual artifacts on macOS. This method can be used to clear these artifacts when, for example, performing an animation.

win.showDefinitionForSelection() - macOS only

Shows a definition for the selected text. Same as webContents.showDefinitionForSelection().

win.setWindowButtonVisibility(visible) - macOS only

Sets whether the window traffic light buttons (close, minimize, maximize) should be visible. Takes a boolean parameter.

win.setAutoHideCursor(autoHide) - macOS only

Controls whether to hide cursor when typing. Takes a boolean parameter.

win.selectPreviousTab() - macOS only

Selects the previous tab when native tabs are enabled and there are other tabs in the window.

win.selectNextTab() - macOS only

Selects the next tab when native tabs are enabled and there are other tabs in the window.

win.showAllTabs() - macOS only

Shows or hides the tab overview when native tabs are enabled.

win.mergeAllWindows() - macOS only

Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.

win.moveTabToNewWindow() - macOS only

Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.

win.toggleTabBar() - macOS only

Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.

win.addTabbedWindow(browserWindow) - macOS only

Adds a window as a tab on this window, after the tab for the window instance. The browserWindow parameter is a BrowserWindow.

win.setVibrancy(type[, options]) - macOS only

Adds a vibrancy effect to the browser window. The type parameter is a string or null and can be: 'titlebar', 'selection', 'menu', 'popover', 'sidebar', 'header', 'sheet', 'window', 'hud', 'fullscreen-ui', 'tooltip', 'content', 'under-window', or 'under-page'. Passing null or an empty string will remove the vibrancy effect on the window. The options parameter is optional and an Object with animationDuration (number, optional, if greater than zero, the change to vibrancy will be animated over the given duration in milliseconds). The animationDuration parameter only animates fading in or fading out the vibrancy effect. Animating between different types of vibrancy is not supported.

win.setWindowButtonPosition(position) - macOS only

Sets a custom position for the traffic light buttons in frameless window. The position parameter is a Point or null. Passing null will reset the position to default.

win.getWindowButtonPosition() - macOS only

Returns a Point or null representing the custom position for the traffic light buttons in frameless window. null will be returned when there is no custom position.

win.setTouchBar(touchBar) - macOS only

Sets the touchBar layout for the current window. The touchBar parameter is a TouchBar or null. Specifying null or undefined clears the touch bar. This method only has an effect if the machine has a touch bar. Note that the TouchBar API is currently experimental and may change or be removed in future Electron releases.

Give your agent this brain