Go back to top

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

    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.

    #onFullscreenMenubarChanged

    Fired when the main menu bar is show/hidden in fullscreen.

    Parameters:

    windowId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    shown
    boolean

    Main menubar is shown (true) or hidden (false).

    #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 string

    Parameters:

    windowId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    statusText
    string

    ⚠ NO DESCRIPTION PROVIDED

    #onWebContentsHasWindow

    Fired when the webcontents has a window object. chrome.windows.getviews find this now.

    Parameters:

    windowId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    Methods

    #create

    Create a window with additional Vivaldi specific properties.

    Parameters:

    url
    string

    Url to page to show as the full window UI of the new window.

    options
    CreateWindowOptions

    ⚠ NO DESCRIPTION PROVIDED

    type
    (optional)
    WindowType

    ⚠ NO DESCRIPTION PROVIDED

    #getCurrentId

    Returns the window id of the window we are currently running inside.

    #setState

    Sets the window state.

    Parameters:

    windowId
    integer

    The window id of the window to change the state for.

    state
    WindowState

    The state to set the window to.

    #updateMaximizeButtonPosition

    Notify C++ about the position of the maximize button to show extra native GUI like the split window menu in Windows 11.

    Parameters:

    windowId
    integer

    The window id of the window to update the coordinates of the maximize button.

    left
    number

    ⚠ NO DESCRIPTION PROVIDED

    top
    number

    ⚠ NO DESCRIPTION PROVIDED

    width
    number

    ⚠ NO DESCRIPTION PROVIDED

    height
    number

    ⚠ NO DESCRIPTION PROVIDED

    #getFocusedElementInfo

    Get information about currently focused element in Vivaldi window or any of its webviews.

    Parameters:

    windowId
    integer

    ⚠ NO DESCRIPTION PROVIDED

    #isOnScreenWithNotch

    Returns true if the screen the window is on has a notch.

    Parameters:

    windowId
    integer

    ⚠ NO DESCRIPTION PROVIDED