Confirmed users, Bureaucrats and Sysops emeriti
1,680
edits
Line 19: | Line 19: | ||
/* Callback function type used by NPP_URLRedirectNotify */ | /* Callback function type used by NPP_URLRedirectNotify */ | ||
typedef | typedef void (*NPN_HTTPRedirectResponseFunc)(NPP instance, | ||
void* notifyData, | |||
NPBool allow); | |||
void NPP_URLRedirectNotify(NPP instance, const char* url, | |||
int32 status, void* notifyData, | |||
NPN_HTTPRedirectResponseFunc callback); | |||
* instance: The plug-in instance that made the request. | * instance: The plug-in instance that made the request. | ||
Line 39: | Line 39: | ||
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. | 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. | ||
Network requests may time out if a response is not received in a reasonable amount of time. The asynchronous callback can be made from within 'NPP_URLRedirectNotify'. | |||
Network requests may time out if | |||
There may be further redirect notifications when a redirect is allowed. When a redirect is disallowed or an asynchronous redirect response is not received within a reasonable amount of time the browser will subsequently issue an 'NPP_URLNotify' call with reason 'NPRES_USER_BREAK' and the last allowed or original url. | There may be further redirect notifications when a redirect is allowed. When a redirect is disallowed or an asynchronous redirect response is not received within a reasonable amount of time the browser will subsequently issue an 'NPP_URLNotify' call with reason 'NPRES_USER_BREAK' and the last allowed or original url. |