NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Cloudfront URL // @namespace http://tampermonkey.net/ // @version 0.1 // @description Adds a Cloudfront URL // @author Alexander Cardosi // @match https://s3.console.aws.amazon.com/s3/* // @grant none // @license MIT // ==/UserScript== (function() { const addLink = async () => { const wrapper = document.querySelector(".overview"); const header = document.createElement("div"); header.classList.add("header"); header.style.marginTop = "10px"; const headerText = document.createTextNode("CloudFront URL"); header.appendChild(headerText); const objLink = document.querySelector("#object-link") let clone = objLink.cloneNode(true); const newLink = clone.href.replace("calypso-assets.s3.us-east-2.amazonaws.com", "d24o3wxfwnbuc.cloudfront.net") clone.setAttribute("href", newLink); clone.setAttribute("id", "clone"); clone.innerHTML = newLink; wrapper.appendChild(header); wrapper.appendChild(clone); } const addLinkLoop = () => { setInterval(function(){ if (document.querySelector("#object-link").href.includes("calypso") && document.querySelector("#clone") === null) { addLink(); } }, 300); } window.addEventListener("load",addLinkLoop) })();