Name: browserDownloadRequest

Type: message

Syntax: browserDownloadRequest <instanceId>, <url> 

Syntax: XBrowser_DownloadRequest <url>, <instanceId> 

Summary: Sent when a download has been requested in a browser object.

Synonyms: XBrowser_DownloadRequest

Associations: card

Introduced: 2.8.1

OS: mac,windows

Platforms: desktop

Security: network

Example:
on browserDownloadRequest pInstanceId, pUrl
  if urlForbidden(pUrl) then
    global browserCancel
    put true into browserCancel
  end if
end browserDownloadRequest

Parameters:
instanceId: The integer identifier of the browser object >*Note:* For general information on using the browser library, see the notes in the revBrowserOpen function reference.
url: The url of the resource about to be downloaded

Description:
The <browserDownloadRequest> message is sent to the current card of stack containing a browser object when a url has been requested as a download. 

On Windows, if the <browserCancel> global is set to false on exit from the callback, the browser proceeds to download the file.

On OS X, the callback is a notification only and downloading should be performed by the host application.

>*Note:* For general information on using the browser library, see the notes in the <revBrowserOpen function> reference.

References: browserCancel (glossary), browserDocumentCompleteFrame (message), queryRecordChanged (message), browserBeforeNavigate (message), browserBeforeNavigateFrame (message), browserDocumentComplete (message), revBrowserOpen (function), revBrowserOpen function (function)
