4
edits
(Proposal for three new NPVariant Types: NPArray, NPDictionary, and NPByteArray) |
(Refactored the overview to hopefully be more readable) |
||
Line 13: | Line 13: | ||
The use of javascript has dramatically improved and changed over the years since NPRuntime was created, but the data types supported by NPRuntime have remained about the same, supporting only one non-primitive type and without any way to return binary data to the page. In order for a plugin to interact with javascript in a natural way and fully utilize all features of a modern browser there are three datatypes that should be added to the NPVariant structure. | The use of javascript has dramatically improved and changed over the years since NPRuntime was created, but the data types supported by NPRuntime have remained about the same, supporting only one non-primitive type and without any way to return binary data to the page. In order for a plugin to interact with javascript in a natural way and fully utilize all features of a modern browser there are three datatypes that should be added to the NPVariant structure. | ||
With the | == Binary data == | ||
With the introduction of the HTML5 Canvas and other related technologies there is now a strong use case for passing binary data into Javascript. While there doesn't seem to be a clear choice for what type of data structure in javascript should handle this, the options seem to all have a fairly similar interface at least for querying the data. If a datatype were added to NPRuntime to support a binary array of data, each browser and javascript engine could implement the specifics using whatever data type is most appropriate in their environment, with the most basic option being a javascript array of integers. | |||
== Array and dictionary (key/value) data == | |||
An even more pressing and more common need is the need to return javascript arrays or objects that act as a key/value dictionary. Current solutions exist: | An even more pressing and more common need is the need to return javascript arrays or objects that act as a key/value dictionary. Current solutions exist: |
edits