Skip to content

Instantly share code, notes, and snippets.

@MasterTuto
Created January 5, 2023 16:59
Show Gist options
  • Save MasterTuto/356674e27bd8fe439f5422d21a1cce10 to your computer and use it in GitHub Desktop.
Save MasterTuto/356674e27bd8fe439f5422d21a1cce10 to your computer and use it in GitHub Desktop.
Runrun it, ir para issue
// ==UserScript==
// @name New script - runrun.it
// @namespace Violentmonkey Scripts
// @match https://runrun.it/*
// @grant none
// @version 1.0
// @author -
// @description 1/5/2023, 8:28:41 AM
// ==/UserScript==
let applied = false;
const addLinks = () => {
const links = document.querySelectorAll(".overlay-locker__container > div:nth-child(2) > div > div:nth-child(2) > div > div:nth-child(2) > div");
console.log(links);
if (!links.length) applied = false;
if (applied) {
setTimeout(addLinks, 500);
return;
}
for (let link of links) {
const urlDiv = link.querySelector("div:nth-child(2)");
const url = urlDiv.innerText.match(/(http[^ ]+)/)[0]
const anchor = document.createElement("a");
anchor.id = "chanchor";
anchor.innerText = "Ir para issue";
anchor.target = "_blank";
anchor.href = url;
link.appendChild(anchor)
applied = true;
}
setTimeout(addLinks, 500);
}
addLinks();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment