bridge: Fix use of 0 instead of NULL

Although correct, this is confusing when reading code.

Closes #1422
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
shell, base: Implement cockpit.location in base package

Move the hash tracking and setting API to a new cockpit.location
API in the base module.

Also, move the old cockpit.location temporarily out of the way.

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Made the API a lot like window.location
 * Handle relative paths and dots in paths
 * Use window.onhashchanged for events
 * Use location.go() for delayed change logic
 * Task switching will happen in another API

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
shell: Use new API for hash tracking and setting

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Updated for cockpit.location API
base: Remove debugging output.

Closes #1417
test: Properly wait until iframe is loaded before switching to it.

Reviewed-by: Stef Walter <stefw@redhat.com>
shell: Load external pages from target host

Closes #1371
Closes #1420

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Changed to use new cockpit.location API
static: Show the requisite that's missing to run Cockpit

When declaring the browser too old to run Cockpit, show the
thing that's missing as a clue. It turns out some browsers
don't even have console.log() or fail to send it somewhere
useful.

Related to #1408
Closes #1419
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
base: Add test-framed.html to 'make check'

These tests were implemented before but never didn't make it into
the automated testing.

Closes #1423
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
websocket: The protocol can be chosen until halfway through handshake

Allow choosing the protocol as late as possible. It could depend on
other factors such as the flavor of WebSocket standard being spoken.

Closes #1424
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
websocket: The WebSocketConnection flavor property is readable

Closes #1425
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
common: Expose name of CockpitPipe via accessor method

Closes #1426
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Move UTF8 validation to CockpitChannel

This allows multiple channels to take advantage of this. For
channels that are sure they're producing valid UTF8, there's a
flag so we don't have to recheck everything.

Closes #1428
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
base: Expose client of DBusProxy, DBusProxies, and options of DBusClient

Closes #1413
Reviewed-by: Stef Walter <stefw@redhat.com>
ws: Removed socket dependency in cockpit.service

Because it was started by service, but ster stop of service, socket
still running and blocking the 9090 port

Closes #1429
Reviewed-by: Stef Walter <stefw@redhat.com>
bridge: Workaround temporary issue with UTF8 validation

We're not properly indicating that the resource1 channels are
binary channels ... that work is on another branch.

So work around this for now by lying to cockpit_channel_send()

Closes #1430
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
shell: Handle modern DBusClient in hostname_for_display

Reviewed-by: Stef Walter <stefw@redhat.com>
shell: Simplify HTML

Mostly, move the top navbar out of #content.

Reviewed-by: Stef Walter <stefw@redhat.com>
shell: Host switcher

Reviewed-by: Stef Walter <stefw@redhat.com>
shell: Hide navigation when showing the dashboard

Reviewed-by: Stef Walter <stefw@redhat.com>
shell: Ensure that the plots resize when the host switcher toggles

Closes #1409
Reviewed-by: Stef Walter <stefw@redhat.com>