MDN’s new design is in Beta! A sneak peek:

« Gecko Plugin API Reference « Browser Side Plug-in API 


Provides information to a plugin which is associated with a given URL, for example the cookies or preferred proxy.


#include <npapi.h>

typedef enum {
  NPNURLVCookie = 501,
} NPNURLVariable;

NPError NPN_GetValueForURL(NPP instance,
                           NPNURLVariable variable,
                           const char *url,
                           char **value,
                           uint32_t *len);


This function has the following parameters:

Pointer to the current plug-in instance.
Selects the type of information to be retrieved (NPNURLVCookie or NPNURLVProxy)
The URL for which to fetch information.
Out parameter. The browser passes back the requested information. If the function succeeds, the result buffer will be allocated with NPN_MemAlloc; the plugin is responsible for freeing the buffer. Note: the value may have internal NULL bytes and may not be NULL-terminated.

When multiple cookies are returned for a given URL, the format of the return value is:
Out parameter. The length of the returned value buffer.


  • If successful, the function returns NPERR_NO_ERROR.
  • If unsuccessful, the function returns an error code. For possible values, see Error Codes.


This entry point is designed to allow plugins which implement their own HTTP stacks to form requests to the web server in the same way the browser does.

See also

NPN_SetValueForURL, NPN_GetAuthenticationInfo

Document Tags and Contributors

 Contributors to this page: teoli, kbr_google, jreschke, johshoff
 Last updated by: teoli,