Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- After the page loads and 1s after the table is loaded this will remove all:- 10 Point tasks- Tasks with unmet requirements
- You can just run it yourself in the browser with:
- var tableRows = document.querySelectorAll('table tr');
- // Iterate through each row
- tableRows.forEach(function(row) {
- // Check if the row contains <td data-sort-value="10"> or has an image with class="qc-not-started"
- var tdWithValueTen = row.querySelector('td[data-sort-value="10"]');
- var notStartedImage = row.querySelector('img.qc-not-started');
- // If either condition is met, remove the row
- if (tdWithValueTen || notStartedImage) {
- row.remove();
- }
- });
- Or add it to Tampermonkey (https://www.tampermonkey.net/) using:
- // ==UserScript==
- // @name Hide 10 point or uncompletable tasks
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Filter out those nasty leagues tasks you can't or won't do.
- // @author zuccc
- // @match https://oldschool.runescape.wiki/w/Trailblazer_Reloaded_League/Tasks
- // @icon https://www.google.com/s2/favicons?sz=64&domain=runescape.wiki
- // @grant none
- // ==/UserScript==
- function removeRowsWithValueTenOrNotStarted() {
- // Get all table rows
- var tableRows = document.querySelectorAll('table tr');
- // Iterate through each row
- tableRows.forEach(function(row) {
- // Check if the row contains <td data-sort-value="10"> or has an image with class="qc-not-started"
- var tdWithValueTen = row.querySelector('td[data-sort-value="10"]');
- var notStartedImage = row.querySelector('img.qc-not-started');
- // If either condition is met, remove the row
- if (tdWithValueTen || notStartedImage) {
- row.remove();
- }
- });
- }
- (function() {
- 'use strict';
- // Use MutationObserver to observe changes in the DOM
- var observer = new MutationObserver(function(mutations) {
- // Function to be called after 2 seconds of no changes
- function delayedFunction() {
- removeRowsWithValueTenOrNotStarted();
- }
- // Clear previous timeout
- if (observer.timeout) {
- clearTimeout(observer.timeout);
- }
- // Set a timeout to call the function after 2 seconds of no changes
- observer.timeout = setTimeout(delayedFunction, 1000);
- });
- // Start observing changes in the specified target (e.g., #mw-content-text)
- observer.observe(document.getElementById('mw-content-text'), { subtree: true, childList: true });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement