From 9ef7c420973ebc23c8791381d808912a84f3a02c Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 1 Jun 2018 17:43:01 -0700 Subject: [PATCH] Add link to terms and privacy policy in about window --- _locales/en/messages.json | 4 ++++ about.html | 9 +++++++-- about_preload.js | 15 +++++++++++++++ main.js | 3 ++- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 about_preload.js diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 61a61a36f5a4..b608a2e63a8a 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1,4 +1,8 @@ { + "privacyPolicy": { + "message": "Terms & Privacy Policy", + "description": "Shown in the about box for the link to https://signal.org/legal" + }, "mainMenuFile": { "message": "&File", "description": "The label that is used for the File menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt- combination." diff --git a/about.html b/about.html index 861110b2ebc6..b638426f3c67 100644 --- a/about.html +++ b/about.html @@ -11,8 +11,7 @@ body { } img { - margin-top: 2em; - margin-bottom: 1em; + margin-top: 1em; } a { @@ -47,6 +46,10 @@ a {
signal.org
+
+
+ Terms & Privacy Policy +
diff --git a/about_preload.js b/about_preload.js new file mode 100644 index 000000000000..0c5b164fda66 --- /dev/null +++ b/about_preload.js @@ -0,0 +1,15 @@ +const { ipcRenderer } = require('electron'); +const url = require('url'); +const i18n = require('./js/modules/i18n'); + +const config = url.parse(window.location.toString(), true).query; +const { locale } = config; +const localeMessages = ipcRenderer.sendSync('locale-data'); + +window.getEnvironment = () => config.environment; +window.getVersion = () => config.version; +window.getAppInstance = () => config.appInstance; + +window.closeAbout = () => ipc.send('close-about'); + +window.i18n = i18n.setup(locale, localeMessages); diff --git a/main.js b/main.js index c76474c8acb5..ee96eb787f7b 100644 --- a/main.js +++ b/main.js @@ -419,7 +419,8 @@ function showAbout() { webPreferences: { nodeIntegration: false, nodeIntegrationInWorker: false, - preload: path.join(__dirname, 'preload.js'), + preload: path.join(__dirname, 'about_preload.js'), + // sandbox: true, nativeWindowOpen: true, }, parent: mainWindow,