Compare commits

...

52 Commits

Author SHA1 Message Date
RiotRobot
1bdef576fa v1.11.85 2024-11-12 09:48:27 +00:00
RiotRobot
3116566e75 v1.11.84 2024-11-05 14:05:14 +00:00
RiotRobot
a8f3119879 v1.11.84-rc.0 2024-10-29 13:07:15 +00:00
RiotRobot
4dc525c8fc Merge branch 'master' into develop 2024-10-29 09:49:31 +00:00
RiotRobot
6ff9712d8b v1.11.83 2024-10-29 09:48:55 +00:00
ElementRobot
972b594687 [Backport staging] Enable Element Call by default on release instances (#1954)
(cherry picked from commit 7b5019e97a)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-28 14:32:14 +00:00
Michael Telatynski
7b5019e97a Enable Element Call by default on release instances (#1953) 2024-10-28 14:18:11 +00:00
Michael Telatynski
e09be4ee37 Update way of passing notarization team id to workflow (#1951) 2024-10-25 12:17:31 +01:00
ElementRobot
dceb7e352e Merge pull request #1950 from element-hq/actions/localazy-download
Localazy Download
2024-10-25 07:26:36 +01:00
t3chguy
5b25dc225b [create-pull-request] automated change 2024-10-25 06:06:36 +00:00
RiotRobot
cecbc7513f Merge branch 'master' into develop 2024-10-22 12:25:57 +00:00
RiotRobot
77a7fa3ab2 v1.11.82 2024-10-22 12:25:20 +00:00
Michael Telatynski
f757085951 Prettier 2024-10-22 12:22:55 +01:00
Michael Telatynski
c885c098bb Add flatpak button for issue reporting 2024-10-22 12:19:09 +01:00
Will Hunt
7b669a8313 Support specifying the config location manually (outside of the user's profile) (#1921)
* Add support for loading the config from a given config location.

* Support using an env variable too.

* Add docs.

* Add test for configuration arguments

* remove .only
2024-10-17 13:26:35 +01:00
Michael Telatynski
7886e4c604 Pin GHA runner versions (#1938) 2024-10-17 10:54:00 +01:00
Florian Duros
4405f5dcf4 Merge pull request #1934 from element-hq/revert-1804-trayicons
Revert "Add monochrome tray icon"
2024-10-17 10:52:44 +02:00
renovate[bot]
86345cd42a Update dependency ubuntu to v24 (#1937)
* Update dependency ubuntu to v24

* Fix nightly / release building

Unsure what would have changed here but electron doesn't seem to like
even giving its version without a setuid sandbox helper now.

* Update snapshot

Presumably some minor aliasing difference somehow

* Update snapshot

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-17 09:46:02 +01:00
David Langley
838cf3bd30 Merge pull request #1916 from element-hq/langleyd/fix_seshat_delete_contents
Improve seshat deleteContents
2024-10-16 22:12:54 +01:00
David Langley
58543536bc Merge branch 'develop' of github.com:vector-im/element-desktop into langleyd/fix_seshat_delete_contents 2024-10-16 21:50:33 +01:00
renovate[bot]
0edde6735f Update all non-major dependencies (#1879)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-16 16:15:09 +00:00
Florian Duros
3be6d48279 Revert "Add monochrome tray icon" 2024-10-16 17:21:49 +02:00
renovate[bot]
78b00471ff Update typescript-eslint monorepo to v8 (major) (#1843)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2024-10-16 15:59:12 +01:00
renovate[bot]
d68d024577 Update electron-builder to v25 (major) (#1861)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:01:10 +00:00
renovate[bot]
305afd5cbe Update dependency eslint-plugin-unicorn to v56 (#1932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:47:08 +01:00
renovate[bot]
e576aec17d Update playwright (#1933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:46:06 +01:00
renovate[bot]
fd36d70c16 Update babel monorepo (#1929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 13:28:30 +00:00
renovate[bot]
0963d0145e Update dependency @types/node to v18.19.55 (#1930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:28:12 +01:00
renovate[bot]
a5bf090848 Update tj-actions/changed-files digest to c3a1bb2 (#1928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:24:57 +01:00
renovate[bot]
24665bf939 Update docker (#1927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-16 14:16:41 +01:00
Michael Telatynski
2d110cdc57 Remove React SDK version from develop build output (#1925) 2024-10-16 13:32:08 +01:00
RiotRobot
f506ac0b26 v1.11.82-rc.0 2024-10-15 15:07:42 +00:00
RiotRobot
2c58c2c8b3 Merge branch 'master' into develop 2024-10-15 11:59:28 +00:00
R Midhun Suresh
2d6e087fb0 Merge commit from fork
* Check url with homeserver

* Move check to where access-token is added

* Do IPC comm sparingly

Before, the code would fetch the hs for every request.
Since this needs the whole event-handler dance, it's best we do it only
for the requests that match the media endpoints.

Also added some try..catch since we create URL objects that could
potentially throw

* Check origin instead of just hostname
2024-10-15 12:51:06 +01:00
David Baker
60d28ca3d8 Pin GHA to ubuntu 22 (#1920)
while we work out why 24 fails
2024-10-14 13:38:13 +01:00
Florian Duros
53f2884ce0 Merge pull request #1804 from SakiiCode/trayicons
Add monochrome tray icon
2024-10-14 10:44:03 +02:00
David Langley
64a1d986f9 Log errors 2024-10-11 17:24:30 +01:00
David Langley
b015d2e536 Add try catch for each unlink 2024-10-11 13:48:38 +01:00
Florian Duros
1c85ea7ddc Merge branch 'develop' into trayicons 2024-10-10 12:20:28 +02:00
RiotRobot
e4c2890d1a Merge branch 'master' into develop 2024-10-08 12:46:24 +00:00
David Baker
289947abcb Revert accidental 38d35a108b 2024-10-03 14:23:00 +01:00
David Baker
38d35a108b Force upgrade lru-cache with a resolution
Due to https://github.com/isaacs/node-lru-cache/issues/352 preventing us from upgrading typescript

Causes more warnings about the version being incompatible with what the deps want, unfortunately.

Attempt 2 with newer yarn, replaces https://github.com/element-hq/element-desktop/pull/1904
2024-10-03 14:21:34 +01:00
renovate[bot]
fc9798b726 Update dependency pacote to v19 (#1901)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-03 13:28:53 +01:00
Michael Telatynski
acc5820823 Remove legacy room header (#1896) 2024-10-02 13:11:07 +01:00
renovate[bot]
60550be905 Update dependency chokidar to v4 (#1883)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 10:00:38 +00:00
renovate[bot]
0e1a18ddbc Update dependency @types/node to v18.19.54 (#1900)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 11:00:04 +01:00
renovate[bot]
f7be65ef27 Update docker/build-push-action digest to 4f58ea7 (#1898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 10:59:24 +01:00
Sakii
c8f45ca6b5 Remove unnecessary translation string 2024-09-11 21:02:27 +02:00
Sakii
d396eab275 Circular icons 2024-09-11 18:44:48 +02:00
Sakii
2176750586 Remove context item and replace with setting 2024-09-10 21:59:50 +02:00
Sakii
967fa056a2 Change to simpler icon 2024-09-10 21:59:44 +02:00
Sakii
410f653eae Add monochrome tray icon toggle 2024-09-10 21:59:32 +02:00
40 changed files with 1847 additions and 1265 deletions

View File

@@ -1 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bug report for the Element flatpak app
url: https://github.com/flathub/im.riot.Riot/issues
about: Please file bugs with the Flatpak application on the respective repository.

View File

@@ -10,7 +10,7 @@ on:
jobs:
backport:
name: Backport
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >

View File

@@ -99,7 +99,7 @@ jobs:
- macos
- linux
- windows
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }}
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
environment: ${{ needs.prepare.outputs.deploy == 'true' && 'packages.element.io' || '' }}
@@ -252,7 +252,7 @@ jobs:
deploy-ess:
needs: deploy
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
name: Deploy builds to ESS
if: needs.prepare.outputs.deploy == 'true' && github.event_name == 'release'
env:

View File

@@ -50,7 +50,7 @@ jobs:
matrix:
include:
- name: macOS Universal
os: macos-latest
os: macos-14
artifact: macos
executable: "/Users/runner/Applications/Element.app/Contents/MacOS/Element"
# We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is
@@ -80,11 +80,11 @@ jobs:
executable: "/opt/Element/element-desktop"
prepare_cmd: "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
- name: Windows (x86)
os: windows-latest
os: windows-2022
artifact: win-ia32
executable: "./dist/win-ia32-unpacked/Element.exe"
- name: Windows (x64)
os: windows-latest
os: windows-2022
artifact: win-x64
executable: "./dist/win-unpacked/Element.exe"
name: Test ${{ matrix.name }}
@@ -132,7 +132,7 @@ jobs:
RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }}
- name: Workaround macOS GHA permission issues
if: matrix.os == 'macos-latest'
if: runner.os == 'macOS'
run: |
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/opt/off/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"

View File

@@ -112,14 +112,14 @@ jobs:
- name: "Get modified files"
id: changed_files
if: steps.cache.outputs.cache-hit != 'true' && github.event_name == 'pull_request'
uses: tj-actions/changed-files@48d8f15b2aaa3d255ca5af3eba4870f807ce6b3c # v45
uses: tj-actions/changed-files@c3a1bb2c992d77180ae65be6ae6c166cf40f857c # v45
with:
files: |
dockerbuild/**
# This allows contributors to test changes to the dockerbuild image within a pull request
- name: Build docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
if: steps.changed_files.outputs.any_modified == 'true'
with:
context: dockerbuild
@@ -148,7 +148,7 @@ jobs:
build:
needs: hak
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

View File

@@ -86,7 +86,7 @@ jobs:
run: |
yarn build:universal --publish never
env:
ED_NOTARYTOOL_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}

View File

@@ -45,7 +45,7 @@ jobs:
prepare:
name: Prepare
environment: ${{ inputs.nightly && 'packages.element.io' || '' }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
nightly-version: ${{ steps.versions.outputs.nightly }}
steps:
@@ -65,7 +65,8 @@ jobs:
# We split this out to save the build_* scripts having to do it to make use of `hashFiles` in the cache action
- name: Generate cache hash files
run: |
yarn run --silent electron --version > electronVersion
# Add --no-sandbox as otherwise it fails because the helper isn't setuid root. It's only getting the version.
yarn run --silent electron --no-sandbox --version > electronVersion
cat package.json | jq -c .hakDependencies | sha1sum > hakHash
find hak -type f -print0 | xargs -0 sha1sum >> hakHash
find scripts/hak -type f -print0 | xargs -0 sha1sum >> hakHash
@@ -126,8 +127,7 @@ jobs:
BUNDLE_HASH=$(npx asar l webapp.asar | grep /bundles/ | head -n 1 | sed 's|.*/||')
WEBAPP_VERSION=$(./scripts/get-version.ts)
WEB_VERSION=${WEBAPP_VERSION:0:12}
REACT_VERSION=${WEBAPP_VERSION:19:12}
JS_VERSION=${WEBAPP_VERSION:35:12}
JS_VERSION=${WEBAPP_VERSION:16:12}
echo "### Nightly build ${{ steps.versions.outputs.nightly }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
@@ -135,7 +135,6 @@ jobs:
echo "| ----------- | ------- |" >> $GITHUB_STEP_SUMMARY
echo "| Bundle Hash | $BUNDLE_HASH |" >> $GITHUB_STEP_SUMMARY
echo "| Element Web | [$WEB_VERSION](https://github.com/element-hq/element-web/commit/$WEB_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| React SDK | [$REACT_VERSION](https://github.com/matrix-org/matrix-react-sdk/commit/$REACT_VERSION) |" >> $GITHUB_STEP_SUMMARY
echo "| JS SDK | [$JS_VERSION](https://github.com/matrix-org/matrix-js-sdk/commit/$JS_VERSION) |" >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v4

View File

@@ -2,7 +2,7 @@
# Due to this extra care must be taken to only ever run all build_* scripts against the same branch to ensure
# the correct cache scoping, and additional care must be taken to not run untrusted actions on the develop branch.
# window-latest by default uses the pwsh shell which breaks codeSigningCert in the workflow
# Windows GHA runner by default uses the pwsh shell which breaks codeSigningCert in the workflow
defaults:
run:
shell: powershell
@@ -30,7 +30,7 @@ on:
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
jobs:
build:
runs-on: windows-latest
runs-on: windows-2022
environment: ${{ inputs.sign && 'packages.element.io' || '' }}
env:
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22000.0/x86/signtool.exe"

View File

@@ -12,7 +12,7 @@ env:
jobs:
build:
name: Docker Build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@@ -23,12 +23,12 @@ jobs:
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
with:
install: true
- name: Log in to the Container registry
uses: docker/login-action@3b8fed7e4b60203b2aa0ecc6c6d6d91d12c06760
uses: docker/login-action@1f36f5b7a2d2f7bfd524795fc966e6d88c37baa9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -43,7 +43,7 @@ jobs:
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
context: dockerbuild
push: true

View File

@@ -26,7 +26,7 @@ jobs:
check:
name: Post release checks
needs: release
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Wait for desktop packaging
uses: t3chguy/wait-on-check-action@18541021811b56544d90e0f073401c2b99e249d6 # fork

View File

@@ -6,7 +6,7 @@ on:
jobs:
ts_lint:
name: "Typescript Syntax Check"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
@@ -30,7 +30,7 @@ jobs:
js_lint:
name: "ESLint"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
@@ -48,7 +48,7 @@ jobs:
workflow_lint:
name: "Workflow Lint"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
@@ -66,7 +66,7 @@ jobs:
analyse_dead_code:
name: "Analyse Dead Code"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

View File

@@ -6,7 +6,7 @@ on:
jobs:
automate-project-columns-next:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/add-to-project@main
with:

View File

@@ -1,3 +1,81 @@
Changes in [1.11.85](https://github.com/element-hq/element-desktop/releases/tag/v1.11.85) (2024-11-12)
======================================================================================================
# Security
- Fixes for [CVE-2024-51750](https://www.cve.org/CVERecord?id=CVE-2024-51750) / [GHSA-w36j-v56h-q9pc](https://github.com/element-hq/element-web/security/advisories/GHSA-w36j-v56h-q9pc)
- Fixes for [CVE-2024-51749](https://www.cve.org/CVERecord?id=CVE-2024-51749) / [GHSA-5486-384g-mcx2](https://github.com/element-hq/element-web/security/advisories/GHSA-5486-384g-mcx2)
- Update JS SDK with the fixes for [CVE-2024-50336](https://www.cve.org/CVERecord?id=CVE-2024-50336) / [GHSA-xvg8-m4x3-w6xr](https://github.com/matrix-org/matrix-js-sdk/security/advisories/GHSA-xvg8-m4x3-w6xr)
Changes in [1.11.84](https://github.com/element-hq/element-desktop/releases/tag/v1.11.84) (2024-11-05)
======================================================================================================
## ✨ Features
* Support specifying the config location manually (outside of the user's profile) ([#1921](https://github.com/element-hq/element-desktop/pull/1921)). Contributed by @Half-Shot.
* Remove abandoned MSC3886, MSC3903, MSC3906 implementations ([#28274](https://github.com/element-hq/element-web/pull/28274)). Contributed by @t3chguy.
* Update to React 18 ([#24763](https://github.com/element-hq/element-web/pull/24763)). Contributed by @t3chguy.
* Deduplicate icons using Compound ([#28239](https://github.com/element-hq/element-web/pull/28239)). Contributed by @t3chguy.
* Replace legacy Tooltips with Compound tooltips ([#28231](https://github.com/element-hq/element-web/pull/28231)). Contributed by @t3chguy.
* Deduplicate icons using Compound Design Tokens ([#28219](https://github.com/element-hq/element-web/pull/28219)). Contributed by @t3chguy.
* Add reactions to html export ([#28210](https://github.com/element-hq/element-web/pull/28210)). Contributed by @langleyd.
* Remove feature\_dehydration ([#28173](https://github.com/element-hq/element-web/pull/28173)). Contributed by @florianduros.
## 🐛 Bug Fixes
* Improve seshat deleteContents ([#1916](https://github.com/element-hq/element-desktop/pull/1916)). Contributed by @langleyd.
* Remove upgrade encryption in `DeviceListener` and `SetupEncryptionToast` ([#28299](https://github.com/element-hq/element-web/pull/28299)). Contributed by @florianduros.
* Fix 'remove alias' button in room settings ([#28269](https://github.com/element-hq/element-web/pull/28269)). Contributed by @Dev-Gurjar.
* Add back unencrypted path in `StopGapWidgetDriver.sendToDevice` ([#28295](https://github.com/element-hq/element-web/pull/28295)). Contributed by @florianduros.
* Fix other devices not being decorated as such ([#28279](https://github.com/element-hq/element-web/pull/28279)). Contributed by @t3chguy.
* Fix pill contrast in invitation dialog ([#28250](https://github.com/element-hq/element-web/pull/28250)). Contributed by @florianduros.
* Close right panel chat when minimising maximised voip widget ([#28241](https://github.com/element-hq/element-web/pull/28241)). Contributed by @t3chguy.
* Fix develop changelog parsing ([#28232](https://github.com/element-hq/element-web/pull/28232)). Contributed by @t3chguy.
* Fix Ctrl+F shortcut not working with minimised room summary card ([#28223](https://github.com/element-hq/element-web/pull/28223)). Contributed by @t3chguy.
* Fix network dropdown missing checkbox \& aria-checked ([#28220](https://github.com/element-hq/element-web/pull/28220)). Contributed by @t3chguy.
Changes in [1.11.83](https://github.com/element-hq/element-desktop/releases/tag/v1.11.83) (2024-10-29)
======================================================================================================
## ✨ Features
* [Backport staging] Enable Element Call by default on release instances ([#1954](https://github.com/element-hq/element-desktop/pull/1954)). Contributed by @RiotRobot.
* Enable Element Call by default on release instances ([#28314](https://github.com/element-hq/element-web/pull/28314)). Contributed by @t3chguy.
Changes in [1.11.82](https://github.com/element-hq/element-desktop/releases/tag/v1.11.82) (2024-10-22)
======================================================================================================
## ✨ Features
* Add monochrome tray icon ([#1804](https://github.com/element-hq/element-desktop/pull/1804)). Contributed by @SakiiCode.
* Deduplicate more icons using Compound Design Tokens ([#132](https://github.com/element-hq/matrix-react-sdk/pull/132)). Contributed by @t3chguy.
* Always show link new device flow even if unsupported ([#147](https://github.com/element-hq/matrix-react-sdk/pull/147)). Contributed by @t3chguy.
* Update design of files list in right panel ([#144](https://github.com/element-hq/matrix-react-sdk/pull/144)). Contributed by @t3chguy.
* Remove feature\_dehydration ([#138](https://github.com/element-hq/matrix-react-sdk/pull/138)). Contributed by @florianduros.
* Upgrade emojibase-bindings and remove local handling of emoticon variations ([#127](https://github.com/element-hq/matrix-react-sdk/pull/127)). Contributed by @langleyd.
* Add support for rendering media captions ([#43](https://github.com/element-hq/matrix-react-sdk/pull/43)). Contributed by @tulir.
* Replace composer icons with Compound variants ([#123](https://github.com/element-hq/matrix-react-sdk/pull/123)). Contributed by @t3chguy.
* Tweak default right panel size to be 320px except for maximised widgets at 420px ([#110](https://github.com/element-hq/matrix-react-sdk/pull/110)). Contributed by @t3chguy.
* Add a pinned message badge under a pinned message ([#118](https://github.com/element-hq/matrix-react-sdk/pull/118)). Contributed by @florianduros.
* Ditch right panel tabs and re-add close button ([#99](https://github.com/element-hq/matrix-react-sdk/pull/99)). Contributed by @t3chguy.
* Force verification even for refreshed clients ([#44](https://github.com/element-hq/matrix-react-sdk/pull/44)). Contributed by @dbkr.
* Update emoji text, border and background colour in timeline ([#119](https://github.com/element-hq/matrix-react-sdk/pull/119)). Contributed by @florianduros.
* Disable ICE fallback based on well-known configuration ([#111](https://github.com/element-hq/matrix-react-sdk/pull/111)). Contributed by @t3chguy.
* Remove legacy room header and promote beta room header ([#105](https://github.com/element-hq/matrix-react-sdk/pull/105)). Contributed by @t3chguy.
* Respect `io.element.jitsi` `useFor1To1Calls` in well-known ([#112](https://github.com/element-hq/matrix-react-sdk/pull/112)). Contributed by @t3chguy.
* Use Compound close icon in favour of mishmash of x/close icons ([#108](https://github.com/element-hq/matrix-react-sdk/pull/108)). Contributed by @t3chguy.
## 🐛 Bug Fixes
* Correct typo in option documentation ([#28148](https://github.com/element-hq/element-web/pull/28148)). Contributed by @AndrewKvalheim.
* Revert #124 and #135 ([#139](https://github.com/element-hq/matrix-react-sdk/pull/139)). Contributed by @dbkr.
* Add aria-label to e2e icon ([#136](https://github.com/element-hq/matrix-react-sdk/pull/136)). Contributed by @florianduros.
* Fix bell icons on room list hover being black squares ([#135](https://github.com/element-hq/matrix-react-sdk/pull/135)). Contributed by @dbkr.
* Fix vertical overflow on the mobile register screen ([#137](https://github.com/element-hq/matrix-react-sdk/pull/137)). Contributed by @langleyd.
* Allow to unpin redacted event ([#98](https://github.com/element-hq/matrix-react-sdk/pull/98)). Contributed by @florianduros.
Changes in [1.11.81](https://github.com/element-hq/element-desktop/releases/tag/v1.11.81) (2024-10-15)
======================================================================================================
This release fixes High severity vulnerability CVE-2024-47771 / GHSA-963w-49j9-gxj6.

View File

@@ -143,6 +143,10 @@ $PROFILE` in which case it becomes `Element-$PROFILE`, or it is using one of
the above created by a pre-1.7 install, in which case it will be `Riot` or
`Riot-$PROFILE`.
You may also specify a different path entirely for the `config.json` file by
providing the `--config $YOUR_CONFIG_JSON_FILE` to the process, or via the
`ELEMENT_DESKTOP_CONFIG_JSON` environment variable.
# Translations
To add a new translation, head to the [translating doc](https://github.com/vector-im/element-web/blob/develop/docs/translating.md).

View File

@@ -2,7 +2,7 @@
## Requirements to build native modules
We rely on Github Actions `windows-latest` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
We rely on Github Actions `windows-2022` plus a few extra utilities as per [the workflow](https://github.com/vector-im/element-desktop/blob/develop/.github/workflows/build_windows.yaml).
If you want to build native modules, make sure that the following tools are installed on your system.

View File

@@ -12,9 +12,6 @@ import { flipFuses, FuseVersion, FuseV1Options } from "@electron/fuses";
* Passes $ED_SIGNTOOL_THUMBPRINT and $ED_SIGNTOOL_SUBJECT_NAME to
* build.win.signingHashAlgorithms and build.win.certificateSubjectName respectively if specified.
*
* On macOS:
* Passes $ED_NOTARYTOOL_TEAM_ID to build.mac.notarize.notarize if specified
*
* On Linux:
* Replaces spaces in the product name with dashes as spaces in paths can cause issues
* Removes libsqlcipher0 recommended dependency if env SQLCIPHER_BUNDLED is asserted.
@@ -177,16 +174,6 @@ if (process.env.ED_SIGNTOOL_SUBJECT_NAME && process.env.ED_SIGNTOOL_THUMBPRINT)
config.win.certificateSha1 = process.env.ED_SIGNTOOL_THUMBPRINT;
}
/**
* Allow specifying macOS notary team id via env var
* @param {string} process.env.ED_NOTARYTOOL_TEAM_ID
*/
if (process.env.ED_NOTARYTOOL_TEAM_ID) {
config.mac.notarize = {
teamId: process.env.ED_NOTARYTOOL_TEAM_ID,
};
}
/**
* Allow specifying nightly version via env var
* @param {string} process.env.ED_NIGHTLY

View File

@@ -53,8 +53,7 @@
"feature_spotlight": true,
"feature_group_calls": true,
"feature_video_rooms": true,
"feature_element_call_video_rooms": true,
"feature_new_room_decoration_ui": true
"feature_element_call_video_rooms": true
},
"setting_defaults": {
"RustCrypto.staged_rollout_percent": 100

View File

@@ -47,5 +47,13 @@
"map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx",
"setting_defaults": {
"RustCrypto.staged_rollout_percent": 60
},
"features": {
"feature_video_rooms": true,
"feature_group_calls": true,
"feature_element_call_video_rooms": true
},
"element_call": {
"url": "https://call.element.io"
}
}

View File

@@ -30,7 +30,11 @@ export default async function buildKeytar(hakEnv: HakEnv, moduleInfo: Dependency
},
);
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});
}

View File

@@ -27,7 +27,11 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
stdio: "inherit",
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});
@@ -42,7 +46,11 @@ export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
stdio: "inherit",
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});
}

View File

@@ -2,7 +2,7 @@
"name": "element-desktop",
"productName": "Element",
"main": "lib/electron-main.js",
"version": "1.11.81",
"version": "1.11.85",
"description": "A feature-rich client for Matrix.org",
"author": "Element",
"homepage": "https://element.io",
@@ -79,38 +79,39 @@
"@babel/core": "^7.18.10",
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
"@electron/asar": "^3.2.3",
"@electron/asar": "3.2.10",
"@electron/fuses": "^1.7.0",
"@mapbox/node-pre-gyp": "^1.0.11",
"@playwright/test": "1.47.1",
"@playwright/test": "1.48.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/auto-launch": "^5.0.1",
"@types/counterpart": "^0.18.1",
"@types/minimist": "^1.2.1",
"@types/node": "18.19.50",
"@types/node": "18.19.55",
"@types/pacote": "^11.1.1",
"@types/tar": "^6.1.3",
"@types/uuid": "^10.0.0",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"app-builder-lib": "24.13.3",
"chokidar": "^3.5.2",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"app-builder-lib": "25.1.8",
"chokidar": "^4.0.0",
"detect-libc": "^2.0.0",
"electron": "^32.0.0",
"electron-builder": "24.13.3",
"electron-builder-squirrel-windows": "24.13.3",
"electron-builder": "25.1.8",
"electron-builder-squirrel-windows": "25.1.8",
"electron-devtools-installer": "^3.2.0",
"eslint": "^8.26.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^1.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-matrix-org": "^2.0.1",
"eslint-plugin-unicorn": "^56.0.0",
"glob": "^11.0.0",
"knip": "^5.0.0",
"matrix-web-i18n": "^3.2.1",
"mkdirp": "^3.0.0",
"pacote": "^18.0.0",
"pacote": "^19.0.0",
"prettier": "^3.0.0",
"rimraf": "^6.0.0",
"tar": "^6.2.1",
@@ -122,7 +123,7 @@
"keytar": "^7.9.0"
},
"resolutions": {
"@types/node": "18.19.50",
"@types/node": "18.19.55",
"config-file-ts": "0.2.8-rc1"
}
}

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/playwright:v1.46.1-jammy
FROM mcr.microsoft.com/playwright:v1.48.1-jammy
WORKDIR /work/element-desktop

View File

@@ -0,0 +1,41 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/
import { resolve } from "node:path";
import { test, expect } from "../../element-desktop-test";
test.describe("App config options", () => {
test.describe("Should load custom config via env", () => {
test.slow();
test.use({
extraEnv: {
ELEMENT_DESKTOP_CONFIG_JSON: resolve(__dirname, "../..", "fixtures/custom-config.json"),
},
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
test.describe("Should load custom config via argument", () => {
test.slow();
test.use({
extraArgs: ["--config", resolve(__dirname, "../..", "fixtures/custom-config.json")],
});
test("should launch and use configured homeserver", async ({ page }) => {
await page.locator("#matrixchat").waitFor();
await page.locator(".mx_Welcome").waitFor();
await expect(page).toHaveURL("vector://vector/webapp/#/welcome");
await page.getByText("Sign in").click();
await page.getByText("matrix.example.org", { exact: true }).waitFor();
});
});
});

View File

@@ -11,7 +11,16 @@ import fs from "node:fs/promises";
import path from "node:path";
import os from "node:os";
export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
interface Fixtures {
app: ElectronApplication;
tmpDir: string;
extraEnv: Record<string, string>;
extraArgs: string[];
}
export const test = base.extend<Fixtures>({
extraEnv: {},
extraArgs: [],
// eslint-disable-next-line no-empty-pattern
tmpDir: async ({}, use) => {
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "element-desktop-tests-"));
@@ -19,7 +28,7 @@ export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
await use(tmpDir);
await fs.rm(tmpDir, { recursive: true });
},
app: async ({ tmpDir }, use) => {
app: async ({ tmpDir, extraEnv, extraArgs }, use) => {
const args = ["--profile-dir", tmpDir];
const executablePath = process.env["ELEMENT_DESKTOP_EXECUTABLE"];
@@ -29,9 +38,12 @@ export const test = base.extend<{ app: ElectronApplication; tmpDir: string }>({
}
const app = await electron.launch({
env: process.env,
env: {
...process.env,
...extraEnv,
},
executablePath,
args,
args: [...args, ...extraArgs],
});
app.process().stdout.pipe(process.stdout);

View File

@@ -0,0 +1,10 @@
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://matrix.example.org"
},
"m.identity_server": {
"base_url": "https://identity.example.org"
}
}
}

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -28,7 +28,7 @@ async function downloadToFile(url: string, filename: string): Promise<void> {
console.error(e);
try {
await fs.unlink(filename);
} catch (_) {}
} catch {}
throw e;
}
}
@@ -150,14 +150,14 @@ async function main(): Promise<number | undefined> {
await fs.opendir(expectedDeployDir);
console.log(expectedDeployDir + "already exists");
haveDeploy = true;
} catch (e) {}
} catch {}
if (!haveDeploy) {
const outPath = path.join(pkgDir, filename);
try {
await fs.stat(outPath);
console.log("Already have " + filename + ": not redownloading");
} catch (e) {
} catch {
try {
await downloadToFile(url, outPath);
} catch (e) {
@@ -170,7 +170,7 @@ async function main(): Promise<number | undefined> {
try {
await fs.stat(outPath + ".asc");
console.log("Already have " + filename + ".asc: not redownloading");
} catch (e) {
} catch {
try {
await downloadToFile(url + ".asc", outPath + ".asc");
} catch (e) {
@@ -206,7 +206,7 @@ async function main(): Promise<number | undefined> {
await fs.stat(ASAR_PATH);
console.log(ASAR_PATH + " already present: removing");
await fs.unlink(ASAR_PATH);
} catch (e) {}
} catch {}
if (cfgDir.length) {
const configJsonSource = path.join(cfgDir, "config.json");

View File

@@ -18,7 +18,7 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
try {
const stats = await fsProm.stat(moduleInfo.moduleBuildDir);
haveModuleBuildDir = stats.isDirectory();
} catch (e) {
} catch {
haveModuleBuildDir = false;
}
@@ -41,7 +41,11 @@ export default async function fetch(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});

View File

@@ -31,8 +31,9 @@ async function main(): Promise<void> {
const prefix = path.join(__dirname, "..", "..");
let packageJson;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
packageJson = require(path.join(prefix, "package.json"));
} catch (e) {
} catch {
console.error("Can't find a package.json!");
process.exit(1);
}
@@ -69,8 +70,9 @@ async function main(): Promise<void> {
const hakJsonPath = path.join(prefix, "hak", dep, "hak.json");
let hakJson: Record<string, any>;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
hakJson = await require(hakJsonPath);
} catch (e) {
} catch {
console.error("No hak.json found for " + dep + ".");
console.log("Expecting " + hakJsonPath);
process.exit(1);

View File

@@ -24,7 +24,7 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
// Also we do this for each module which is unnecessary, but meh.
try {
await fsProm.stat(yarnrc);
} catch (e) {
} catch {
await fsProm.writeFile(
yarnrc,
// XXX: 1. This must be absolute, as yarn will resolve link directories
@@ -50,7 +50,11 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});
@@ -63,7 +67,11 @@ export default async function link(hakEnv: HakEnv, moduleInfo: DependencyInfo):
shell: hakEnv.isWin(),
});
proc.on("exit", (code) => {
code ? reject(code) : resolve();
if (code) {
reject(code);
} else {
resolve();
}
});
});
}

View File

@@ -12,7 +12,7 @@ import * as childProcess from "child_process";
export async function versionFromAsar(): Promise<string> {
try {
await fs.stat("webapp.asar");
} catch (e) {
} catch {
throw new Error("No 'webapp.asar' found. Run 'yarn run fetch'");
}

View File

@@ -44,6 +44,10 @@ if (argv["help"]) {
console.log(" --profile-dir {path}: Path to where to store the profile.");
console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts.");
console.log(" --devtools: Install and use react-devtools and react-perf.");
console.log(
` --config: Path to the config.json file. May also be specified via the ELEMENT_DESKTOP_CONFIG_JSON environment variable.\n` +
` Otherwise use the default user location '${app.getPath("userData")}'`,
);
console.log(" --no-update: Disable automatic updating.");
console.log(" --hidden: Start the application hidden in the system tray.");
console.log(" --help: Displays this help message.");
@@ -51,6 +55,8 @@ if (argv["help"]) {
app.exit();
}
const LocalConfigLocation = process.env.ELEMENT_DESKTOP_CONFIG_JSON ?? argv["config"];
// Electron creates the user data directory (with just an empty 'Dictionaries' directory...)
// as soon as the app path is set, so pick a random path in it that must exist if it's a
// real user data directory.
@@ -97,7 +103,7 @@ async function tryPaths(name: string, root: string, rawPaths: string[]): Promise
try {
await afs.stat(p);
return p + "/";
} catch (e) {}
} catch {}
}
console.log(`Couldn't find ${name} files in any of: `);
for (const p of paths) {
@@ -137,7 +143,7 @@ async function loadConfig(): Promise<void> {
try {
global.vectorConfig = loadJsonFile(asarPath, "config.json");
} catch (e) {
} catch {
// it would be nice to check the error code here and bail if the config
// is unparsable, but we get MODULE_NOT_FOUND in the case of a missing
// file or invalid json, so node is just very unhelpful.
@@ -147,7 +153,9 @@ async function loadConfig(): Promise<void> {
try {
// Load local config and use it to override values from the one baked with the build
const localConfig = loadJsonFile(app.getPath("userData"), "config.json");
const localConfig = LocalConfigLocation
? loadJsonFile(LocalConfigLocation)
: loadJsonFile(app.getPath("userData"), "config.json");
// If the local config has a homeserver defined, don't use the homeserver from the build
// config. This is to avoid a problem where Riot thinks there are multiple homeservers
@@ -365,7 +373,7 @@ app.on("ready", async () => {
if (argv["devtools"]) {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require("electron-devtools-installer");
installExt(REACT_DEVELOPER_TOOLS)
.then((name: string) => console.log(`Added Extension: ${name}`))

View File

@@ -55,6 +55,7 @@
},
"window_menu": {
"bring_all_to_front": "Alles naar voren brengen",
"label": "Venster"
"label": "Venster",
"zoom": "Zoom"
}
}

View File

@@ -147,7 +147,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
if (ret === null) {
ret = await keytar?.getPassword("riot.im", `${args[0]}|${args[1]}`);
}
} catch (e) {
} catch {
// if an error is thrown (e.g. keytar can't connect to the keychain),
// then return null, which means the default pickle key will be used
ret = null;
@@ -159,7 +159,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
const pickleKey = await randomArray(32);
await keytar?.setPassword("element.io", `${args[0]}|${args[1]}`, pickleKey);
ret = pickleKey;
} catch (e) {
} catch {
ret = null;
}
break;
@@ -170,7 +170,7 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
// migrate from riot.im (remove once we think there will no longer be
// logins from the time of riot.im)
await keytar?.deletePassword("riot.im", `${args[0]}|${args[1]}`);
} catch (e) {}
} catch {}
break;
case "getDesktopCapturerSources":
ret = (await desktopCapturer.getSources(args[0])).map((source) => ({

View File

@@ -9,7 +9,7 @@ import type * as Keytar from "keytar"; // Hak dependency type
let keytar: typeof Keytar | undefined;
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
keytar = require("keytar");
} catch (e) {
if ((<NodeJS.ErrnoException>e).code === "MODULE_NOT_FOUND") {

View File

@@ -128,14 +128,9 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
height: 24px;
}
.mx_RoomView[data-room-header="new"]::before {
.mx_RoomView::before {
height: 13px;
}
.mx_RoomView[data-room-header="legacy"]::before {
height: 27px;
}
`);
}

View File

@@ -50,7 +50,7 @@ function readStore(): Record<string, string> {
const s = fs.readFileSync(storePath, { encoding: "utf8" });
const o = JSON.parse(s);
return typeof o === "object" ? o : {};
} catch (e) {
} catch {
return {};
}
}

View File

@@ -24,7 +24,7 @@ let SeshatRecovery: typeof SeshatRecoveryType;
let ReindexError: typeof ReindexErrorType;
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const seshatModule = require("matrix-seshat");
Seshat = seshatModule.Seshat;
SeshatRecovery = seshatModule.SeshatRecovery;
@@ -60,9 +60,17 @@ async function getOrCreatePassphrase(key: string): Promise<string> {
}
const deleteContents = async (p: string): Promise<void> => {
for (const entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
await afs.unlink(curPath);
try {
for (const entry of await afs.readdir(p)) {
const curPath = path.join(p, entry);
try {
await afs.unlink(curPath);
} catch (e) {
console.log("Error deleting a file in EventStore directory", e);
}
}
} catch (e) {
console.log("Error reading the files in EventStore directory", e);
}
};
@@ -115,10 +123,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
// anyways so reindexing it is a waste of time.
if (userVersion === 0) {
await recoveryIndex.shutdown();
try {
await deleteContents(eventStorePath);
} catch (e) {}
await deleteContents(eventStorePath);
} else {
await recoveryIndex.reindex();
}
@@ -147,9 +152,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
break;
case "deleteEventIndex": {
try {
await deleteContents(eventStorePath);
} catch (e) {}
await deleteContents(eventStorePath);
break;
}
@@ -264,7 +267,7 @@ ipcMain.on("seshat", async function (_ev: IpcMainEvent, payload): Promise<void>
else {
try {
ret = await eventIndex.loadCheckpoints();
} catch (e) {
} catch {
ret = [];
}
}

View File

@@ -176,15 +176,18 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We
ev.preventDefault();
}
function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemConstructorOptions[] {
function cutCopyPasteSelectContextMenus(
params: ContextMenuParams,
webContents: WebContents,
): MenuItemConstructorOptions[] {
const options: MenuItemConstructorOptions[] = [];
if (params.misspelledWord) {
params.dictionarySuggestions.forEach((word) => {
options.push({
label: word,
click: (menuItem, browserWindow) => {
browserWindow?.webContents.replaceMisspelling(word);
click: () => {
webContents.replaceMisspelling(word);
},
});
});
@@ -194,8 +197,8 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
},
{
label: _t("right_click_menu|add_to_dictionary"),
click: (menuItem, browserWindow) => {
browserWindow?.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
click: () => {
webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord);
},
},
{
@@ -237,8 +240,8 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons
return options;
}
function onSelectedContextMenu(ev: Event, params: ContextMenuParams): void {
const items = cutCopyPasteSelectContextMenus(params);
function onSelectedContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
const items = cutCopyPasteSelectContextMenus(params, webContents);
const popupMenu = Menu.buildFromTemplate(items);
// popup() requires an options object even for no options
@@ -246,12 +249,12 @@ function onSelectedContextMenu(ev: Event, params: ContextMenuParams): void {
ev.preventDefault();
}
function onEditableContextMenu(ev: Event, params: ContextMenuParams): void {
function onEditableContextMenu(ev: Event, params: ContextMenuParams, webContents: WebContents): void {
const items: MenuItemConstructorOptions[] = [
{ role: "undo" },
{ role: "redo", enabled: params.editFlags.canRedo },
{ type: "separator" },
...cutCopyPasteSelectContextMenus(params),
...cutCopyPasteSelectContextMenus(params, webContents),
];
const popupMenu = Menu.buildFromTemplate(items);
@@ -286,9 +289,9 @@ export default (webContents: WebContents): void => {
if (params.linkURL || params.srcURL) {
onLinkContextMenu(ev, params, webContents);
} else if (params.selectionText) {
onSelectedContextMenu(ev, params);
onSelectedContextMenu(ev, params, webContents);
} else if (params.isEditable) {
onEditableContextMenu(ev, params);
onEditableContextMenu(ev, params, webContents);
}
});

2697
yarn.lock
View File

File diff suppressed because it is too large Load Diff