mirror of
https://github.com/element-hq/element-desktop.git
synced 2026-01-03 13:07:55 -05:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf2925853c | ||
|
|
e4aab36428 | ||
|
|
d106d23e2e | ||
|
|
aaa3e71077 | ||
|
|
b9d00395ed | ||
|
|
00cf95e86b | ||
|
|
e56311fc06 | ||
|
|
2e907b6e36 | ||
|
|
c82c80a2e0 | ||
|
|
20fb0f477b | ||
|
|
c6620735b4 | ||
|
|
27b7db2b30 | ||
|
|
d33ce95dd0 | ||
|
|
be30a2fbab | ||
|
|
66d9204578 | ||
|
|
ba0518005e | ||
|
|
b543a2e496 | ||
|
|
91b4987d52 | ||
|
|
a568d766b0 | ||
|
|
9635047c49 | ||
|
|
1d339123e7 | ||
|
|
0f6a42e250 | ||
|
|
6e7919c6a0 | ||
|
|
0269501d4f | ||
|
|
9b9b2ee847 | ||
|
|
f9c8aa1753 | ||
|
|
96d272f76b | ||
|
|
3e8feef642 | ||
|
|
48ab056785 | ||
|
|
c3fde65a1b | ||
|
|
829451c4c4 | ||
|
|
1cd23edb80 | ||
|
|
d73915e8f2 | ||
|
|
7ceaa4fd8e |
32
CHANGELOG.md
32
CHANGELOG.md
@@ -1,3 +1,35 @@
|
||||
Changes in [1.6.3](https://github.com/vector-im/riot-desktop/releases/tag/v1.6.3) (2020-06-04)
|
||||
==============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-desktop/compare/v1.6.3-rc.1...v1.6.3)
|
||||
|
||||
|
||||
Changes in [1.6.3-rc.1](https://github.com/vector-im/riot-desktop/releases/tag/v1.6.3-rc.1) (2020-06-02)
|
||||
========================================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-desktop/compare/v1.6.2...v1.6.3-rc.1)
|
||||
|
||||
* Fix electron context menu copy/save-as
|
||||
[\#96](https://github.com/vector-im/riot-desktop/pull/96)
|
||||
* Fixed error in README.md/User-specified config.json
|
||||
[\#97](https://github.com/vector-im/riot-desktop/pull/97)
|
||||
* Update Modular hosting link
|
||||
[\#92](https://github.com/vector-im/riot-desktop/pull/92)
|
||||
* Enforce sandbox on all spawned BrowserWindow objects
|
||||
[\#91](https://github.com/vector-im/riot-desktop/pull/91)
|
||||
* Run before-quit on updates too to flush rageshake
|
||||
[\#93](https://github.com/vector-im/riot-desktop/pull/93)
|
||||
* Enable new room list labs flag
|
||||
[\#87](https://github.com/vector-im/riot-desktop/pull/87)
|
||||
* Add asar-webapp script
|
||||
[\#59](https://github.com/vector-im/riot-desktop/pull/59)
|
||||
* Bump acorn from 6.4.0 to 6.4.1
|
||||
[\#50](https://github.com/vector-im/riot-desktop/pull/50)
|
||||
* Enable font scaling flag for nightly
|
||||
[\#89](https://github.com/vector-im/riot-desktop/pull/89)
|
||||
* Enable IRC UI labs flag in nightly
|
||||
[\#88](https://github.com/vector-im/riot-desktop/pull/88)
|
||||
* Update help message to fix broken url to electron docs
|
||||
[\#86](https://github.com/vector-im/riot-desktop/pull/86)
|
||||
|
||||
Changes in [1.6.2](https://github.com/vector-im/riot-desktop/releases/tag/v1.6.2) (2020-05-22)
|
||||
==============================================================================================
|
||||
[Full Changelog](https://github.com/vector-im/riot-desktop/compare/v1.6.1...v1.6.2)
|
||||
|
||||
@@ -129,7 +129,7 @@ User-specified config.json
|
||||
|
||||
+ `%APPDATA%\$NAME\config.json` on Windows
|
||||
+ `$XDG_CONFIG_HOME\$NAME\config.json` or `~/.config/$NAME/config.json` on Linux
|
||||
+ `~Library/Application Support/$NAME/config.json` on macOS
|
||||
+ `~/Library/Application Support/$NAME/config.json` on macOS
|
||||
|
||||
In the paths above, `$NAME` is typically `Riot`, unless you use `--profile
|
||||
$PROFILE` in which case it becomes `Riot-$PROFILE`.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "riot-desktop",
|
||||
"productName": "Riot",
|
||||
"main": "src/electron-main.js",
|
||||
"version": "1.6.2",
|
||||
"version": "1.6.3",
|
||||
"description": "A feature-rich client for Matrix.org",
|
||||
"author": "New Vector Ltd.",
|
||||
"repository": {
|
||||
@@ -14,6 +14,7 @@
|
||||
"scripts": {
|
||||
"mkdirs": "mkdirp packages deploys",
|
||||
"fetch": "yarn run mkdirs && node scripts/fetch-package.js",
|
||||
"asar-webapp": "asar p webapp webapp.asar",
|
||||
"start": "electron .",
|
||||
"lint": "eslint src/ scripts/ hak/",
|
||||
"build:native": "yarn run hak",
|
||||
@@ -47,7 +48,7 @@
|
||||
"find-npm-prefix": "^1.0.2",
|
||||
"fs-extra": "^8.1.0",
|
||||
"glob": "^7.1.6",
|
||||
"matrix-js-sdk": "6.1.0",
|
||||
"matrix-js-sdk": "6.2.0",
|
||||
"mkdirp": "^1.0.3",
|
||||
"needle": "^2.3.2",
|
||||
"node-pre-gyp": "^0.14.0",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"https://scalar-staging.vector.im/api",
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"hosting_signup_link": "https://modular.im/?utm_source=riot-web&utm_medium=web",
|
||||
"hosting_signup_link": "https://modular.im/services/matrix-hosting-riot?utm_source=riot-web&utm_medium=web",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"features": {
|
||||
"feature_pinning": "labs",
|
||||
@@ -23,7 +23,10 @@
|
||||
"feature_dm_verification": "labs",
|
||||
"feature_bridge_state": "labs",
|
||||
"feature_presence_in_room_list": "labs",
|
||||
"feature_custom_themes": "labs"
|
||||
"feature_custom_themes": "labs",
|
||||
"feature_new_room_list": "labs",
|
||||
"feature_irc_ui": "labs",
|
||||
"feature_font_scaling": "labs"
|
||||
},
|
||||
"piwik": {
|
||||
"url": "https://piwik.riot.im/",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"https://scalar-staging.vector.im/api",
|
||||
"https://scalar-staging.riot.im/scalar/api"
|
||||
],
|
||||
"hosting_signup_link": "https://modular.im/?utm_source=riot-web&utm_medium=web",
|
||||
"hosting_signup_link": "https://modular.im/services/matrix-hosting-riot?utm_source=riot-web&utm_medium=web",
|
||||
"bug_report_endpoint_url": "https://riot.im/bugreports/submit",
|
||||
"roomDirectory": {
|
||||
"servers": [
|
||||
|
||||
@@ -82,7 +82,7 @@ if (argv["help"]) {
|
||||
console.log(" --hidden: Start the application hidden in the system tray.");
|
||||
console.log(" --help: Displays this help message.");
|
||||
console.log("And more such as --proxy, see:" +
|
||||
"https://electronjs.org/docs/api/chrome-command-line-switches#supported-chrome-command-line-switches");
|
||||
"https://electronjs.org/docs/api/command-line-switches");
|
||||
app.exit();
|
||||
}
|
||||
|
||||
@@ -615,6 +615,17 @@ protocol.registerSchemesAsPrivileged([{
|
||||
},
|
||||
}]);
|
||||
|
||||
// Turn the sandbox on for *all* windows we might generate. Doing this means we don't
|
||||
// have to specify a `sandbox: true` to each BrowserWindow.
|
||||
//
|
||||
// This also fixes an issue with window.open where if we only specified the sandbox
|
||||
// on the main window we'd run into cryptic "ipc_renderer be broke" errors. Turns out
|
||||
// it's trying to jump the sandbox and make some calls into electron, which it can't
|
||||
// do when half of it is sandboxed. By turning on the sandbox for everything, the new
|
||||
// window (no matter how temporary it may be) is also sandboxed, allowing for a clean
|
||||
// transition into the user's browser.
|
||||
app.enableSandbox();
|
||||
|
||||
app.on('ready', async () => {
|
||||
try {
|
||||
await setupGlobals();
|
||||
@@ -725,7 +736,7 @@ app.on('ready', async () => {
|
||||
webPreferences: {
|
||||
preload: preloadScript,
|
||||
nodeIntegration: false,
|
||||
sandbox: true,
|
||||
//sandbox: true, // We enable sandboxing from app.enableSandbox() above
|
||||
enableRemoteModule: false,
|
||||
// We don't use this: it's useful for the preload script to
|
||||
// share a context with the main page so we can give select
|
||||
@@ -790,12 +801,15 @@ app.on('activate', () => {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
app.on('before-quit', () => {
|
||||
function beforeQuit() {
|
||||
global.appQuitting = true;
|
||||
if (mainWindow) {
|
||||
mainWindow.webContents.send('before-quit');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
app.on('before-quit', beforeQuit);
|
||||
app.on('before-quit-for-update', beforeQuit);
|
||||
|
||||
app.on('second-instance', (ev, commandLine, workingDirectory) => {
|
||||
// If other instance launched with --hidden then skip showing window
|
||||
|
||||
@@ -35,10 +35,27 @@ function onWindowOrNavigate(ev, target) {
|
||||
safeOpenURL(target);
|
||||
}
|
||||
|
||||
function writeNativeImage(filePath, img) {
|
||||
switch (filePath.split('.').pop().toLowerCase()) {
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
return fs.promises.writeFile(filePath, img.toJPEG(100));
|
||||
case "bmp":
|
||||
return fs.promises.writeFile(filePath, img.toBitmap());
|
||||
case "png":
|
||||
default:
|
||||
return fs.promises.writeFile(filePath, img.toPNG());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onLinkContextMenu(ev, params) {
|
||||
let url = params.linkURL || params.srcURL;
|
||||
|
||||
if (url.startsWith('vector://vector/webapp')) {
|
||||
// Avoid showing a context menu for app icons
|
||||
if (params.hasImageContents) return;
|
||||
// Rewrite URL so that it can be used outside of the app
|
||||
url = "https://riot.im/app/" + url.substring(23);
|
||||
}
|
||||
|
||||
@@ -53,22 +70,13 @@ function onLinkContextMenu(ev, params) {
|
||||
}));
|
||||
}
|
||||
|
||||
let addSaveAs = false;
|
||||
if (params.mediaType && params.mediaType === 'image' && !url.startsWith('file://')) {
|
||||
if (params.hasImageContents) {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: '&Copy image',
|
||||
click() {
|
||||
if (url.startsWith('data:')) {
|
||||
clipboard.writeImage(nativeImage.createFromDataURL(url));
|
||||
} else {
|
||||
ev.sender.copyImageAt(params.x, params.y);
|
||||
}
|
||||
ev.sender.copyImageAt(params.x, params.y);
|
||||
},
|
||||
}));
|
||||
|
||||
// We want the link to be ordered below the copy stuff, but don't want to duplicate
|
||||
// the `if` statement, so use a flag.
|
||||
addSaveAs = true;
|
||||
}
|
||||
|
||||
// No point offering to copy a blob: URL either
|
||||
@@ -91,12 +99,14 @@ function onLinkContextMenu(ev, params) {
|
||||
}
|
||||
}
|
||||
|
||||
if (addSaveAs) {
|
||||
// XXX: We cannot easily save a blob from the main process as
|
||||
// only the renderer can resolve them so don't give the user an option to.
|
||||
if (params.hasImageContents && !url.startsWith('blob:')) {
|
||||
popupMenu.append(new MenuItem({
|
||||
label: 'Sa&ve image as...',
|
||||
click() {
|
||||
async click() {
|
||||
const targetFileName = params.titleText || "image.png";
|
||||
const filePath = dialog.showSaveDialog({
|
||||
const {filePath} = await dialog.showSaveDialog({
|
||||
defaultPath: targetFileName,
|
||||
});
|
||||
|
||||
@@ -104,7 +114,7 @@ function onLinkContextMenu(ev, params) {
|
||||
|
||||
try {
|
||||
if (url.startsWith("data:")) {
|
||||
fs.writeFileSync(filePath, nativeImage.createFromDataURL(url));
|
||||
await writeNativeImage(filePath, nativeImage.createFromDataURL(url));
|
||||
} else {
|
||||
request.get(url).pipe(fs.createWriteStream(filePath));
|
||||
}
|
||||
|
||||
14
yarn.lock
14
yarn.lock
@@ -115,9 +115,9 @@ acorn-jsx@^5.0.0:
|
||||
integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==
|
||||
|
||||
acorn@^6.0.7:
|
||||
version "6.4.0"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
|
||||
integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==
|
||||
version "6.4.1"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
|
||||
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
|
||||
|
||||
agent-base@4, agent-base@^4.3.0:
|
||||
version "4.3.0"
|
||||
@@ -2862,10 +2862,10 @@ map-age-cleaner@^0.1.1:
|
||||
dependencies:
|
||||
p-defer "^1.0.0"
|
||||
|
||||
matrix-js-sdk@6.1.0:
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0.tgz#c28ad67c113c4aa9c8bce409c7ba550170bdc2ee"
|
||||
integrity sha512-N+vCgxWORvhh7AGyWZlU5Z2brojbbnHnWlMkBF6JjWe6a+pfpjmRKp5/jeQpOz6yfe56sIQvU7ikBZl3JjlMiw==
|
||||
matrix-js-sdk@6.2.0:
|
||||
version "6.2.0"
|
||||
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.2.0.tgz#b1aa6f23858ab3ee4b66be25d3e854f6e287d36b"
|
||||
integrity sha512-dpx1EuJ98HtqE2YUeliTe9xjMOJlicJGRXa06Gr8RAL6WJM7buPgodOk0tRs461LzeilxmymqcGaB4og6o9RxA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.8.3"
|
||||
another-json "^0.2.0"
|
||||
|
||||
Reference in New Issue
Block a user