aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
index 47e3a72..95c3f3a 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js
@@ -50,6 +50,21 @@ export function hubOrigin() {
return (base ? new URL(base).origin : window.location.origin);
}
+/**
+ * The legal pages of the hub in use — its terms of use and privacy statement,
+ * which are its operator's to write. A browser's own hub, or the configured one
+ * in the app, like `hubBase()`: a link to meshbay.org's would show somebody
+ * signing up elsewhere the commitments of an operator who is not theirs.
+ *
+ * Opened in a new tab wherever it is linked: the application refuses to
+ * navigate away from its interface and hands a new window to the system browser
+ * instead, and in a browser it keeps the session — or a half-filled sign-up
+ * form — on screen.
+ */
+export function legalUrl() {
+ return `${hubBase().replace(/\/$/, '')}/legal/`;
+}
+
/** Native-only capabilities. A browser renders none of what these gate. */
export const capabilities = {
// Install, configure and drive a node running on this machine.
@@ -759,7 +774,7 @@ export async function nativeKeys() {
return Boolean(keys && await keys.available());
}
-export default { isNative, hubBase, capabilities, secrets, nativeSave,
+export default { isNative, hubBase, legalUrl, capabilities, secrets, nativeSave,
apiFetch, device, bridgeMessage, folder, rootPicker, node,
cast, minimizeToTray, setTrayLabels, setUiLocale, keys, nativeKeys };