File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,18 @@ export function impersonateAccount(address?: string) {
2020 throw new Error ( "It's not a valid Ethereum address." ) ;
2121 }
2222 const lowercasedAddress = address . toLowerCase ( ) ;
23- if ( typeof localStorage !== 'undefined' ) {
24- localStorage . setItem ( 'impersonate' , lowercasedAddress ) ;
25- window . location . reload ( ) ;
23+
24+ if (
25+ window . confirm ( `You are about to impersonate the account: ${ lowercasedAddress }
26+ This will set the address in localStorage and reload the page.
27+ To stop impersonation, run stopImpersonatingAccount() in the console.
28+
29+ Do you want to proceed?` )
30+ ) {
31+ if ( typeof localStorage !== 'undefined' ) {
32+ localStorage . setItem ( 'impersonate' , lowercasedAddress ) ;
33+ window . location . reload ( ) ;
34+ }
2635 }
2736}
2837
You can’t perform that action at this time.
0 commit comments