Boris Zbarsky wrote:

On 3/17/14 9:25 AM, Benjamin Smedberg wrote:

Do we not have a safe way now to expose objects and functions to pages (all pages or some pages)?

We have a way that can be safe as long as you're really careful about some things. e.g. if your API takes options objects, you have to realize that you might invoke arbitrary page script any time you touch the options object.

Let's suppose that I want to provide a global property that provides 5 functions each with a number of string arguments. (Traditionally this would be done using a component in the JavaScript global property category.) How would this way work? (Ideally the object backing the property would only be created on demand, and would have access to the window in question, but a singleton object that was available to all globals is acceptable.)

--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to