1,007
edits
Line 136: | Line 136: | ||
== webContent == | == webContent == | ||
The webContent object is used to fill in the content of the experiment status page, which lives on the client side as part of the extension. It's at the url chrome://testpilot/content/status.html . webContent must contain the following properties: | |||
* inProgressHtml: A string containing a chunk of html that will be slotted into the status page while the test in in progress. | |||
* completedHtml: A string containing a different chunk of html that will be slotted into the status page after the test is complete. | |||
* upcomingHtml: A string containing a different chunk of html that will be slotted into the status page before the test begins (not yet implemented on the client). | |||
* onPageLoad: A function, that will be called when the status page has loaded. This can do whatever the experiment needs to do to finish rendering the page. For example, it can pull data from the data store and draw graphs on canvas elements. | |||
The onPageLoad function will be called with the following arguments: | |||
onPageLoad(experiment, document, graphUtils); | |||
The values of these arguments are as follows: | |||
* experiment: reference the 'live' experiment object itself. This reference can be used to get the contents of the data store (as CSV or as JSON), to check the experiment status, etc. etc. TODO: document public API of experiment object | |||
* document: the status page document, the one you are running in. Because this code is in a securable-module context, the document reference would not otherwise be available. It's provided in case you want to do "document.getElementById" or whatever. | |||
* graphUtils: a simple graphing library object containing methods drawTimeSeriesGraph() and drawPieChart(). TODO: Document how to use these methods. | |||
== Observer == | == Observer == |
edits