Go back to top

vivaldi.runtimePrivate Modders API Reference

Use the vivaldi.runtimePrivate API to access.

Types

#FeatureFlagInfo

Object returned from the getAllFeatureFlags function.

Properties:

name
string

Name of this feature flag. This is the key used to look up the name.

friendlyName
string

This is the normalized name of this feature flag suitable to be showed to the user.

description
string

Description of this feature flag.

value
boolean

The current value for this flag (true or false).

locked
boolean

Locked from being changed. If true, it cannot be changed as it's locked from command line.

#UserProfile

Object returned from the getUserProfiles function.

Properties:

name
string

Name of this user profile. For a guest profile, this should be ignored and translated string used instead.

active
boolean

true if this is the active profile, otherwise false.

path
string

Path of this user profile. This is used when opening and deleting profiles as it's unique.

image
string

base64 encoded data url with the image to use for this profile. Empty for Guest profile.

imageIndex
integer

The index into our array of default images this user is using. Corrensponds to |UserProfileImage| index value. Not valid for guest profiles.

guest
boolean

true if this is the guest profile, otherwise false.

customAvatar
string

Link to a HTTP-loadble custom avatar, if available.

#UserProfileImage

Object returned from the |getUserProfileImages|.

Properties:

index
integer

Index of this user profile image in the table of available images.

name
string

Name of this user profile image.

image
string

base64 encoded data url with the image.

#ProfileStatEntry

Object returned from the |getProfileStatistics|.

Properties:

category
string

Category of the count, 'History', 'Passwords' etc..

count
integer

Number of data entries for this category.

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

#onProfilesUpdated

Fired when profiles have changed and the UI must be updated to reflect it.

Methods

#exit

Close all browsers and exit the application.

Parameters:

prompt
boolean

Show exit confirmation when true.

#restart

Close all browsers and restart the application.

#getAllFeatureFlags

Gets all the registered Vivaldi feature flags.

#setFeatureEnabled

Enables or disables a feature.

Parameters:

featureName
string

Name of the feature to enable or disable.

enable
boolean

true to enable feature.

#isGuestSession

Checks whether the current profile is running as a guest session or not.

#hasGuestSession

Checks whether any guest session is open.

#switchToGuestSession

Switch to a guest session.

#closeGuestSession

Close all guest session windows.

#openProfileSelectionWindow

Open window for profile management.

#getUserProfiles

Get all or just the active registered user profile(s).

Parameters:

activeOnly
(optional)
boolean

If true, only return the active profile.

#openNamedProfile

Open a new window using the given named profile.

Parameters:

profilePath
string

Path of the profile to open.

#closeActiveProfile

Close all windows for the active profile in this window.

#getUserProfileImages

Get all available user profiles images.

#updateActiveProfile

Updates the name and icon index for the active profile.

Parameters:

name
string

New name for the profile.

avatarIndex
integer

Index into the avatar table for the new avatar.

createDesktopIcon
(optional)
boolean

Create desktop icon if true, otherwise removes any created profile icon for this profile. Windows only.

#hasDesktopShortcut

Checks whether the active profile has a generated desktop shortcut. Windows only, other platforms will return false.

Parameters:

callback

⚠ NO DESCRIPTION PROVIDED

Parameters:

hasShortcut
boolean

true if the active profile has a desktop shortcut, otherwise false. Windows only, other platforms will always return false.

canModifyShortcut
boolean

true if the active profile allows for creating or modifying desktop shortcuts. Will be false if --user-data-dir is used and on non-Windows platforms.

#getProfileDefaults

Returns defaults for a new profile.

#createProfile

Creates a new profile with the given name and icon.

Parameters:

name
string

Name for the profile.

avatarIndex
integer

Index into the avatar table for the avatar for the new profile.

createDesktopIcon
boolean

Create desktop icon.

#getProfileStatistics

Returns statistics for the profile associated with the given profile path.

Parameters:

profilePath
string

Path of the profile, unique per profile.

#deleteProfile

Deletes a profile after closing all open windows for that profile.

Parameters:

profilePath
string

Path of the profile, unique per profile.