User:Ὁ οἶστρος/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:Ὁ οἶστρος/common.css. |
importScript("User:GregU/dashes.js");
(function () {
// Find the link used to switch to the desktop view.
var desktopLink = document.getElementById("mw-mf-display-toggle");
if (desktopLink === null) {
return;
}
var href = desktopLink.getAttribute('href')
// Make sure we're not already in the desktop view, which could lead to
// an infinite loop.
if (href.indexOf('.m.') > -1) {
return;
}
// Navigate to the new URL, replacing the history element, as if we were
// never on the mobile site! You can use .assign() instead, if you want to
// keep the URL of the mobile site in your history.
window.location.replace(href);
})()