This happens in the following case:
1. Start the browser
2. Load the page without triggering a worker reinstall (ie. the worker
must not have changed since last test)
3. Worker is up but doesn't go through activation sequence
In this case we don't have an IRC client with a websocket. We generate
one dynamically once a shoutbox handshakes the worker.
Also removes the IRCClient message-passing-style API since the service
worker will mutualize connections and thus interpret stuff like
"connect" differently.
This is getting messy, there is a real need to refactor and extend the
"IRC client state" so that
1. There is less state in the shoutbox page, instead more should come
from the IRC client state (which updates pretty frequently)
2. The protocol is cleaner
Because currently if you disconnect from one page the others don't
necessarily show the proper tabs, etc.
- Demote v5shoutbox_irc.js from a module to a script, because loading
modules from a service worker is very poorly supported
- Move IRCClientState to the top level so that the state info in
messages is a raw object instead (which is structured-cloneable)
- For the same reason, replace the symbol-based enum with integers
- HACK: service worker enumerates clients at activation time and never
updates the list
The hack implies that this only works if the client gets installed by
the action of loading the page. But at least we can use the shoutbox, so
it's a start. This will be cleaned up soon.
* More room pseudo pseudos when the screen is large enough
* Improve header behavior when screen is small: force ellipsis on
channel description, keep buttons visible, allow multiple rows if
buttons themselves don't fit
* Standalone page is completely independent from v5
* Update widget.html to match index.html
* Change the message input from .message to .message-input to avoid
collision with styles for actual div.message lines
* Make sure message input always takes the full page width
* Don't use IDs as they would collide with v5 templates
* Shorter padding specification on bottom form
* Add autocomplete="off" so browser doesn't remember previous messages
* Remove useless name attributes in message form
IRC client's interface is now by message passing with state updates and
other events. Only missing part is to also use messages to send requests
from the shoutbox to the client, which will come soon.
This setup will allow wrapping the IRC client in a service worker and
service the client's API over the worker's message pipe.
This change also moves the "current channel" tracking to the shoutbox,
since it ended up being unused in the client (only get/set!). This
cleans some of the mess of letting the client know about pseudo-channels
like "\log" and "\login".