您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Speak truth about Route53
// ==UserScript== // @name Route53 Truther // @namespace http://offby1.net/ // @version 0.1.1 // @description Speak truth about Route53 // @author Chris Rose // @include /^https:\/\/[a-z0-9.-]*console\.aws\.amazon\.com\/.*$/ // @include /^https:\/\/[a-z0-9.-]*console\.amazonaws\.cn\/.*$/ // @include /^https:\/\/[a-z0-9.-]*console\.amazonaws-us-gov\.com\/.*$/ // @grant GM_log // ==/UserScript== (function() { 'use strict'; var MutationObserver = window.MutationObserver; var myObserver = new MutationObserver (mutationHandler); var obsConfig = { childList: true, attributes: true, subtree: true, attributeFilter: ['aria-expanded'] }; myObserver.observe(document, obsConfig); })(); function mutationHandler(mutationRecords) { mutationRecords.forEach(m => { if (ready(m.target.nextElementSibling)) { makeAMove(rightThingWrongPlace(m.target.nextElementSibling), rightPlace(m.target.nextElementSibling)); }; }); // if (ready()) { // makeAMove(rightThingWrongPlace(), rightPlace()); // } } function ready(node) { return node && node.getElementsByClassName("ico-networking").length == 1 && node.getElementsByClassName("ico-networking")[0].parentElement.parentElement.getElementsByTagName("ol").length == 1 && node.getElementsByClassName("ico-database").length == 1 && node.getElementsByClassName("ico-database")[0].parentElement.parentElement.getElementsByTagName("ol").length == 1; } function rightThingWrongPlace(node) { var childrenOfTheWrongKind = node.getElementsByClassName("ico-networking")[0].parentElement.parentElement.getElementsByTagName("ol")[0].childNodes; return Array.from(childrenOfTheWrongKind).find(e => e.textContent == "Route 53"); } function rightPlace(node) { return node.getElementsByClassName("ico-database")[0].parentElement.parentElement.getElementsByTagName("ol")[0]; } function makeAMove(theThing, thePlace) { if (theThing === undefined || thePlace === undefined) { return; } thePlace.insertBefore(theThing, thePlace.firstChild); }