Interface GeckoSession.HistoryDelegate

Enclosing class:
GeckoSession

public static interface GeckoSession.HistoryDelegate
An interface for recording new history visits and fetching the visited status for links.
  • Field Details

    • VISIT_TOP_LEVEL

      static final int VISIT_TOP_LEVEL
      The URL was visited a top-level window.
      See Also:
    • VISIT_REDIRECT_TEMPORARY

      static final int VISIT_REDIRECT_TEMPORARY
      The URL is the target of a temporary redirect.
      See Also:
    • VISIT_REDIRECT_PERMANENT

      static final int VISIT_REDIRECT_PERMANENT
      The URL is the target of a permanent redirect.
      See Also:
    • VISIT_REDIRECT_SOURCE

      static final int VISIT_REDIRECT_SOURCE
      The URL is temporarily redirected to another URL.
      See Also:
    • VISIT_REDIRECT_SOURCE_PERMANENT

      static final int VISIT_REDIRECT_SOURCE_PERMANENT
      The URL is permanently redirected to another URL.
      See Also:
    • VISIT_UNRECOVERABLE_ERROR

      static final int VISIT_UNRECOVERABLE_ERROR
      The URL failed to load due to a client or server error.
      See Also:
  • Method Details

    • onVisited

      @UiThread @Nullable default GeckoResult<Boolean> onVisited(@NonNull GeckoSession session, @NonNull String url, @Nullable String lastVisitedURL, int flags)
      Records a visit to a page.
      Parameters:
      session - The session where the URL was visited.
      url - The visited URL.
      lastVisitedURL - The last visited URL in this session, to detect redirects and reloads.
      flags - Additional flags for this visit, including redirect and error statuses. This is a bitmask of one or more VISIT_* flags, OR-ed together.
      Returns:
      A GeckoResult completed with a boolean indicating whether to highlight links for the new URL as visited (true) or unvisited (false).
    • getVisited

      @UiThread @Nullable default GeckoResult<boolean[]> getVisited(@NonNull GeckoSession session, @NonNull String[] urls)
      Returns the visited statuses for links on a page. This is used to highlight links as visited or unvisited, for example.
      Parameters:
      session - The session requesting the visited statuses.
      urls - A list of URLs to check.
      Returns:
      A GeckoResult completed with a list of booleans corresponding to the URLs in urls, and indicating whether to highlight links for each URL as visited ( true) or unvisited (false).
    • onHistoryStateChange

      @UiThread default void onHistoryStateChange(@NonNull GeckoSession session, @NonNull GeckoSession.HistoryDelegate.HistoryList historyList)