Last active
July 12, 2019 14:58
-
-
Save lshaf/3f0ff89d97c296a2e53b2e5a4b1e6573 to your computer and use it in GitHub Desktop.
to read all
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 Digital Ocean Notification Reader | |
// @namespace https://gist.github.com/lshaf | |
// @version 1.0.2 | |
// @description try to take over the world! | |
// @author L Shaf | |
// @match https://cloud.digitalocean.com/notifications* | |
// @run-at document-end | |
// @grant none | |
// @downloadURL https://gist.github.com/lshaf/3f0ff89d97c296a2e53b2e5a4b1e6573/raw/924299546536a4febab8c2628697668aa6863ed2/do_notification.user.js | |
// @updateURL https://gist.github.com/lshaf/3f0ff89d97c296a2e53b2e5a4b1e6573/raw/924299546536a4febab8c2628697668aa6863ed2/do_notification.user.js | |
// ==/UserScript== | |
(function() { | |
function readAll() { | |
var rows = document.querySelectorAll(".notification-row"); | |
for (var row of rows) { | |
if (!row.classList.contains("acknowledged")) { | |
row.click() | |
row.click() | |
} | |
} | |
} | |
var body = document.querySelector("body"); | |
var ele = document.createElement("div"); | |
ele.style.cssText = "bottom: 20px;position: fixed;right: 20px;background: #0069ff;padding: 5px 15px;border-radius: 20px;color: white;" | |
ele.onclick = readAll | |
ele.innerText = "Mark all as read" | |
body.append(ele) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment