From 760bac13771e719893d74fee0c70002b0916f2cf Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 24 Mar 2021 13:37:41 -0500 Subject: [PATCH] Add styled console warning --- app/soapbox/containers/soapbox.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index 138d12701..8a3a52f3e 100644 --- a/app/soapbox/containers/soapbox.js +++ b/app/soapbox/containers/soapbox.js @@ -150,6 +150,30 @@ class SoapboxMount extends React.PureComponent { export default class Soapbox extends React.PureComponent { + printConsoleWarning = () => { + /* eslint-disable no-console */ + console.log('%cStop!', [ + 'color: #ff0000', + 'display: block', + 'font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto, Ubuntu, "Helvetica Neue", sans-serif', + 'font-size: 50px', + 'font-weight: 800', + 'padding: 4px 0', + ].join(';')); + console.log('%cThis is a browser feature intended for developers. If someone told you to copy-paste something here it is a scam and will give them access to your account.', [ + 'color: #111111', + 'display: block', + 'font-family: system-ui, -apple-system, BlinkMacSystemFont, Roboto, Ubuntu, "Helvetica Neue", sans-serif', + 'font-size: 18px', + 'padding: 4px 0 16px', + ].join(';')); + /* eslint-enable no-console */ + } + + componentDidMount() { + this.printConsoleWarning(); + } + render() { return (