Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
| Line 15: | Line 15: | ||
= Specification = | = Specification = | ||
The following function can be implemented by plugins to allow for HTTP redirect handling: | |||
The following function | |||
int32 NPP_URLNotifyRedirect(NPP instance, const char* url, | int32 NPP_URLNotifyRedirect(NPP instance, const char* url, | ||
| Line 29: | Line 25: | ||
* notifyData: the data passed into NPN_PostURLNotify() or NPN_GetURLNotify() | * notifyData: the data passed into NPN_PostURLNotify() or NPN_GetURLNotify() | ||
The browser will look for this handler only if the plugin function structure's version field is set to the following value or higher: | |||
NPVERS_HAS_HTTP_REDIRECT_HANDLER = 26 | |||
The slot for this handler in the plugin function structure can be NULL. | |||
Plugins should return "NPERR_NO_ERR" when the redirect is to be allowed. There may be further redirect notifications when a redirect is allowed. Any return value other than "NPERR_NO_ERR" 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) | |||
Plugins can query the browser for support for this specification using the following variable: | |||
NPNVsupportsRedirectNotification = 22 | |||
If the browser returns "true" for this variable then plugins can depend on the browser calling the HTTP redirect handler when appropriate, if it is provided by the plugin. | |||