Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
| Line 22: | Line 22: | ||
* instance: the plug-in instance that made the request | * instance: the plug-in instance that made the request | ||
* url: the new | * url: the new target url for the redirect | ||
* status: the status code returned from the server (will be 3xx) | * status: the status code returned from the server (will be 3xx) | ||
* notifyData: the data passed into NPN_PostURLNotify() or NPN_GetURLNotify() | * notifyData: the data passed into NPN_PostURLNotify() or NPN_GetURLNotify() | ||
| Line 30: | Line 30: | ||
NPVERS_HAS_HTTP_REDIRECT_HANDLER = 26 | NPVERS_HAS_HTTP_REDIRECT_HANDLER = 26 | ||
The slot for this handler in the plugin function structure can be NULL. If this function is not provided then redirect behavior is up to the browser. | The slot for this handler in the plugin function structure can be NULL. If this function is not provided then redirect behavior is up to the browser. The recommended default behavior is to allow all same-origin redirects and disallow all cross-origin redirects. | ||
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 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) | ||