Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
m (moved NPAPI:RedirectHandling to NPAPI:HTTPRedirectHandling) |
|||
Line 14: | Line 14: | ||
= Specification = | = Specification = | ||
== Disabling Redirects == | |||
Plugins can disable HTTP redirects entirely by setting the following variable: | |||
NPPVpluginRequestsNoHTTPRedirects = 22 | |||
=== Redirect Handler === | |||
Plugins can query for support for this specification using the following variable: | |||
... | |||
The following function in the NPAPI plugin function table can be implemented to allow for HTTP redirect handling: | |||
int32 NPP_URLNotifyRedirect(NPP instance, const char* url, int32 status, void* notifyData); | |||
* instance: the plug-in instance that made the request | |||
* url: the new redirected url | |||
* status: the status code returned from the server (will be 3xx) | |||
* notifyData: the data passed into NPN_PostURLNotify() or NPN_GetURLNotify() | |||
Plugins should return "NPERR_NO_ERR" when the redirect is to be allowed, and when this happens there may be further redirect notifications. Any other return value will disallow the redirect and the browser will subsequently issue an "NPP_URLNotify" call with reason "NPRES_USER_BREAK" and the last redirected url (the same one passed to the NPP_URLNotifyRedirect the last time) | |||
The existence of a slot for this handler in the plugin's function table can be confirmed by querying the following version number: | |||
NPVERS_HAS_HTTP_REDIRECT_HANDLER = 26 | |||
The slot in the function table can be NULL, in which case the browser will not send redirect information. [What is the default behavior?] |