Visit Mozilla.org

NPN Evaluate

From MDC


« Gecko Plugin API Reference « Scripting plugins

Contents

[edit] Summary

Evaluates a script in the scope of the specified NPObject.

[edit] Syntax

#include <npruntime.h>
 
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
                  NPVariant *result);

[edit] Parameters

The function has the following parameters:

npp
The NPP indicating which plugin instance's window to evaluate the script in.
script
The script to evaluate.
result
On return, contains the value returned by the script.

[edit] Returns

true if the script was evaluated successfully, otherwise false.

[edit] Description

The script is evaluated in the context of the window that the calling plugin instance (the npp argument) is loaded in.

Note: The caller must call NPN_ReleaseVariantValue() to release the returned value when it's no longer needed.