@freedomofpress/webcat
    Preparing search index...

    Class WebcatUI

    Manages the UI for WEBCAT.

    Hierarchy (View Summary)

    Index
    • Clears a specific warning from the UI.

      Parameters

      • id: string

        The ID of the warning to clear.

      Returns Promise<void>

    • Computes the URL of a named page.

      Parameters

      • name: string

        The name of the page.

      • Optionaloptions: { fragment?: string | URLSearchParams; query?: string | URLSearchParams }

      Returns string

      The absolute URL of the page.

    • Loads a named page in the specified tab.

      Parameters

      • tabId: number

        The ID of the tab to load the page in.

      • name: string

        The name of the page.

      • Optionaloptions: {
            fragment?: string | URLSearchParams;
            query?: string | URLSearchParams;
            replace?: boolean;
        }

      Returns Promise<void>

    • Sets the message for the specified warning.

      Parameters

      • id: string

        The ID of the warning.

      • ...args: unknown[]

        The arguments of the warning. Must be serializable as JSON.

      Returns Promise<void>

    • Displays the error icon in the browser's URL bar.

      Parameters

      • tabId: number

        The ID of the tab to display the icon in.

      Returns Promise<void>

    • Loads the error page in the tab(s) indicated by details.

      Parameters

      • details: Stateful<RequestDetails>

        Details for the request that triggered the error.

      • error: WebcatError

        The error information.

      • replace: boolean = !details.state.isFrame

        true to replace the current history entry, false to add a new one.

      Returns Promise<void>

    • Displays the default WEBCAT icon in the browser's URL bar. If the UI has warnings, shows the warning icon instead.

      Parameters

      • tabId: number

        The ID of the tab to display the icon in.

      • Optionaloptions: {
            name?: string;
            popup?: {
                fragment?: string | URLSearchParams;
                name: string;
                query?: string | URLSearchParams;
            };
            title?: string;
        }

        Icon options.

        • Optionalname?: string

          The name of the icon.

        • Optionalpopup?: {
              fragment?: string | URLSearchParams;
              name: string;
              query?: string | URLSearchParams;
          }

          The popup page to display on click.

        • Optionaltitle?: string

          The title displayed in the icon's tooltip.

      Returns Promise<void>

    • Displays the OK icon in the browser's URL bar. If the UI has warnings, shows the warning icon instead.

      Parameters

      • tabId: number

        The ID of the tab to display the icon in.

      • Optionaldelegation: string

        Optional delegation information to include in the title text.

      Returns Promise<void>

    • Displays the warning icon in the browser's URL bar. Clicking on the icon opens the popup with full warning info.

      Parameters

      • tabId: number

        The ID of the tab to display the icon in.

      Returns Promise<void>