This bookmarklet lets you navigate the hierarchical structure (known as the DOM tree) of a web page to select the contents of a specific branch (or node) of the tree.
Note: Github doesn't allow embedded javscript in README files, so I can't share the bookmarklet here as a draggable link.
- Create a bookmark of any web page.
- Copy the raw bookmarklet code to your clipboard.
- Edit the bookmark you created in step 1, delete the text in the URL field, and paste the bookmarklet code instead.
- Rename the bookmark title as desired.
- Select a small portion (a single letter, word, image, etc will do) of the web page to begin navigating from that area.
- Click/tap the saved bookmarklet.
- Navigate.
Tapping the saved bookmarklet on mobile without losing the pre-selected area can be tricky. On Safari on iOS, for example, you need to ignore the iOS popup that selecting text produces, and instead swipe the page so that the menu bar with the bookmarks icon appears. Once it does, open bookmarks, find the bookmarklet, and tap it.
- Click the saved bookmarklet without anything on the web page already selected.
- Navigate.
The popup can be moved around on when clicked/tapped along its top area, and dragged.