mozilla

Revision 90399 of NPP URLNotify

  • Revision slug: NPP_URLNotify
  • Revision title: NPP URLNotify
  • Revision id: 90399
  • Created:
  • Creator: Sheppy
  • Is current revision? Yes
  • Comment clean up; 21 words added, 4 words removed; page display name reset to default

Revision Content

{{ Np-plugin-api() }}

Summary

Notifies the plug-in instance of the completion of a URL request.

Syntax

#include <npapi.h>
 
void NPP_URLNotify(NPP         instance, 
                   const char* url,
                   NPReason    reason, 
                   void*       notifyData);

Parameters

The function has the following parameters:

instance
Pointer to the current plug-in instance.
url
URL of the NPN_GetURLNotify() or NPN_PostURLNotify() request that has completed.
reason
Reason code for completion of request. Values:
  • NPRES_DONE (most common): Completed normally.
  • NPRES_USER_BREAK: User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.
  • NPRES_NETWORK_ERR: Stream failed due to problems with network, disk I/O, lack of memory, or other problems.
notifyData
Plug-in-private value for associating a previous NPN_GetURLNotify() or NPN_PostURLNotify() request with a subsequent NPP_URLNotify() call.

Description

The browser calls NPP_URLNotify() after the completion of a NPN_GetURLNotify() or NPN_PostURLNotify() request to inform the plug-in that the request was completed and supply a reason code for the completion.

The most common reason code is NPRES_DONE, indicating simply that the request completed normally. Other possible reason codes are NPRES_USER_BREAK, indicating that the request was halted due to a user action (for example, clicking the Stop button), and NPRES_NETWORK_ERR, indicating that the request could not be completed, perhaps because the URL could not be found.

The parameter notifyData is the plug-in-private value passed as an argument by a previous NPN_GetURLNotify() or NPN_PostURLNotify() call, and can be used as an identifier for the request.

See also

{{ languages( { "ja": "ja/NPP_URLNotify" } ) }}

Revision Source

<p>{{ Np-plugin-api() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>Notifies the plug-in instance of the completion of a URL request.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre>#include &lt;npapi.h&gt;
 
void NPP_URLNotify(NPP         instance, 
                   const char* url,
                   NPReason    reason, 
                   void*       notifyData);
</pre>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<p>The function has the following parameters:</p>
<dl> <dt><code>instance</code></dt> <dd>Pointer to the current plug-in instance.</dd>
</dl>
<dl> <dt><code>url</code></dt> <dd>URL of the <code><a href="/en/NPN_GetURLNotify" title="en/NPN_GetURLNotify">NPN_GetURLNotify()</a></code> or <code><a href="/en/NPN_PostURLNotify" title="en/NPN_PostURLNotify">NPN_PostURLNotify()</a></code> request that has completed.</dd>
</dl>
<dl> <dt><code>reason</code></dt> <dd>Reason code for completion of request. Values: <ul> <li><code>NPRES_DONE</code> (most common): Completed normally.</li> <li><code>NPRES_USER_BREAK</code>: User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations.</li> <li><code>NPRES_NETWORK_ERR</code>: Stream failed due to problems with network, disk I/O, lack of memory, or other problems.</li> </ul> </dd>
</dl>
<dl> <dt><code>notifyData</code></dt> <dd>Plug-in-private value for associating a previous <code><a href="/en/NPN_GetURLNotify" title="en/NPN_GetURLNotify">NPN_GetURLNotify()</a></code> or <code><a href="/en/NPN_PostURLNotify" title="en/NPN_PostURLNotify">NPN_PostURLNotify()</a></code> request with a subsequent <code>NPP_URLNotify()</code> call.</dd>
</dl>
<h3 id="Description" name="Description">Description</h3>
<p>The browser calls <code>NPP_URLNotify()</code> after the completion of a <code><a href="/en/NPN_GetURLNotify" title="en/NPN_GetURLNotify">NPN_GetURLNotify()</a></code> or <code><a href="/en/NPN_PostURLNotify" title="en/NPN_PostURLNotify">NPN_PostURLNotify()</a></code> request to inform the plug-in that the request was completed and supply a reason code for the completion.</p>
<p>The most common reason code is <code>NPRES_DONE</code>, indicating simply that the request completed normally. Other possible reason codes are <code>NPRES_USER_BREAK</code>, indicating that the request was halted due to a user action (for example, clicking the Stop button), and <code>NPRES_NETWORK_ERR</code>, indicating that the request could not be completed, perhaps because the URL could not be found.</p>
<p>The parameter <code>notifyData</code> is the plug-in-private value passed as an argument by a previous <code><a href="/en/NPN_GetURLNotify" title="en/NPN_GetURLNotify">NPN_GetURLNotify()</a></code> or <code><a href="/en/NPN_PostURLNotify" title="en/NPN_PostURLNotify">NPN_PostURLNotify()</a></code> call, and can be used as an identifier for the request.</p>
<h3 id="See_Also" name="See_Also">See also</h3>
<ul> <li><code><a href="/en/NPN_GetURLNotify" title="en/NPN_GetURLNotify">NPN_GetURLNotify()</a><br> </code></li> <li><code><a href="/en/NPN_GetURL" title="en/NPN_GetURL">NPN_GetURL()</a><br> </code></li> <li><code><a href="/en/NPN_PostURLNotify" title="en/NPN_PostURLNotify">NPN_PostURLNotify()</a><br> </code></li> <li><code><a href="/en/NPN_PostURL" title="en/NPN_PostURL">NPN_PostURL()</a> </code></li>
</ul>
<p>{{ languages( { "ja": "ja/NPP_URLNotify" } ) }}</p>
Revert to this revision