Last active
January 16, 2026 16:45
-
-
Save malys/ad119aeeab2b627ee44f3cefc3788cbd to your computer and use it in GitHub Desktop.
[Open all changedetection ] open unread links in new tab and change state to read #changedetection #userscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name ChangeDetection | |
| // @namespace Violentmonkey Scripts | |
| // @match https://changedetection* | |
| // @grant none | |
| // @version 1.1 | |
| // @author - | |
| // @description 02/08/2024 18:45:57 | |
| // @downloadURL https://gist.githubusercontent.com/malys/ad119aeeab2b627ee44f3cefc3788cbd/raw/userscript.js | |
| // @updateURL https://gist.githubusercontent.com/malys/ad119aeeab2b627ee44f3cefc3788cbd/raw/userscript.js | |
| // ==/UserScript== | |
| function getButton(searchText){ | |
| var aTags = document.getElementsByTagName("button"); | |
| var found; | |
| for (var i = 0; i < aTags.length; i++) { | |
| if (aTags[i].textContent == searchText) { | |
| found = aTags[i]; | |
| break; | |
| } | |
| } | |
| return found | |
| } | |
| function listLinks(){ | |
| links = [...document.getElementsByClassName("unviewed")]; | |
| for(let i in links){ | |
| l=links[i]; | |
| toOpen=[...l.getElementsByClassName("external")][0] | |
| console.log(toOpen) | |
| toOpen.click(); //open link | |
| [...l.getElementsByClassName("checkbox-uuid")][0].click(); // check | |
| } | |
| //viewed | |
| let viewed=getButton("Mark viewed") | |
| if (!viewed) viewed=getButton("Marquer consulté") | |
| if (viewed) viewed.click() | |
| else alert("Viewed button unreachable") | |
| } | |
| function init_css(){ | |
| return ` | |
| <button id="mybutt">View all</button> | |
| <style> | |
| #mybutt{position:absolute;top:50px;left:10px;height:30px;width:90px;} | |
| #mybutt{background:#0073ea;color:white;padding-top:5px;text-align:center;} | |
| #mybutt{z-index:99999;} | |
| </style> | |
| `; | |
| } | |
| 'use strict'; | |
| const $ = document.querySelector.bind(document); | |
| $('body').insertAdjacentHTML('beforeend', init_css() ); | |
| setTimeout(() => { | |
| //setTimeout needed to allow a few ms for the new Btn to be injected onto page | |
| $('#mybutt').addEventListener('click', () => { | |
| listLinks(); | |
| }); | |
| },500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment