Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Last active March 10, 2019 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatghoul/612d3e4dcee3a6209174762940604b17 to your computer and use it in GitHub Desktop.
Save greatghoul/612d3e4dcee3a6209174762940604b17 to your computer and use it in GitHub Desktop.
UserScript - 阿里云解析备注显示
// ==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