The selected worker will implement a HTML page containing a custom javascript console that can be used to interact with a particular HTML element of that page (referred to as "{elem}" from now on).
This console will rely on the browser's standard javascript interpreter as a backend. It (and the sample HTML page using it) will only provide a special frontend with a few features:
1. Logging of (only) successful commands to a separate part of the page
2. A mechanism for "clearing" the console and the log of all their 'history', and reloading {elem} so that it is in a fresh state for new javascript input.
3. Display of a special message (outside the console - possibly containing HTML and not just plain text) prior to each line of input. This message should be customisable from when the console is initialised, to every time there is a new line of input (using some sort of callback, which can update the message - or trigger other updates on the page - based on one or more of these factors:
* Whether or not the previous line(s) of input was interpreted successfully
* The text of the previous line(s) of input
* The result of the previous line(s) of input (for example, the result of the expression 1+1 would be 2)
* The state of {elem}
4. Each 'special message' should have an associated flag, 'logged', so that the callback function can specify whether each update to the message should be logged along with successfull commands.
Nothing special should be done to make the page or console look good. Stylesheets will be made later. You may use MIT/BSD-licensed third-party code if it will help you finish more quickly.
Let me know if any potential security vulnerabilities stand out to you that should be accounted for in the implementation