vivaldi.directMatch Modders API Reference
Use the vivaldi.directMatch
API to call direct match service functions..
Types
#Item
A Direct match item
Properties:
- name
string
⚠ NO DESCRIPTION PROVIDED
- title
string
⚠ NO DESCRIPTION PROVIDED
- image_url
string
⚠ NO DESCRIPTION PROVIDED
- image_path
string
⚠ NO DESCRIPTION PROVIDED
- category
number
⚠ NO DESCRIPTION PROVIDED
- display_location_address_bar
boolean
⚠ NO DESCRIPTION PROVIDED
- display_location_sd_dialog
boolean
⚠ NO DESCRIPTION PROVIDED
- redirect_url
string
⚠ NO DESCRIPTION PROVIDED
- allowed_to_be_default_match
boolean
⚠ NO DESCRIPTION PROVIDED
#Items
- Items
A Direct match items array
Array
of:- Item
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
#onPopularSitesReady
Fires when data has become available in backend.
Methods
#hide
Hides direct match so it will not show up in omnibox.
Parameters:
- url
string
The url of a direct match provider to hide.
#getPopularSites
Fetch popular sites from DM units sorted asc by `position` where sd_dialog=true
#getForCategory
Returns direct match items for provided `category_id` sorted asc by `position` and filtered by `display_locations`
Parameters:
- categoryId
number
⚠ NO DESCRIPTION PROVIDED
#resetHidden
Reset all previously hidden direct match providers.