您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Dereferences mail.ru links in emails when clicked.
当前为
- // ==UserScript==
- // @name mail.ru: clean links
- // @namespace lainscripts_mailru_clean_links
- // @include https://e.mail.ru/message/*
- // @version 1
- // @description Dereferences mail.ru links in emails when clicked.
- // @grant none
- // ==/UserScript==
- let clb = /^http:\/\/r\.mail\.ru\/clb[0-9]+\/(.*)/i,
- cgi = /^http:\/\/e\.mail\.ru\/cgi-bin\/link\?.*&(amp;)?url=([^&]*)/i; //http:\/\/r\.mail\.ru\/clb[0-9]+\/(.*)/i,
- clearLink = function() {
- for (let x in this)
- if (x.indexOf('__originUrl') > -1) {
- let res = cgi.exec(this[x]);
- if (res) this[x] = decodeURIComponent(res[2]);
- res = clb.exec(this[x]);
- if (res) this[x] = 'http://' + res[1];
- this.href = this[x];
- }
- },
- task = function () {
- let links = document.querySelectorAll('A[href^="http://r.mail.ru/clb"]:not(.fixed),A[href^="http://e.mail.ru/cgi-bin/link?"]:not(.fixed)');
- if (links.length > 0)
- for (let l of links) {
- l.classList.add("fixed");
- l.onclick = clearLink;
- console.log(l);
- }
- };
- (function link_monitor() { task(); setTimeout(link_monitor, 100); })();