Go back to top

vivaldi.historyPrivate Modders API Reference

Use the vivaldi.historyPrivate API to interact with the browser's record of visited pages. You can query for URLs and visits in the browser's history. To override the history page with your own version, see Override Pages.

Types

#HistoryResultSetGrouping

ENUM

Handling of History search results. See: DuplicateHandling enum in history_types.h

  • remove_all_duplicates
  • remove_duplicates_per_day
  • keep_all_duplicates
  • #TransitionType

    ENUM

    The transition type for this visit from its referrer.

  • link
  • typed
  • auto_bookmark
  • auto_subframe
  • manual_subframe
  • generated
  • auto_toplevel
  • form_submit
  • reload
  • keyword
  • keyword_generated
  • #SourceType

    ENUM

    The transition type for this visit from its referrer as defined in browser/history_types.h.

  • synced
  • browsed
  • extension
  • firefox_imported
  • ie_imported
  • safari_imported
  • chromium_imported
  • #TypedHistoryItem

    An object containing informations of one typed history entry

    Properties:

    url
    string

    The URL navigated to by a user.

    title
    string

    The title of the page when it was last loaded.

    keywordId
    string

    The database identifier of the used keyword for a search or -1 if this wasn't a search.

    terms
    string

    If keyWordID is not -1, the terms that the user searched for.

    typedCount
    integer

    The number of times the user has navigated to this page by typing in the address.

    #DetailedHistoryItem

    An object encapsulating one result of a top url history query.

    Properties:

    id
    string

    The unique identifier for the item.

    url
    string

    The URL navigated to by a user.

    title
    string

    The title of the page when it was last loaded.

    lastVisitTime
    (optional)
    number

    When this page was last loaded, represented in milliseconds since the epoch.

    visitCount
    integer

    The number of times the user has navigated to this page.

    typedCount
    (optional)
    integer

    The number of times the user has navigated to this page by typing in the address.

    isBookmarked
    boolean

    States if the URL is bookmarked.

    transitionType
    TransitionType

    The transition type for this visit from its referrer.

    isRedirect
    boolean

    The link is in a redirection chain. First and last redirection links are not considered as redirect.

    #HistoryPrivateItem

    An object encapsulating one result of a history query.

    Properties:

    id
    string

    The unique identifier for the item.

    url
    string

    The URL navigated to by a user.

    protocol
    string

    The protocol of the page navigated to by a user.

    address
    string

    The address of the page navigated to by a user.

    title
    string

    The title of the page when it was last loaded.

    lastVisitTime
    (optional)
    number

    When this page was last loaded, represented in milliseconds since the epoch.

    visitTime
    number

    When this page was visited, represented in milliseconds since the epoch.

    visitCount
    integer

    The number of times the user has navigated to this page.

    typedCount
    (optional)
    integer

    The number of times the user has navigated to this page by typing in the address.

    isBookmarked
    boolean

    States if the URL is bookmarked.

    transition_type
    TransitionType

    The transition type for this visit from its referrer.

    dateKey
    string

    Date string of the visit. Format: YYYY-MM-DD

    hour
    integer

    Hour of day when this url was visited.

    source
    (optional)
    SourceType

    The origin of the link

    #TopUrlItem

    An object encapsulating one result of a top url history query.

    Properties:

    date
    string

    The date of the visit for the top url

    url
    string

    The url visited

    numberOfVisit
    (optional)
    integer

    The visit count of the url.

    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

    #onVisitModified

    Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history.

    Parameters:

    modified
    object

    ⚠ NO DESCRIPTION PROVIDED

    Object Properties:

    urls
    (optional)

    ⚠ NO DESCRIPTION PROVIDED

    Array of:

    • string

    Methods

    Searches the history for the last visit time of each page matching the query.

    Parameters:

    query
    object

    ⚠ NO DESCRIPTION PROVIDED

    Object Properties:

    text
    string

    A free-text query to the history service. Leave empty to retrieve all pages.

    startTime
    (optional)
    number

    Limit results to those visited after this date, represented in milliseconds since the epoch. If not specified, this defaults to 24 hours in the past.

    endTime
    (optional)
    number

    Limit results to those visited before this date, represented in milliseconds since the epoch.

    maxResults
    (optional)
    integer

    The maximum number of results to retrieve. Defaults to 100.

    resultGrouping
    (optional)
    HistoryResultSetGrouping

    The way the result set should be grouped.

    #deleteVisits

    Deletes all visits of the given URL for a certain period.

    Parameters:

    details
    object

    ⚠ NO DESCRIPTION PROVIDED

    Object Properties:

    url
    string

    The URL to remove.

    time
    number

    The visit time of the item to remove, represented in milliseconds since the epoch. IMPORTANT: This must be the exact visit time, to the microsecond. If it is truncated, then the deletion will not be synced.

    #getTopUrlsPerDay

    Retrives top url per day. Sorted by number of visits within the day

    Parameters:

    maxTopUrlResults
    number

    The number of top urls to return per day.

    #visitSearch

    Retrives all visits. Sorted by visit time descending.

    Parameters:

    query
    object

    ⚠ NO DESCRIPTION PROVIDED

    Object Properties:

    startTime
    (optional)
    number

    Limit results to those visited after this date, represented in milliseconds since the epoch. If not specified, this defaults to 24 hours in the past.

    endTime
    (optional)
    number

    Limit results to those visited before this date, represented in milliseconds since the epoch.

    #getTypedHistory

    Retrieves a list of items used to populate the typed URL results of the address bar

    Parameters:

    query
    string

    A piece of text that the results should contain

    prefixKeywordId
    string

    A number identifying a possible keyword prefixing the query or -1 if none.

    max_results
    integer

    The number of items to return

    #getDetailedHistory

    Parameters:

    query
    object

    ⚠ NO DESCRIPTION PROVIDED

    Object Properties:

    text
    string

    A free-text query to the history service. Leave empty to retrieve all pages.

    startTime
    (optional)
    number

    Limit results to those visited after this date, represented in milliseconds since the epoch.

    endTime
    (optional)
    number

    Limit results to those visited before this date, represented in milliseconds since the epoch.

    maxResults
    (optional)
    integer

    The maximum number of results to retrieve. Defaults to 100.