Index

Variables

Const browserBg

browserBg: browser = inContentScript() ? browserProxy : browser

Functions

activeTab

  • activeTab(): Promise<{ active: boolean; audible?: boolean; autoDiscardable?: boolean; cookieStoreId?: string; discarded?: boolean; favIconUrl?: string; height?: number; hidden: boolean; highlighted: boolean; id?: number; incognito: boolean; index: number; isArticle: boolean; isInReaderMode: boolean; lastAccessed: number; mutedInfo?: MutedInfo; openerTabId?: number; pinned: boolean; selected: boolean; sessionId?: string; status?: string; title?: string; url?: string; width?: number; windowId: number }>
  • The first active tab in the currentWindow.

    TODO: Highlander theory: Can there ever be more than one?

    Returns Promise<{ active: boolean; audible?: boolean; autoDiscardable?: boolean; cookieStoreId?: string; discarded?: boolean; favIconUrl?: string; height?: number; hidden: boolean; highlighted: boolean; id?: number; incognito: boolean; index: number; isArticle: boolean; isInReaderMode: boolean; lastAccessed: number; mutedInfo?: MutedInfo; openerTabId?: number; pinned: boolean; selected: boolean; sessionId?: string; status?: string; title?: string; url?: string; width?: number; windowId: number }>

activeTabContainer

  • activeTabContainer(): Promise<{ color: IdentityColor; cookieStoreId: string; icon: IdentityIcon; name: string }>
  • Returns Promise<{ color: IdentityColor; cookieStoreId: string; icon: IdentityIcon; name: string }>

activeTabContainerId

  • activeTabContainerId(): Promise<string>

activeTabId

  • activeTabId(): Promise<number>

firefoxVersionAtLeast

  • firefoxVersionAtLeast(desiredmajor: number): Promise<boolean>
  • Compare major firefox versions

    Parameters

    • desiredmajor: number

    Returns Promise<boolean>

getContext

  • getContext(): "content" | "background" | "extension"
  • WebExt code can be run from three contexts:

    Content script Extension page Background page

    Returns "content" | "background" | "extension"

inContentScript

  • inContentScript(): boolean

notBackground

  • notBackground(): boolean

openInNewTab

  • openInNewTab(url: string, kwargs?: { active?: any; cookieStoreId?: any; related?: any }): Promise<{ active: boolean; audible?: boolean; autoDiscardable?: boolean; cookieStoreId?: string; discarded?: boolean; favIconUrl?: string; height?: number; hidden: boolean; highlighted: boolean; id?: number; incognito: boolean; index: number; isArticle: boolean; isInReaderMode: boolean; lastAccessed: number; mutedInfo?: MutedInfo; openerTabId?: number; pinned: boolean; selected: boolean; sessionId?: string; status?: string; title?: string; url?: string; width?: number; windowId: number }>
  • Simpler tabs.create option.

    If related = true && relatedopenpos = 'related' then open a new tab with some URL as if that URL had been middle clicked on the current tab. If relatedopenpos = 'next', open it as the next tab. If 'last', open it last and don't tell Firefox who opened it.

    Similarly for tabopenpos, but only tell FF that the newtab is related to the activeTab if tabopenpos == 'related'.

    i.e. place that tab just after the current tab and set openerTabId

    Parameters

    • url: string
    • Default value kwargs: { active?: any; cookieStoreId?: any; related?: any } = {active: true,related: false,cookieStoreId: undefined,}
      • Optional active?: any
      • Optional cookieStoreId?: any
      • Optional related?: any

    Returns Promise<{ active: boolean; audible?: boolean; autoDiscardable?: boolean; cookieStoreId?: string; discarded?: boolean; favIconUrl?: string; height?: number; hidden: boolean; highlighted: boolean; id?: number; incognito: boolean; index: number; isArticle: boolean; isInReaderMode: boolean; lastAccessed: number; mutedInfo?: MutedInfo; openerTabId?: number; pinned: boolean; selected: boolean; sessionId?: string; status?: string; title?: string; url?: string; width?: number; windowId: number }>

openInNewWindow

  • openInNewWindow(createData?: {}): void

openInTab

  • openInTab(tab: any, opts?: {}, strarr: string[]): Promise<any>
  • Parameters

    • tab: any
    • Default value opts: {} = {}
    • strarr: string[]

    Returns Promise<any>

ownTab

  • ownTab(): Promise<any>

ownTabContainer

  • ownTabContainer(): Promise<{ color: IdentityColor; cookieStoreId: string; icon: IdentityIcon; name: string }>
  • Returns Promise<{ color: IdentityColor; cookieStoreId: string; icon: IdentityIcon; name: string }>

ownTabId

  • ownTabId(): Promise<any>