I want to detect if a local storage variable value is changed or not, But I have noticed that if I added an event listener on 'storage' event, I can detect the change only if I open the same link in ** another window** and then change the local storage value from that window, then it will show me the change in the first window. But I don't want this behavior I just wanted to observe the change in the same window. Is there any way to do it?
How to detect a change in HTML5 Local Storage in the same window?
![](https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F136973%2F0ca5da41-1e82-464e-a43b-2b6c3217b480.png)