I do it:
// ==UserScript==
// @name Yandex :: Show cache link
// @version 1.01
// @author Ciber SLasH
// @createDate 2016-04-17
// @modifyDate
// @description Restore Yandex Cache link
// @include https://*yandex.*
// ==/UserScript==
function linksJob(links) {
for (var i=0; i<links.length; i++) {
// div.popup2 popup2_target_anchor popup2_theme_normal
popup2_autoclosable_yes serp-url__popup i-bem
var obj = links[i].nextSibling.lastChild;
for (var j = 1; j < obj.childNodes.length; j++) {
obj.removeChild(obj.childNodes[j]);
}
var curObj = obj.firstChild;
if (curObj.tagName == 'A' &&
curObj.className.indexOf('link') != -1
) {
var link = curObj.href;
// target: span.serp-url__arrow
var targetElemem = curObj.parentNode;
targetElemem.previousSibling.setAttribute('style', [
'margin-left: 1em !important;',
'background: none !important;',
'display: inline !important;',
'color: black !important;',
].join('\r\n'));
var newElem = document.createElement('A');
newElem.href = link;
newElem.text = curObj.text;
targetElemem.previousSibling.appendChild(newElem);
}
}
}
var QUERY = 'h2.serp-item__title';
linksJob(document.querySelectorAll(QUERY));
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.