mozilla/addon-sdk — pull request #351 by louisremi (2012-02-27 16:20:04+00:00)
Title: Add property to provide JSON set of global variables for initial state of content scripts

Here's a naïve tentative to fix [#688127](https://bugzilla.mozilla.org/show_bug.cgi?id=688127)

It doesn't exactly follows the API proposed in the bug because I thought it would be cleaner to create a single global var.

I didn't know how to sanitize that global object so I used `JSON.parse( JSON.stringify( state ) )`, although I'm pretty sure there's a better way to do that.

I'm willing to write unit tests but I thought I should send you the code for review beforehand.

Thank you in advance!