Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "download_background"

Index

Functions

downloadUrl

  • downloadUrl(url: string, saveAs: boolean): Promise<void>
  • Download a given URL to disk

    Normal URLs are downloaded normally. Data URLs are handled more carefully as it's not allowed in WebExt land to just call downloads.download() on them

    Parameters

    • url: string

      the URL to download

    • saveAs: boolean

      prompt user for a filename

    Returns Promise<void>

objectUrlFromDataUrl

  • objectUrlFromDataUrl(dataUrl: URL): string
  • Construct an object URL string from a given data URL

    This is needed because feeding a data URL directly to downloads.download() causes "Error: Access denied for URL"

    Parameters

    • dataUrl: URL

      the URL to make an object URL from

    Returns string

    object URL that can be fed to the downloads API

Generated using TypeDoc