Web related utilities to be used in scripts Accessible via app.utils.web

Web

Constructors

Methods

  • Parameters

    • keyName: string

    Returns string

    Undocumented

  • Returns string

    Undocumented

  • Parameters

    • client_type: string
    • version: number
    • include_secret: boolean

    Returns string

    Undocumented

  • Parameters

    • url: string

    Returns boolean

    Undocumented

  • Parameters

    • url: string

    Returns string

    Undocumented

  • Parameters

    • url: string

    Returns string

    Undocumented

  • Parameters

    • url: string
    • fastCheck: boolean

    Returns boolean

    Undocumented

  • Gets physical ethernet MAC address

    Returns Promise<string>

  • Gets content of given URL as string (asynchronously). URL need to be encoded using encodeURI when any special or unicode character is used.

    Parameters

    • Optional Rest ...params: any[]

      Additional parameters. Possible properties:
      headers: SharedStringList with custom HTTP headers.
      requestBody: Body to be posted by HTTP POST, if empty or not included, then HTTP GET is used
      cacheTimeout: If >0, caches reponse and uses saved responses from DB not older than cacheTimeout seconds
      filePath: If present, then the content is saved to the file and the path is returned as resolved param
      taskProgress: optional progress token, to create one use app.backgroundTasks.createNew()

    Returns Promise<any>

    Returns fetched data. If cacheTimeout>0, the first character in result is '1' (was read from cache) or '0' (not read from cache).

  • Parameters

    • link: string

    Returns Promise<any>

    Undocumented

  • Gets whether the PC is connected to the internet

    Returns Promise<any>

  • Parameters

    Returns void

    Undocumented

  • Opens given URL in the default internet browser

    Parameters

    • url: string

      URL to open

    Returns void

  • Performs HTTP(S) request using Indy (can be used as XMLHttpRequest replacement)

    Parameters

    • params: {
          content: string | FileBuffer;
          doneCallback: ((status, responseText) => any);
          headers: StringList;
          method: "POST" | "GET" | "PUT";
          progressCallback: ((readBytes, totalBytes) => boolean);
          uri: string;
      }
      • content: string | FileBuffer

        Content to send (see App.filesystem.getFileContentAsync)

      • doneCallback: ((status, responseText) => any)
          • (status, responseText): any
          • Parameters

            • status: number
            • responseText: string

            Returns any

      • headers: StringList

        custom HTTP headers

      • method: "POST" | "GET" | "PUT"

        HTTP method

      • progressCallback: ((readBytes, totalBytes) => boolean)

        return !terminated, i.e. return true to continue or false to terminate

          • (readBytes, totalBytes): boolean
          • Parameters

            • readBytes: number
            • totalBytes: number

            Returns boolean

      • uri: string

        full locator including URL params, i.e. ?foo=bar

    Returns void

  • Parameters

    • Rest ...params: any[]

    Returns void

    Undocumented

  • Parameters

    • JSON: string

    Returns void

    Undocumented

  • Parameters

    • url: string
    • authHeaderValue: string

    Returns void

    Undocumented

  • Parameters

    • url: string
    • seconds: number

    Returns void

    Undocumented

  • Parameters

    • url: string
    • ext: string

    Returns void

    Undocumented

  • Transforms http:// path to uuid://

    Parameters

    • path: string

    Returns Promise<any>

  • Transforms uuid:// path to http://

    Parameters

    • path: string

    Returns Promise<any>

  • Parameters

    • path: string

    Returns string

    Undocumented