Requests creation of a new stream with the contents of the specified URL; gets notification of the result.
#include <npapi.h> NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData);
The function has the following parameters:
- Pointer to the current plug-in instance.
- Pointer to the URL of the request. Can be of any type, such as HTTP, FTP, news, or mailto.
Name of the target window or frame, or one of several special target names. For values, see
Plug-in-private value for associating the request with the subsequent
NPP_URLNotify()call, which passes this value (see Description below).
- If successful, the function returns
- If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes.
NPN_GetURLNotify() works just like
NPN_GetURL(), with one exception:
NPN_GetURLNotify() notifies the plug-in instance upon successful or unsuccessful completion of the request by calling the plug-in's
NPP_URLNotify() function and passing it the
NPN_GetURLNotify() typically handles the URL request asynchronously. It returns immediately and only later handles the request and calls
NPP_URLNotify(). This notification is the only way the plug-in can tell whether a request with a
target failed, or that a request with a non-null target completed.
For requests that complete unsuccessfully, the browser calls
NPP_URLNotify() as soon as possible. For requests that complete successfully:
- If the target is non-null, the browser calls
NPP_URLNotify()after it has finished loading the URL.
- If the target is null, the browser calls
NPP_URLNotify()after closing the stream by calling
If this function is called with a target parameter value of
_self or a parent to
_self, this function should return NPERR_INVALID_PARAM. This is the only way to notify the plug-in once it is deleted.
NPN_GetURLNotify()does not notify the plug-in if
NULL. See bug 638367 for details.