solidusjs/devtools-solidus — pull request #6 by josiahsprague (2014-06-24 17:57:05+00:00)
Title: Run only on solidus

The purpose of this pull request is to address issue #4.

I made a bunch of improvements to how messaging between pages works. Moved message processing to devpanel.js, and the messages passed from background.js are now all JSON objects to make it easier to pass complex information consistently.

With this update the plugin won't initialize InspectorJSON if the inspected window isn't a Solidus page, and if InspectorJSON was already initialized on a previously inspected page, navigating to a non Solidus page will invoke `inspector.destroy()`. Whether or not a page is a Solidus page is determined by whether or not there is JSON with a `page` key at the expected route. (See #4 for my thoughts behind that.) It might make sense to add another key to the JSON that is more specific to Solidus, since the expected JSON route and `page` key could conceivably be used by other platforms and cause unexpected behavior.

This update also adds a messaging panel that gives the user some information about the current status of the plugin. Styling of the message panel will be tackled with issue #2.