Last active
March 10, 2019 08:33
-
-
Save greatghoul/612d3e4dcee3a6209174762940604b17 to your computer and use it in GitHub Desktop.
UserScript - 阿里云解析备注显示
This file contains 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 阿里云云解析备注 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://dns.console.aliyun.com/ | |
// @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
const PATTERN_DNS_PAGE = /^\#\/dns\/setting\/.+$/; | |
const processRow = $row => { | |
const $remark = $row.find('[data-spm-click$="name=remark"]'); | |
const title = $remark.attr('title'); | |
if (title) { | |
$remark.html(`备注 (<span style="color:#000">${title}</span>)`); | |
} | |
}; | |
const isDnsPage = () => { | |
const hash = window.location.hash; | |
return PATTERN_DNS_PAGE.test(hash); | |
}; | |
const init = () => { | |
waitForKeyElements(".ant-table-row", processRow); | |
} | |
isDnsPage() && init(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment