vivaldi.windowPrivate Modders API Reference
Use the vivaldi.windowPrivate
API for vivaldi windows.
Types
#WindowState
ENUM
The 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
ENUM
The type of this browser window.
- normal: This is a normal browser window.
- settings: This is a settings window.
- popup: This is a popup window.
- devtools: This is a devtools window.
#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
#ControlButtonsPadding
ENUM
The padding type used for drawing control buttons (macOS only)
- native: ⚠ NO DESCRIPTION PROVIDED
- lightPadding: ⚠ NO DESCRIPTION PROVIDED
- mediumPadding: ⚠ NO DESCRIPTION PROVIDED
- heavyPadding: ⚠ NO DESCRIPTION PROVIDED
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 Create a window with additional Vivaldi specific properties. Parameters: Url to page to show as the full window UI of the new window. ⚠ 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.integer
string
#onWebContentsHasWindow
integer
Methods
#create
string
CreateWindowOptions
WindowType
#getCurrentId
#setState
integer
WindowState
#updateMaximizeButtonPosition
integer
number
number
number
number
#getFocusedElementInfo
integer
#isOnScreenWithNotch
integer
#setControlButtonsPadding
integer
ControlButtonsPadding
#performHapticFeedback