Interface VMScriptGMDownloadOptions

interface VMScriptGMDownloadOptions {
    anonymous?: boolean;
    context?: unknown;
    headers?: Record<string, string>;
    name: string;
    onabort?: ((resp) => void);
    onerror?: ((resp) => void);
    onload?: ((resp) => void);
    onloadend?: ((resp) => void);
    onloadstart?: ((resp) => void);
    onprogress?: ((resp) => void);
    onreadystatechange?: ((resp) => void);
    ontimeout?: ((resp) => void);
    password?: string;
    timeout?: number;
    url: string;
    user?: string;
}

Hierarchy (view full)

Properties

anonymous?: boolean

When set to true, no cookie will be sent with the request and the response cookies will be ignored. The default value is false.

context?: unknown

Can be an object and will be assigned to context of the response object.

headers?: Record<string, string>

Some special headers are also allowed:

  • Cookie
  • Host
  • Origin
  • Referer
  • User-Agent
name: string

The filename to save as.

onabort?: ((resp) => void)

Type declaration

onerror?: ((resp) => void)

Type declaration

onload?: ((resp) => void)

Type declaration

onloadend?: ((resp) => void)

Type declaration

onloadstart?: ((resp) => void)

Type declaration

onprogress?: ((resp) => void)

Type declaration

onreadystatechange?: ((resp) => void)

Type declaration

ontimeout?: ((resp) => void)

Type declaration

password?: string

Password for authentication.

timeout?: number

Time to wait for the request, none by default.

url: string

URL relative to current page is also allowed.

user?: string

User for authentication.