ميدياويكي:Mobile.js
Appearance
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)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
mw.loader.using('mediawiki.util').then(() => { /**
* @source https://www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL
* @revision 2020-04-04
*/
var extraCSS = mw.util.getParamValue('withCSS'),
extraJS = mw.util.getParamValue('withJS');
if (extraCSS) {
// WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks)
if (/^MediaWiki:[^&<>=%#]*\.css$/.test(extraCSS)) {
mw.loader.load('/w/index.php?title=' + encodeURIComponent(extraCSS) + '&action=raw&ctype=text/css', 'text/css');
} else {
mw.notify('يُسمح فقط بالصفحات من نطاق ميدياويكي فقط.', { title: 'قيمة withCSS غير صالحة' });
}
}
if (extraJS) {
// WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks)
if (/^MediaWiki:[^&<>=%#]*\.js$/.test(extraJS)) {
mw.loader.load('/w/index.php?title=' + encodeURIComponent(extraJS) + '&action=raw&ctype=text/javascript');
} else {
mw.notify('يُسمح فقط بالصفحات من نطاق ميدياويكي فقط.', { title: 'قيمة withJS غير صالحة' });
}
}
} );