Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/permissions

Manage optional permissions

Index

Variables

Const chromep

chromep: ChromePromise = new ChromePromise()

Functions

contains

  • contains(type: IType): Promise<boolean>
  • Determine if we have an optional permission

    throws

    An error if failed to get status

    Parameters

    • type: IType

      permission type

    Returns Promise<boolean>

    true if we have the permission

deny

  • deny(type: IType): Promise<boolean>
  • Remove and deny an optional permission

    throws

    An error if failed to deny

    Parameters

    • type: IType

      permission type

    Returns Promise<boolean>

    true if removed

injectContentScript

  • injectContentScript(tabId: number): Promise<void>
  • Inject our script into the given tab

    Parameters

    • tabId: number

      tab to inject into

    Returns Promise<void>

injectContentScripts

  • injectContentScripts(): Promise<void>

isAllowed

  • isAllowed(type: IType): boolean
  • Has the user allowed the optional permissions

    Parameters

    • type: IType

      permission type

    Returns boolean

    true if allowed

isInOrigins

  • isInOrigins(url: string, type: IType): boolean
  • Determine if a url is contained in the permission's origins

    Parameters

    • url: string

      url to check

    • type: IType

      Permission type

    Returns boolean

notSet

  • notSet(type: IType): boolean
  • Has user not made a choice on a permission yet

    Parameters

    • type: IType

      permission type

    Returns boolean

    true if notSet

remove

  • remove(type: IType): Promise<boolean>
  • Remove an optional permission

    remarks

    Chrome doesn't actually remove an optional permission once it has been granted

    throws

    An error if failed to remove

    Parameters

    • type: IType

      permission type

    Returns Promise<boolean>

    true if removed

request

  • request(type: IType): Promise<boolean>
  • Request optional permission

    throws

    An error if request failed

    Parameters

    • type: IType

      permission type

    Returns Promise<boolean>

    true if permission granted

setState

  • setState(type: IType, value: STATE): Promise<void>

Object literals

Const TABS

TABS: object

Permission for tabs

remarks

In order to use content scripts

name

name: string = "permissions"

origins

origins: string[] = ['http://*/*', 'https://*/*']

permissions

permissions: string[] = ['tabs']

Generated using TypeDoc