Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save phamhieu/b557f83ba6473fd7354141492ec264bf to your computer and use it in GitHub Desktop.

Select an option

Save phamhieu/b557f83ba6473fd7354141492ec264bf to your computer and use it in GitHub Desktop.
How to inspect disappearing element in a browser?
1. Open console
2. Type in setTimeout(()=>{debugger;},5000);
3. Press Enter
Now you have 5 seconds to make your element appears. Once it appeared, wait until the debugger hits. As long as you don't resume, you can play with your element and it won't disappear.
Useful tip to avoid repeating those steps above every time:
add this as a bookmarklet:
1. Bookmark any page
2. Edit this new bookmark
3. Replace the URL/location with: javascript:(function(){setTimeout(()=>{debugger;},5000);})();
4. Next time you wish to use this, just click/tap this bookmark.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment