vivaldi.devtoolsPrivate Modders API Reference
Use the vivaldi.devtoolsPrivate
API to manage devtools.
Types
#DevtoolResizingStrategy
Object containing size and state for the inspected web contents. The devtools itself always uses the full size.
Properties:
- inspectedLeft
integer
Left coordinate of inspected web contents.
- inspectedTop
integer
Top coordinate of inspected web contents.
- inspectedWidth
integer
Width of inspected web contents.
- inspectedHeight
integer
Height of inspected web contents.
- hideInspectedContents
boolean
false to hide the inspected contents, otherwise true.
#DevtoolsWindowParams
Object containing size and state for the undocked devtools window.
Properties:
- left
integer
Left coordinate of window.
- top
integer
Top coordinate of window.
- right
integer
Right coordinate of window.
- bottom
integer
Bottom coordinate of window.
- maximized
boolean
Should window be maximized.
- alwaysOnTop
boolean
Should window be always on top.
#PanelType
ENUM
Whether to open the the element panel (inspect mode), console panel, or the default.
- console: Open devtool with the Console panel selected
- inspect: Open devtools with the Elements panel selected
- default: Open devtools with the default panel selected
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
#onDockingStateChanged
Fired when devtools changed its docking state.
Parameters:
- tabId
integer
The tab id of the tab changing its devtools docking state.
- dockingState
string
The new devtools docking state. Possible values are right, bottom or undocked.
#onDockingSizesChanged
Fired when devtools changed its sizes. Use |getDockingStateSizes| to read the new sizes.
Parameters:
- tabId
integer
The tab id of the tab changing its devtools docking state.
#onClosed
Fired when docked devtools closed.
Parameters:
- tabId
integer
The tab id of the tab changing its devtools docking state.
#onDevtoolsUndocked
Fired when devtools wants to undock and we might need to open a window for it.
Parameters:
- tabId
integer
The tab id of the tab we are debugging.
- showWindow
boolean
Show the initial window. May be false in which case the user likely just re-selected inspect on an existing web page.
- params
DevtoolsWindowParams
⚠ NO DESCRIPTION PROVIDED
#onActivateWindow
Fired when devtools wants to activate the given undocked devtools window.
Parameters:
- tabId
integer
The tab id of the tab we are debugging.
Methods
#getDockingStateSizes
Used to request the size and state of the inspected webview.
Parameters:
- tabId
integer
The tab id of the tab changing its devtools docking state.
#closeDevtools
Explicitly close the open devtools instance for the given tabId or windowId.
Parameters:
- tabId
integer
The tab id of the tab to close devtools for.
- windowId
- (optional)
integer
The window id (not app window id) of the window to close all open devtools for.
#toggleDevtools
Toggle developer tools.
Parameters:
- windowId
integer
The window id for the browserwindow we want to toggle devtools for.
- panelType
PanelType
⚠ NO DESCRIPTION PROVIDED