Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface GM_Fns

The GM API that fills in any APIs that GreaseMonkey uses and points them to their CRM counterparts Documentation can be found here http://wiki.greasespot.net/Greasemonkey_Manual:API and here http://tampermonkey.net/documentation.php

Hierarchy

Index

Properties

GM_getTab

GM_getTab: InstantCB

Please use the comms API instead of this one

see

https://tampermonkey.net/documentation.php#GM_getTab

param

A callback that is immediately called

GM_getTabs

GM_getTabs: InstantCB

Please use the comms API instead of this one

see

https://tampermonkey.net/documentation.php#GM_getTabs

param

A callback that is immediately called

GM_installScript

GM_installScript: EmptyFn

THIS FUNCTION DOES NOT WORK AND IS DEPRECATED

see

https://tampermonkey.net/documentation.php#GM_installScript

param

An argument that is ignored

GM_registerMenuCommand

GM_registerMenuCommand: EmptyFn

This is only here to prevent errors from occurring when calling any of these functions, this function does nothing

see

https://tampermonkey.net/documentation.php#GM_registerMenuCommand

param

An argument that is ignored

GM_saveTab

GM_saveTab: InstantCB

Please use the comms API instead of this one, this one does nothing

see

https://tampermonkey.net/documentation.php#GM_saveTab

param

A callback that is immediately called

GM_setClipboard

GM_setClipboard: EmptyFn

This is only here to prevent errors from occurring when calling any of these functions, this function does nothing

see

https://tampermonkey.net/documentation.php#GM_setClipboard

param

An argument that is ignored

GM_unregisterMenuCommand

GM_unregisterMenuCommand: EmptyFn

This is only here to prevent errors from occurring when calling any of these functions, this function does nothing

see

https://tampermonkey.net/documentation.php#GM_unregisterMenuCommand

param

An argument that is ignored

unsafeWindow

unsafeWindow: Window

The unsafeWindow object provides full access to the pages javascript functions and variables.

see

https://tampermonkey.net/documentation.php#unsafeWindow

type

Window

Methods

GM_addStyle

  • GM_addStyle(css: string): void

GM_addValueChangeListener

  • GM_addValueChangeListener(name: string, callback: function): number
  • Adds a change listener to the storage and returns the listener ID. 'name' is the name of the observed variable. The 'remote' argument of the callback function shows whether this value was modified from the instance of another tab (true) or within this script instance (false). Therefore this functionality can be used by scripts of different browser tabs to communicate with each other.

    see

    https://tampermonkey.net/documentation.php#GM_addValueChangeListener

    Parameters

    • name: string

      The name of the observed variable

    • callback: function

      A callback in which the first argument is the name of the observed, variable, the second one is the old value, the third one is the new value and the fourth one is a boolean that indicates whether the change was from a remote tab

        • (key: string, oldValue: any, newValue: any, remote: boolean): void
        • Parameters

          • key: string
          • oldValue: any
          • newValue: any
          • remote: boolean

          Returns void

    Returns number

    • The id of the listener, used for removing it

GM_deleteValue

  • GM_deleteValue(name: string): void

GM_download

  • GM_download(details: DownloadSettings): void
  • GM_download(url: string, name: string): void

GM_getResourceString

  • GM_getResourceString(name: string): string

GM_getResourceURL

  • GM_getResourceURL(name: string): string

GM_getValue

  • GM_getValue<T>(name: string, defaultValue?: T): T
  • GM_getValue<T>(name: string, defaultValue?: T): void
  • GM_getValue<T>(name: string, defaultValue?: T): any
  • This method retrieves a value that was set with GM_setValue. See GM_setValue for details on the storage of these values.

    see

    https://tampermonkey.net/documentation.php#GM_getValue

    Type parameters

    • T

    Parameters

    • name: string

      The property name to get

    • Optional defaultValue: T

    Returns T

    • Returns the value if the value is defined, if it's undefined, returns defaultValue
        when defaultValue is also undefined, returns undefined
  • This method retrieves a value that was set with GM_setValue. See GM_setValue for details on the storage of these values.

    see

    https://tampermonkey.net/documentation.php#GM_getValue

    Type parameters

    • T

    Parameters

    • name: string

      The property name to get

    • Optional defaultValue: T

    Returns void

    • Returns the value if the value is defined, if it's undefined, returns defaultValue
        when defaultValue is also undefined, returns undefined
  • This method retrieves a value that was set with GM_setValue. See GM_setValue for details on the storage of these values.

    see

    https://tampermonkey.net/documentation.php#GM_getValue

    Type parameters

    • T

    Parameters

    • name: string

      The property name to get

    • Optional defaultValue: T

    Returns any

    • Returns the value if the value is defined, if it's undefined, returns defaultValue
        when defaultValue is also undefined, returns undefined

GM_info

GM_listValues

  • GM_listValues(): string[]

GM_log

  • GM_log(...params: any[]): void

GM_notification

  • GM_notification(options: NotificationOptions): void
  • GM_notification(text: string, title?: string, image?: string, onclick?: Function): void

GM_openInTab

  • GM_openInTab(url: string): void

GM_removeValueChangeListener

  • GM_removeValueChangeListener(listenerId: number): void

GM_setValue

  • GM_setValue(name: string, value: any): void

GM_xmlhttpRequest

  • Sends an xmlhttpRequest with given parameters

    see

    https://tampermonkey.net/documentation.php#GM_xmlhttpRequest

    Parameters

    • options: object

      The options

      • Optional anonymous?: boolean

        If true, sends no cookies along with the request

      • Optional binary?: boolean

        Whether the data should be sent in binary mode

      • Optional context?: any

        A property which will be applied to the response object

      • Optional data?: any

        The data to send along

      • Optional fetch?: boolean

        Use a fetch instead of an xhr

      • Optional headers?: object

        The headers for the request

        • [headerKey: string]: string
      • Optional method?: string

        The method to use (GET, HEAD or POST)

      • Optional onerror?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional onload?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional onloadstart?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional onprogress?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional onreadystatechange?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional ontimeout?: function

        A callback on that event

          • Parameters

            Returns void

      • Optional overrideMimeType?: string

        The MIME type to use

      • Optional password?: string

        A password for authentication

      • Optional responseType?: string

        The type of response, arraybuffer, blob or json

      • Optional timeout?: number

        The time to wait in ms

      • Optional url?: string

        The url to request

      • Optional username?: string

        A username for authentication

    Returns XMLHttpRequest

    The XHR

Generated using TypeDoc