File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,29 @@ const ERROR_SCREEN_STYLES: HTMLChakraProps<'div'> = {
4848 p : { base : 4 , lg : 0 } ,
4949} ;
5050
51+ const CONSOLE_SCAM_WARNING = `⚠️WARNING: Do not paste or execute any scripts here!
52+ Anyone asking you to run code here might be trying to scam you and steal your data.
53+ If you don't understand what this console is for, close it now and stay safe.` ;
54+
55+ const CONSOLE_SCAM_WARNING_DELAY_MS = 500 ;
56+
5157function MyApp ( { Component, pageProps } : AppPropsWithLayout ) {
5258
5359 const growthBook = initGrowthBook ( pageProps . uuid ) ;
5460 useLoadFeatures ( growthBook ) ;
5561
5662 const queryClient = useQueryClientConfig ( ) ;
5763
64+ React . useEffect ( ( ) => {
65+ // after the app is rendered/hydrated, show the console scam warning
66+ const timeoutId = window . setTimeout ( ( ) => {
67+ // eslint-disable-next-line no-console
68+ console . warn ( CONSOLE_SCAM_WARNING ) ;
69+ } , CONSOLE_SCAM_WARNING_DELAY_MS ) ;
70+
71+ return ( ) => window . clearTimeout ( timeoutId ) ;
72+ } , [ ] ) ;
73+
5874 const content = ( ( ) => {
5975 const getLayout = Component . getLayout ?? ( ( page ) => < Layout > { page } </ Layout > ) ;
6076
You can’t perform that action at this time.
0 commit comments