Reddit old expand all posts

Install latest with possible future updates OR Install fixed script with no updates

// ==UserScript==
// @name         Reddit old expand all posts
// @version      0.1
// @description  Expand all posts
// @author       https://github.com/z-aki
// @namespace    https://github.com/z-aki
// @match        https://old.reddit.com*
// @icon         https://external-content.duckduckgo.com/ip3/www.reddit.com.ico
// @grant        none
// @require      https://gist.githubusercontent.com/adamhotep/7c9068f2196326ab79145ae308b68f9e/raw/373f5e8405b98781001aea9a9e74585367344960/waitForKeyElements.js

Warning

Malicious scripts can violate your privacy and act on your behalf! You should only install scripts from sources that you trust. All scripts in this repo are provided in two versions: updates and no updates controlled by the @downloadURL tag in the script header.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The trademarks and logos are property of their respective owners (mostly available in the @match directive or @icon directive (except when it's loaded from DuckDuckGo)) and no affiliation, association or endorsement is intended, implied or given by the author.

// ==UserScript==
// @name         Reddit old expand all posts
// @version      0.1
// @description  Expand all posts
// @author       https://github.com/z-aki
// @namespace    https://github.com/z-aki
// @match        https://old.reddit.com*
// @icon         https://external-content.duckduckgo.com/ip3/www.reddit.com.ico
// @grant        none
// @require      https://gist.githubusercontent.com/adamhotep/7c9068f2196326ab79145ae308b68f9e/raw/373f5e8405b98781001aea9a9e74585367344960/waitForKeyElements.js
// @downloadURL  none
// ==/UserScript==

waitForKeyElements("div.sitetable.linklisting", function () {
  "use strict";
  console.log("Entered Expand all posts");

  // Select the elements that contain the old HTML structure
  const oldEntries = document.querySelectorAll(".entry.unvoted");

  oldEntries.forEach((entry) => {
    // Find the expando button for video elements
    const expandoButton = entry.querySelector(
      ".expando-button.collapsed.hide-when-pinned"
    );
    if (expandoButton) {
      // Simulate a click on the expando button
      expandoButton.click();
    }
  });
});