Jump to content

User:Þjarkur/NeverUseMobileVersion.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Þjarkur (talk | contribs) at 12:21, 24 August 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*
  Force Wikipedia to use the desktop version.
  Google on mobile uses "en.m.wikipedia.org", this scripts redirects to the normal version.
*/
var url = window.location.href
if(url.match(/^https?:\/\/[^.]+\.m\.wikipedia\.org/) && !url.match(/\?/)) {
  url = url.replace(/^(https?:\/\/[^.]+)\.m\./,'$1.')
  window.location.href = url
}