MediaWiki JavaScript way to view the history of a page
+0
−0
I wish to view the revision-history-webpage of a webpage in MediaWiki without the conventional button to do so (I've disabled that button for aesthetic reasons).
Please disable the MediaWiki View History built-in button and try this keypress JavaScript to view the revision history of an article (credit to user:hkotsubo).
let domain = window.location.host;
let protocol = window.location.protocol;
let h1 = document.querySelector("h1");
window.addEventListener('keydown', function(event) {
if (event.altKey && event.shiftKey && event.key === 'H') {
window.location.href = `${protocol}//${domain}/index.php?title=${h1.innerText}&action=history`;
}
});
Running this code in MediaWiki 1.36.1 in Hebrew doesn't work.
I get "אין פעולה כזו" (there's no such action).
Why would this happen and how to solve that problem?
1 comment thread