MediaWiki:Gadget-redirect-mobilediff.js
Revision as of 18:10, 3 October 2022 by Jacmob (talk | contribs) (Created page with "→* * Automatically redirect Special:MobileDiff to Special:Diff for desktop users: ;if (mw.config.get('wgCanonicalSpecialPageName') == 'MobileDiff') { var diff = mw.config.get('wgPageName').replace('Mobile', ''); var wgArticlePath = mw.config.get('wgArticlePath'); window.location.replace(wgArticlePath.replace('$1', diff)); }")
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
1 /**
2 * Automatically redirect Special:MobileDiff to Special:Diff for desktop users
3 */
4
5 ;if (mw.config.get('wgCanonicalSpecialPageName') == 'MobileDiff') {
6 var diff = mw.config.get('wgPageName').replace('Mobile', '');
7 var wgArticlePath = mw.config.get('wgArticlePath');
8 window.location.replace(wgArticlePath.replace('$1', diff));
9 }