vivaldi.windowPrivate Modders API Reference
Use the vivaldi.windowPrivate API for vivaldi windows.
Types
#WindowState
ENUMThe state of this browser window.
- normal: Normal window state (i.e. not minimized, maximized, or fullscreen).
- minimized: Minimized window state.
- maximized: Maximized window state.
- fullscreen: Fullscreen window state.
#CreateWindowOptions
Object passed to the |create| function.
Properties:
- bounds
- (optional)
object
⚠ NO DESCRIPTION PROVIDED
Object Properties:
- left
- (optional)
integer
⚠ NO DESCRIPTION PROVIDED
- top
- (optional)
integer
⚠ NO DESCRIPTION PROVIDED
- width
integer
⚠ NO DESCRIPTION PROVIDED
- height
integer
⚠ NO DESCRIPTION PROVIDED
- minWidth
- (optional)
integer
⚠ NO DESCRIPTION PROVIDED
- minHeight
- (optional)
integer
⚠ NO DESCRIPTION PROVIDED
- windowDecoration
- (optional)
boolean
Enable window decoration. Defaults to false.
- incognito
- (optional)
boolean
Incogito window. Default is false.
- focused
- (optional)
boolean
If true, opens a active window. Default is true.
- state
- (optional)
WindowState
The state to set the window to. Default is normal window state (i.e. not minimized, maximized, or fullscreen).
- tabUrl
- (optional)
string
The url to be added as a new tab, this will be added to the tab model. Not used for settings, popups, etc.
- vivExtData
- (optional)
string
Extra data to attach to the window.
- windowKey
- (optional)
string
Id to identify the window. If a window with a given id is created while another window with the same id already exists, the currently opened window will be focused instead of creating a new window.
#WindowType
ENUMThe type of this browser window.
- normal: This is a normal browser window.
- settings: This is a settings window.
- popup: This is a popup window.
- mail-composer: This is a mail composer window
- devtools: This is a devtools window.
#MouseEdgeType
ENUMRelative position of mouse to this window.
- left: ⚠ NO DESCRIPTION PROVIDED
- right: ⚠ NO DESCRIPTION PROVIDED
- top: ⚠ NO DESCRIPTION PROVIDED
- bottom: ⚠ NO DESCRIPTION PROVIDED
#FocusedElementInfo
Information about the HTML element having focus.
Properties:
- tagName
string
Element tag name
- type
string
Element type
- editable
boolean
True if element is editable.
- role
string
Element role
#ControlButtonsPosition
ENUMThe control buttons position. (used only on macOS for 'traffic lights')
- hidden: ⚠ NO DESCRIPTION PROVIDED
- native: ⚠ NO DESCRIPTION PROVIDED
- lightPadding: ⚠ NO DESCRIPTION PROVIDED
- mediumPadding: ⚠ NO DESCRIPTION PROVIDED
- heavyPadding: ⚠ NO DESCRIPTION PROVIDED
- autohideHeavyPadding: ⚠ NO DESCRIPTION PROVIDED
#ToastParameters
Parameters used to create a toast notification, typically showed as an overlay above the browser window.
Properties:
- body
string
Message to present.
- action
- (optional)
string
If an action button is needed, this is the buttone text.
- image
string
Image to show as base64 encoded.
#EdgeMouseParameters
Event member for mouse vincinity events.
Properties:
- mousePosition
MouseEdgeType
⚠ NO DESCRIPTION PROVIDED
#HotSpotStatus
ENUMStatus for hot spot set via windowPrivate.setHotSpot.
- away: ⚠ NO DESCRIPTION PROVIDED
- above: ⚠ NO DESCRIPTION PROVIDED
#HotSpotLocation
ENUMPosition in window used to calculate a rect based on width and height.
- left
- right
- top
- bottom
Listeners
How to use listeners
Each listener type has the same functions, used for each listener API in the same way:
.addListener(function callback)
Adds a function to a listener for an event
.removeListener(function callback)
Removes a function to a listener for an event
.hasListener(function callback)
Returns a boolean if a function is attached to a listener for an event
.hasListeners()
Returns a boolean if a listener has any attached functions
.dispatch()
Returns array of promises dispatched to the listener
#onWindowDidChangeScreens
Fired when the window has changed screens include a parameter that says whether the new screen has a notch.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
- hasNotch
boolean
Screen has a notch (true) or without notch (false).
#onStateChanged
Fired when the window state changes (minimize/maximize/fullscreen).
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
- state
WindowState
The new state set to the window.
#onPositionChanged
Fired when the window changes position.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
#onActivated
Fired when the window changes activation.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
- activated
boolean
Changed activation state.
#onBeforeUnloadDialogOpened
Fired when a beforeunload dialog is shown for a tab.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
- tabId
integer
⚠ NO DESCRIPTION PROVIDED
#onWindowClosed
Fired when a window is closed, even for guest windows.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
#onPageInfoPopupChanged
Fired when a page information popup visibility changes.
Parameters:
- windowId
integer
⚠ NO DESCRIPTION PROVIDED
- visible
boolean
⚠ NO DESCRIPTION PROVIDED
#onActiveTabStatusText
Fired when the active tab has new loadstate text. Will reset to Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Fired when the webcontents has a window object. chrome.windows.getviews find this now. Parameters: ⚠ NO DESCRIPTION PROVIDED Fired when the browser should show a toast message. Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Fires when the mousecursor is close to the window edge. Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Fires when the mousecursor is over specified rect in |setHotSpot|. Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Fired when the macOS menu bar is shown/hidden in fullscreen. Parameters: ⚠ NO DESCRIPTION PROVIDED MacOS menubar is visible or not. Create a window with additional Vivaldi specific properties. Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Returns the window id of the window we are currently running inside. Sets the window state. Parameters: The window id of the window to change the state for. The state to set the window to. Notify C++ about the position of the maximize button to show extra native GUI like the split window menu in Windows 11. Parameters: The window id of the window to update the coordinates of the maximize button. ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Get information about currently focused element in Vivaldi window or any of its webviews. Parameters: ⚠ NO DESCRIPTION PROVIDED Returns true if the screen the window is on has a notch. Parameters: ⚠ NO DESCRIPTION PROVIDED Request a new control buttons position. Parameters: ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED Performs a haptic feedback. Update or set the hot-spot that will be used to compare current mouseposition and report in event onMouseInHotSpot. Parameters: Used to identify target window. ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDED ⚠ NO DESCRIPTION PROVIDEDinteger
string
#onWebContentsHasWindow
integer
#onToastMessage
integer
ToastParameters
#onMouseCloseToEdge
integer
EdgeMouseParameters
#onMouseInHotSpot
integer
HotSpotStatus
#onFullscreenMenubarVisibilityChanged
integer
boolean
Methods
#create
CreateWindowOptions
WindowType
#getCurrentId
#setState
integer
WindowState
#updateMaximizeButtonPosition
integer
number
number
number
number
#getFocusedElementInfo
integer
#isOnScreenWithNotch
integer
#setControlButtonsPosition
integer
ControlButtonsPosition
#performHapticFeedback
#setHotSpot
integer
HotSpotLocation
number
number