Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add a warning to the console to discourage attacks and encourage contributing #7608

Closed

Conversation

SimonBrandner
Copy link
Contributor

@SimonBrandner SimonBrandner commented Jan 23, 2022

Fixes element-hq/element-web#2803
Type: enhancement


2022-01-23_10-22


Here's what your changelog entry will look like:

✨ Features

Signed-off-by: Šimon Brandner <[email protected]>
Signed-off-by: Šimon Brandner <[email protected]>
Signed-off-by: Šimon Brandner <[email protected]>
@SimonBrandner SimonBrandner requested a review from a team as a code owner January 23, 2022 09:25
@github-actions github-actions bot added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Jan 23, 2022
@@ -471,6 +477,35 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
if (this.accountPasswordTimer !== null) clearTimeout(this.accountPasswordTimer);
}

private onKeyDown = (event: KeyboardEvent): void => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can open the devtools in many more ways, e.g Inspect Element, browser's View menu etc

image

So I don't think this is fool-proof enough and a good scammer could just instruct them to use one of those instead of the keyboard shortcut to avoid this warning

Copy link
Contributor Author

@SimonBrandner SimonBrandner Jan 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Args, I am notan idiot... Though I have no idea how to detect the console in another way...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do it on viewport resize (unreliable way of detecting console state) but that's still far from ideal, maybe make a localStorage flag which enables debug log and otherwise hide non-critical/bug console.logs.

element-hq/element-web#2803 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not, only I am an idiot but I am also blind 🤦‍♂️

Thanks, will have a look

@SimonBrandner
Copy link
Contributor Author

Closing in favour of #7673

@SimonBrandner SimonBrandner deleted the feature/console-warning branch January 29, 2022 11:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
2 participants