NPP_URLNotify

« Gecko Plugin API Reference « Plug-in Side Plug-in API

Summary

Notifies the plug-in instance of the completion of a URL request.

Syntax

#include <npapi.h>

void NPP_URLNotify(NPP         instance,
                   const char* url,
                   NPReason    reason,
                   void*       notifyData);

Parameters

The function has the following parameters:

instance
Pointer to the current plug-in instance.
url
URL of the NPN_GetURLNotify() or NPN_PostURLNotify() request that has completed.
reason
Reason code for completion of request. Values:
  • NPRES_DONE (most common): Completed normally.
  • NPRES_USER_BREAK: User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
  • NPRES_NETWORK_ERR: Stream failed due to problems with network, disk I/O, lack of memory, or other problems.
notifyData
Plug-in-private value for associating a previous NPN_GetURLNotify() or NPN_PostURLNotify() request with a subsequent NPP_URLNotify() call.

Description

The browser calls NPP_URLNotify() after the completion of a NPN_GetURLNotify() or NPN_PostURLNotify() request to inform the plug-in that the request was completed and supply a reason code for the completion.

The most common reason code is NPRES_DONE, indicating simply that the request completed normally. Other possible reason codes are NPRES_USER_BREAK, indicating that the request was halted due to a user action (for example, clicking the Stop button), and NPRES_NETWORK_ERR, indicating that the request could not be completed, perhaps because the URL could not be found.

The parameter notifyData is the plug-in-private value passed as an argument by a previous NPN_GetURLNotify() or NPN_PostURLNotify() call, and can be used as an identifier for the request.

See also