Hello all!
Help please, how make Greasemonkey-script so that in Yandex.Search link to
cache move from dropdown menu?
Now:
http://www.imageup.ru/img9/2408608/1.png
there is a wish so:
http://www.imageup.ru/img9/2408609/2.png
my script (attempt):
// ==UserScript==
// @name Yandex :: Show cache link
// @version 1.00
// @createDate 2016-04-17
// @modifyDate
// @description Restore Yandex Cache link
// @include https://*yandex.*
// ==/UserScript==
var css = "\
span.serp-url__arrow {display: none !important;}\
div.popup2.popup2_target_anchor.popup2_theme_normal.popup2_autoclosable_yes.serp-url__popup.i-bem,
div.popup2.popup2_target_anchor.popup2_autoclosable_yes.popup2_theme_normal.extralinks__popup.i-bem
{\
color: black !important;\
display: block !important;\
visibility: visible !important;\
border: 1px solid black !important;\
background-color: red !important;\
margin: 0 !important;\
padding: 0 !important;\
position: absolute !important;\
left: 0 !important;\
top: 0 !important;\
height: auto !important;\
line-height: auto !important;\
z-index: 1000 !important;\
}\
";
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
heads[0].appendChild(node);
}
}
function linksJob(links) {
for (var i=0; i<links.length; i++) {
var obj = links[i].nextSibling.lastChild;
console.log("className: " + obj.className);
obj.style.display = "inline !important";
obj.style.visibility = "visible !important";
obj.style.border = "1px solid black !important";
}
}
var QUERY = 'h2.serp-item__title';
linksJob(document.querySelectorAll(QUERY));
to work script change about:config
// disable "Content Security Policy"
security.csp.enable: false
--
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.