Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 8d7a4d1
Author: Mirian Margiani <[email protected]>
Date:   Mon Dec 2 13:14:27 2024 +0100

    Fix backup key and filter field being autofilled as logins

    Firefox misinterprets the backup key field on the settings page
    and the room filter field as a pair of username-password login
    fields. It then autofills a username in the filter field each
    time the settings page is opened.

    The only working fix is to mark both fields as "autocomplete: new-password"
    because Firefox ignores all other directives. I still added the proper
    attributes to both fields just in case the major browsers will decide
    to follow the spec one day.

    The "readonly" hack is included for completeness. It may improve
    compatibility with older browsers where one of the other tricks fails.

    Signed-off-by: Mirian Margiani <[email protected]>

commit cd02ef6
Merge: 4ae47c0 58af591
Author: R Midhun Suresh <[email protected]>
Date:   Mon Oct 21 17:25:32 2024 +0530

    Merge pull request element-hq#1190 from element-hq/sdk-release/0.3.1

    Changes for sdk-release 0.3.1

commit 58af591
Author: R Midhun Suresh <[email protected]>
Date:   Mon Oct 21 17:23:57 2024 +0530

    Changes for sdk-release 0.3.1
  • Loading branch information
b100dian committed Dec 2, 2024
1 parent 4ae47c0 commit 4066cd8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
10 changes: 10 additions & 0 deletions doc/SDK-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.3.1] - 2024-10-21

### Fixed

- Authenticated media failed to load due to an issue with how the access-token was retrieved.

### Security

= See https://github.com/element-hq/element-web/security/advisories/GHSA-3jm3-x98c-r34x; we only share the access-token after verifying that the request is going to the homeserver.

## [v0.3.0] - 2024-08-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion scripts/sdk/base-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hydrogen-view-sdk",
"description": "Embeddable matrix client library, including view components",
"version": "0.3.0",
"version": "0.3.1",
"main": "./lib-build/hydrogen.cjs.js",
"exports": {
".": {
Expand Down
11 changes: 9 additions & 2 deletions src/platform/web/ui/session/leftpanel/LeftPanelView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2020 Bruno Windels <[email protected]>
Copyright 2024 Mirian Margiani <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +33,10 @@ class FilterField extends TemplateView {
type: "text",
placeholder: options?.label,
"aria-label": options?.label,
autocomplete: options?.autocomplete,
autocomplete: "new-password",
spellcheck: "false",
autocorrect: "off",
readonly: true,
enterkeyhint: 'search',
name: options?.name,
onInput: event => options.set(event.target.value),
Expand All @@ -41,7 +45,10 @@ class FilterField extends TemplateView {
clear();
}
},
onFocus: () => filterInput.select()
onFocus: () => {
filterInput.removeAttribute("readonly");
filterInput.select();
},
});
const clearButton = t.button({
onClick: clear,
Expand Down
12 changes: 11 additions & 1 deletion src/platform/web/ui/session/settings/KeyBackupSettingsView.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2020 The Matrix.org Foundation C.I.C.
Copyright 2024 Mirian Margiani <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -118,7 +119,16 @@ function renderEnableFromPhrase(t: Builder<KeyBackupViewModel>, vm: KeyBackupVie
function renderEnableFieldRow(t, vm, label, callback): ViewNode {
let setupDehydrationCheck;
const eventHandler = () => callback(input.value, setupDehydrationCheck?.checked || false);
const input = t.input({type: "password", disabled: vm => vm.isBusy, placeholder: label});
const input = t.input({
type: "password",
disabled: vm => vm.isBusy,
placeholder: label,
autocomplete: "new-password",
spellcheck: "false",
autocorrect: "off",
readonly: true,
onFocus: () => input.removeAttribute("readonly"),
});
const children = [
t.p([
input,
Expand Down

0 comments on commit 4066cd8

Please sign in to comment.