Skip to content

A userscript to click "show more" links to expand all the text on a page, without slowing things down too much

License

Notifications You must be signed in to change notification settings

ludios/expand-everything

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Expand Everything

Load more!, show more!, read more! - these are the cursed buttons that website owners make you click before you can see all the information that you came to read. Reviews and comments deemed "too long"; YouTube video descriptions that are hidden. Expand Everything fixes this by clicking them for you.

This is ideally suited for use cases where you plan to read, print, copy, or archive (e.g. SingleFile) the entire page.

Demo.

Efforts are made to avoid slowing things down after the initial load. We use MutationObserver and querySelectorAll to watch for the elements that we need to automatically click, but crucially:

  1. The MutationObserver is disconnected after e.g. 200 mutations to avoid slowing things down. The "stop the observer" count is different for each website and you can try adjusting them to your liking.

  2. The MutationObserver is reinstalled after an SPA navigation (because there might be new elements to click on).

    When available, we use Navigation API to watch for location changes; otherwise, we use setInterval(..., 1000), but stop polling when the page is not visible.

Install

This is distributed as a userscript, so you need a browser extension that runs userscripts.

Violentmonkey can be installed in Firefox and Chromium-based browsers. Userscripts works in Safari.

Then, visit expand.user.js and Confirm installation.

(Alternatively, create a new script and paste in the entire expand.user.js source.)

Supported sites

For test pages, see the "Test page:" comments in expand.user.js.

Demo

The video description and comment replies are expanded automatically.

About

A userscript to click "show more" links to expand all the text on a page, without slowing things down too much

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published