Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
MediaWiki JavaScript way to view the history of a page
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 answer
I couldn't access the history due to having
$wgActions['history'] = false; # Complete history lockup;
In the web application root's LocalSettings.php file.
After I have commented this command, I could access the history just fine.
1 comment thread