A way to toggle the WaybackMachine's toolbar
当前为
// ==UserScript==
// @name Wayback Machine - toolbar toggler
// @name:fr Wayback Machine - (dé)masquer la barre d'outils
// @namespace https://github.com/Procyon-b
// @version 0.6
// @description A way to toggle the WaybackMachine's toolbar
// @description:fr Une méthode pour masquer/afficher la barre d'outils de WaybackMachine (web.archive.org)
// @author Achernar
// @match https://web.archive.org/web/*
// @grant none
// @noframes
// ==/UserScript==
(function() {
"use strict";
function fix(ev) {
var TO, st = document.createElement('style'), sts = document.getElementsByTagName('style');
st.innerText='#wm-ipp-base {opacity:0; min-height:1px;position:absolute;} #wm-ipp-base:hover {opacity: 1;} #wm-ipp-base.forcePriority {oposition:relative; z-index:99999;}';
(document.head || document.documentElement).appendChild(st);
for (st of sts) {
if (st.innerText.search('.wb-autocomplete-suggestions')+1) {
st.innerText='';
break;
}
}
sts=document.querySelectorAll('link[rel=stylesheet]');
for (st of sts) {
if (st.href.startsWith('https://web.archive.org/_static/') && !(st.href.search('/iconochive.css')+1) ) {
st.parentNode.removeChild(st);
}
}
this.removeEventListener('dblclick', fix);
document.body.addEventListener('keydown',function(ev){
force=ev.altKey && ev.ctrlKey;
if (force && !forceState) {
e.classList.add('forcePriority');
forceState=force;
if (TO) clearTimeout(TO);
TO=setTimeout(function(){
e.classList.remove('forcePriority');
forceState=false;
TO=0;
},3000);
if (e.shadowRoot.firstChild.style.display=='none') {
e.shadowRoot.firstChild.style.display='';
}
}
});
}
var e=document.getElementById('wm-ipp-base'), force=false, forceState=false;
if (e) {
e.addEventListener('dblclick', fix);
let ne=e.nextElementSibling;
if (ne && (ne.id=='donato')) ne.parentNode.removeChild(ne);
}
})();