Search completed in 1.24 seconds.
26 results for "npobject":
Your results are loading. Please wait...
NPObject - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary NPObject is a structure that holds a pointer to an NPClass and an integer reference count, and possibly also implementation specific (i.e. plugin specific, or browser specific) members. NPObject is the type used to express objects exposed by either the plugin or by the browser through this API. The browsers are expected to expose their window objects and everything reachable from it through this API. NPObjects are reference counted objects, so callers need to be careful to properly release acquired references to them. To aid with the reference counting and ownership management in general, the functions NPN_CreateObject(), NPN_RetainObject(), NPN_ReleaseObject(), and NPN_ReleaseVariantValue() are provided as part of this API. NPO...
...cts, so callers need to be careful to properly release acquired references to them. To aid with the reference counting and ownership management in general, the functions NPN_CreateObject(), NPN_RetainObject(), NPN_ReleaseObject(), and NPN_ReleaseVariantValue() are provided as part of this API. NPObject behavior is implemented using the set of callback functions defined in NPClass. Syntax struct NPObject { NPClass *_class; uint32_t referenceCount; /* * Additional space may be allocated here by types of NPObjects */ }; Fields _class A pointer to the NPClass of which the object is a member. referenceCount The reference count for the object. Warning: Do not manipulate the _class and referenceCount fields directly; use the functions below to manipulate t...
NPClass - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary NPClass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an NPClass (i.e. an NPObject). Syntax struct NPClass { uint32_t structVersion; NPAllocateFunctionPtr allocate; NPDeallocateFunctionPtr deallocate; NPInvalidateFunctionPtr invalidate; NPHasMethodFunctionPtr hasMethod; NPInvokeFunctionPtr invoke; NPInvokeDefaultFunctionPtr invokeDefault; NPHasPropertyFunctionPtr hasProperty; NPGetPropertyFunctionPtr getProperty; NPSetPropertyFunctionPtr setProperty; NPRemovePropertyFunctionPtr removeProperty; NPEnumerationFunctionPtr enumerate; NPConstructFunctionPtr construct; }; Warning: Don't call these routines directly. You should instead use the appropri...
...ationFunctionPtr enumerate; NPConstructFunctionPtr construct; }; Warning: Don't call these routines directly. You should instead use the appropriate API functions. Fields structVersion The version number of the structure. This is set to NP_CLASS_STRUCT_VERSION, which is 1 in Mozilla 1.8.*, 2 since Mozilla 1.9a1, and 3 since Firefox 3.0b1. allocate Returns a pointer to a newly allocated NPObject. Called by NPN_CreateObject() if non-NULL, otherwise the browser calls malloc(). This function is expected to allocate and return enough storage to hold the NPObject that is being created. deallocate Called by NPN_ReleaseObject() when an object's reference count reaches zero. If this field is NULL, free() is called isntead. invalidate Called on live objects that belong to a plugin instance th...
...If this field is NULL, free() is called isntead. invalidate Called on live objects that belong to a plugin instance that is being destroyed. This call is always followed by a call to the deallocate function, or free(). Any attempt to use an invalidated object will result in undefined behavior. hasMethod Called by NPN_HasMethod() to determine whether or not a specified method exists on a given NPObject. Returns true if the method exists, otherwise returns false. invoke Called by NPN_Invoke() to invoke a specific method on a given NPObject. Returns true if invocation succeeded or false if an error occurred. invokeDefault Called by NPN_InvokeDefault() to invoke the default method (if available) on a given NPObject. Returns true if invocation succeeded or false if an error occurred. hasProper...
...And 10 more matches
NPAPI plugin reference - Archive of obsolete content
-in object; these allow plug-ins to interact with the browser. The names of all of these methods begin with NPP_ to indicate that they are implemented by the plug-in and called by the browser. NPByteRange Represents a particular range of bytes from a stream. NPClass NPClass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an NPClass (i.e. an NPObject). NPEmbedPrint Substructure of NPPrint that contains platform-specific information used during embedded mode printing. NPEvent Represents an event passed by NPP_HandleEvent() to a windowless plug-in. NPFullPrint Substructure of NPPrint that contains platform-specific information used during full-page mode printing. NPIdentifier NPIdentifier is an opaque type used for method and property i...
...fier is an opaque type used for method and property identifiers, such as strings or integers. NPIdentifiers are unique, in that for any given string or integer, there is only one NPIdentifier. The lifetime of NPIdentifiers is controlled by the browser. NPN NewStream Requests the creation of a new data stream produced by the plug-in and consumed by the browser. NPN_CreateObject Allocates a new NPObject. NPN_DestroyStream Closes and deletes a stream. NPN_Enumerate Gets the names of the properties and methods of the specified NPObject. NPN_Evaluate Evaluates a script in the scope of the specified NPObject. NPN_ForceRedraw Asks the plugin host to immediately (synchronously) repaint invalid areas. NPN_GetAuthenticationInfo The function is called by plugins to get HTTP authentication infor...
... NPN_GetStringIdentifier Returns an opaque identifier for the string that is passed in. NPN_GetStringIdentifiers Returns an array of opaque identifiers for the names that are passed in. NPN_GetURL Asks the browser to create a stream for the specified URL. ...
...And 7 more matches
Index - Archive of obsolete content
truct API, Gecko, NPAPI, Plugins, Reference Contains information required during embedded mode printing. 3624 NPByteRange NPAPI, Plugins Represents a particular range of bytes from a stream. 3625 NPClass NPAPI, Plugins NPClass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an NPClass (i.e. an NPObject). 3626 NPEmbedPrint NPAPI, Plugins Substructure of NPPrint that contains platform-specific information used during embedded mode printing. 3627 NPEvent NPAPI, Plugins Represents an event passed by NPP_HandleEvent() to a windowless plug-in. 3628 NPFullPrint NPAPI, Plugins Substructure of NPPrint that contains platform-specific informat...
... given string or integer, there is only one NPIdentifier. The lifetime of NPIdentifiers is controlled by the browser. 3630 NPN NewStream NPAPI, Plugins Requests the creation of a new data stream produced by the plug-in and consumed by the browser. 3631 NPNVariable See NPN_GetValue. 3632 NPN_CreateObject NPAPI, Plugins Allocates a new NPObject. 3633 NPN_DestroyStream API, Gecko, NPAPI, Plugins, Reference Closes and deletes a stream. 3634 NPN_Enumerate Gets the names of the properties and methods of the specified NPObject. 3635 NPN_Evaluate NPAPI, Plugins Evaluates a script in the scope of the specified NPObject. 3636 NPN_ForceRedraw NPAPI, Plugins Asks...
...ly) repaint invalid areas. 3637 NPN_GetAuthenticationInfo The function is called by plugins to get HTTP authentication information from the browser. 3638 NPN_GetIntIdentifier NPAPI, Plugins Returns an opaque identifier for the integer that is passed in. 3639 NPN_GetProperty NPAPI, Plugins Gets the value of a property on the specified NPObject. 3640 NPN_GetStringIdentifier NPAPI, Plugins Returns an opaque identifier for the string that is passed in. 3641 NPN_GetStringIdentifiers NPAPI, Plugins Returns an array of opaque identifiers for the names that are passed in. 3642 NPN_GetURL API, Gecko, NPAPI, Plugins, Reference Asks the browser to create a stream for the specified UR...
...And 6 more matches
Scripting plugins - Plugins
e DOM handles scripting The Mozilla DOM code now checks if a plugin supports this new scriptability API and if it exposes a scriptable object through this new mechanism. Mozilla does this by calling the old plugin API call NPP_GetValue with the new enumeration value that has been added to the NPPVariable enumeration. The new NPPVariable enumeration is defined in npapi.h as: NPPVpluginScriptableNPObject = 15 Threading model This API is not designed to be thread safe. The threading model for this API is such that all calls through this API are synchronous and calls from a plugin to methods in this API must come from the thread on which the plugin was initiated, and likewise all calls to methods in this API by the browser are guaranteed to come from the same thread. Future revisions to this API...
...origin of the calling code, so that the plugin can specify the origin of calls that come from internally loaded code from other origins. This way such code can be executed with only the privileges of the origin of the code, and not the privileges of the plugin page's origin. What's in the plugin code? A plugin that wishes to be scriptable using this new mechanism needs to return the appropriate NPObject (which is created by calling NPN_CreateObject) when the browser requests it by calling: NPP_GetValue(npp, NPPVpluginScriptableNPObject, ...); Accessing browser objects from a plugin A plugin that wishes to access objects in the browser window that loaded the plugin can do this by getting the NPObject for the browser's window object, or the DOM element that loaded the plugin. This is done by u...
..., ...); Accessing browser objects from a plugin A plugin that wishes to access objects in the browser window that loaded the plugin can do this by getting the NPObject for the browser's window object, or the DOM element that loaded the plugin. This is done by using an extension to NPN_GetValue. The extensions are two additions to the NPNVariables enumeration; the new enumerations are NPNVWindowNPObject and NPNVPluginElementNPObject. ...
...And 4 more matches
NPN_GetValue - Archive of obsolete content
The value parameter should point to a NPBool, which will be set appropriately if the function returns NPERR_NO_ERROR. NPNVprivateModeBool: Indicates whether or not...
...The value parameter should point to a NPBool, which will be set appropriately if the function returns NPERR_NO_ERROR. NPNVprivateModeBool: Indicates whether or not the browser is curren...
... SmartUpdate (former name: ASD) is enabled; true=SmartUpdate enabled, false=not enabled NPNVisOfflineBool: Tells whether offline mode is enabled; true=offline mode enabled, false=not enabled NPNVToolkit: NPNVSupportsXEmbedBool: NPNVWindowNPObject: Returns the NPObject * pointer for the DOM window object; see Getting the page URL in NPAPI plugin for a rough example NPNVPluginElementNPObject: NPNVSupportsWindowless: Tells whether the browser supports windowless plugins. The value parameter should point to a NPBool, which will be set appropriately if the function returns NPERR_NO_ERROR. NPNVprivateModeBool: Indicates whether or not the browser is currently in private browsing mode. The value parameter should point to an NPBool, which will be set appropriately if the function ret...
Getting the page URL in NPAPI plugin - Archive of obsolete content
fuse to do anything, if you don't like the URL, or you can compare it with the other URL you want to contact. So, how do we get at that page URL, i.e. the URL of the HTML which embeds the plugin, i.e. which caused the plugin to load? There are at least 3 solutions (quoting newsgroup posts): Via window location From Robert Platt: // Get the Dom window object. ...
...identifier = NPN_GetStringIdentifier( "href" ); // Get the location property from the location object. bool b2 = NPN_GetProperty( m_pNPInstance, locationObj, identifier, &variantValue ); This code is just a rough example. Remember to release any references after using them. ...
NPN_HasMethod - Archive of obsolete content
npobj The object on which to look for the method. methodName A string identifier indicating the name of the method to look for. ...
...npobj The object on which to look for the method. methodName A string identifier indicating the name of the method to look for. ...
NPN_HasProperty - Archive of obsolete content
<tt>npobj</tt> The object on which to look for the property. <tt>propertyName</tt> A string identifier indicating the name of the property to look for. ...
...<tt>npobj</tt> The object on which to look for the property. <tt>propertyName</tt> A string identifier indicating the name of the property to look for. ...
NPN_InvokeDefault - Archive of obsolete content
npobj The object on which to invoke the default method. args An array of arguments to pass to the default method. argCount The number of arguments in the args array. ...
... npobj The object on which to invoke the default method. args An array of arguments to pass to the default method. argCount The number of arguments in the args array. ...
NPN_RemoveProperty - Archive of obsolete content
npobj The object on which a property is to be deleted. ...
... npobj The object on which a property is to be deleted. ...
NPN_SetProperty - Archive of obsolete content
<tt>npobj</tt> The object on which a value is to be set. <tt>propertyName</tt> A string identifier indicating the name of the property whose value is to be set. ...
...<tt>npobj</tt> The object on which a value is to be set. <tt>propertyName</tt> A string identifier indicating the name of the property whose value is to be set. ...
NPVariant - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary NPVariant is a struct that holds a value and the type of that value. The value is held in a union, and the type is one of types defined in the NPVariantType enumeration. Syntax typedef struct _NPVariant { NPVariantType type; union { bool boolValue; int32_t intValue; double_t doubleValue; NPString stringValue; NPObject *objectValue; } value; } NPVariant; Fields The data structure has the following fields: type A member of the NPVariantType enumeration specifying the data type contained in the NPVariant. value The value contained in the NPVariant structure. It may be a boolean, integer, double, string, or object, depending on the variant type. JavaScript type to NPVariantType enumeration mapping...
... NPVARIANT_IS_OBJECT() Evaluates to true if v is of type NPVariantType_Object. NPVARIANT_TO_BOOLEAN() Extracts the boolean value from v. NPVARIANT_TO_INT32() Extracts a signed 32-bit integer value from v. NPVARIANT_TO_DOUBLE() Extracts a double precision floating point value from v. NPVARIANT_TO_STRING() Extracts the NPString value from v. NPVARIANT_TO_OBJECT() Extracts the NPObject value from v. VOID_TO_NPVARIANT() Initialize v to a variant of type NPVariantType_Void. NULL_TO_NPVARIANT() Initialize v to a variant of type NPVariantType_Null. BOOLEAN_TO_NPVARIANT() Initialize v to a variant of type NPVariantType_Bool with the value val. INT32_TO_NPVARIANT() Initialize v to a variant of type NPVariantType_Int32 with the value val. DOUBLE_TO_NPVARIANT() Init...
Index of archived content - Archive of obsolete content
NPN_ReleaseVariantValue NPN_ReloadPlugins NPN_RemoveProperty NPN_RequestRead NPN_RetainObject NPN_SetException NPN_SetProperty NPN_SetValue NPN_SetValueForURL NPN_Status NPN_UTF8FromIdentifier NPN_UserAgent NPN_Version NPN_Write NPObject NPP NPPVariable NPP_Destroy NPP_DestroyStream NPP_GetValue NPP_HandleEvent NPP_New NPP_NewStream NPP_Print NPP_SetValue NPP_SetWindow NPP_StreamAsFile NPP_URLNotify NPP_Write NPP_WriteReady NPPrint ...
External resources for plugin creation - Archive of obsolete content
long time, and there have been many attempts to distill down useful information on creating them: ColonelPanic.net Building a Firefox plugin - part one: Discusses the difference between NPAPI and NPRuntime and summarizes the basic APIs needed to create a plugin Building a Firefox plugin - part two: Discusses the basic lifecycle of a NPAPI plugin Building a Firefox plugin - part three: Discusses NPObjects and how to use them Memory Management in NPAPI: Discusses how memory is managed in a NPAPI plugin Browser Plugins vs Extensions (Add-ons) -- the difference: Discusses the oft-misunderstood difference between a plugin and an extension Wikipedia NPAPI: History and general information about NPAPI Plugins and Extensions: The general difference between them Boom Swagger Boom Writing an NPAPI Plug...
NPN_CreateObject - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary Allocates a new NPObject. Syntax #include <npruntime.h> NPObject *NPN_CreateObject(NPP npp, NPClass *aClass); Parameters The function has the following parameters: <tt>npp</tt> The NPP indicating which plugin wants to instantiate the object. <tt>aClass</tt> The class to instantiate an object of. Returns The newly-allocated NPObject. Description If the given NPClass provides an allocate function it is used to allocate the storage for the object and the NPP argument passed to NPN_CreateObject() is passed along to that function. If no allocate function is provided, malloc() is called to allocate enough memory to hold an NPObject. The newly created NPObject's reference count is initialized to 1 before it is returned. ...
NPN_Enumerate - Archive of obsolete content
npobj The object of which the properties and methods are to be retrieved. identifiers A pointer to receive a pointer to the start of an array of string identifiers of the names of the properties and methods of npobj. ...
NPN_Evaluate - Archive of obsolete content
npobj The scope object. script The script to evaluate. result On return, contains the value returned by the script. Can't be NULL. Returns true if the script was evaluated successfully, otherwise false. ...
NPN_GetProperty - Archive of obsolete content
<tt>npobj</tt> The object from which a value is to be retrieved. <tt>propertyName</tt> A string identifier indicating the name of the property whose value is to be retrieved. <tt>result</tt> On return, contains the value of the specified property. ...
NPN_Invoke - Archive of obsolete content
npobj The object on which to invoke a method. methodName A string identifier indicating the name of the method to invoke. args An array of arguments to pass to the method. argCount The number of arguments in the args array. result A pointer to an NPVariant to receive the result returned by the method. ...
NPN_ReleaseObject - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary Decrements the reference count of the given NPObject. If the reference count reaches 0, the NPObject is deallocated by calling its deallocate function if one is provided; if one is not provided, free() is used. Syntax #include <npruntime.h> void NPN_ReleaseObject(NPObject *npobj); Parameters The function has the following parameter: <tt>npobj</tt> The NPObject whose reference count should be decremented. Returns Nothing. ...
NPN_RetainObject - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary Increments the reference count of the given NPObject. Syntax #include <npruntime.h> NPObject *NPN_RetainObject(NPObject *npobj); Parameters The function has the following parameter: npobj The NPObject to retain. Returns A pointer back to the same object. ...
NPN_SetException - Archive of obsolete content
<< Gecko Plugin API Reference << Scripting plugins Summary A plugin can call this function to indicate that a call to one of the plugin's NPObjects generated an error. Syntax #include <npruntime.h> void NPN_SetException(NPObject *npobj, const NPUTF8 *message); Parameters The function has the following parameters: <tt>npobj</tt> The object on which the exception occurred. <tt>message</tt> A UTF-8 string describing the error that occurred. Returns Nothing. ...
NPN_SetValue - Archive of obsolete content
Returns If successful, the function should return NPERR_NO_ERROR. If unsuccessful, the function should return the most relevant NPAPI error code. For possible values, see Error Codes. Description A good place to set plugin operation mode such as windowless mode is NPP_New, so the browse...
Constants - Plugins
ME_SCRIPTING 14 Plug-in is scriptable using NPRuntime. NPVERS_HAS_FORM_VALUES 15 NPPVformValue NPPVariables are supported. NPVERS_HAS_POPUPS_ENABLED_STATE 16 The NPN_PushPopupsEnabledState() and NPN_PopPopupsEnabledState() functions are supported. NPVERS_HAS_RESPONSE_HEADERS 17 NPStreams have response headers for HTTP streams. NPVERS_HAS_NPOBJECT_ENUM 18 The NPClass in question has an enumerate field, which lets you enumerate the properties of an NPObject of that class. << Previous ...
Gecko Plugin API Reference - Plugins
Threading model Security model What's in the plugin code? ...