Jump to content

User:Aveaoz/AutoMobileRedirect

From Wikipedia, the free encyclopedia

This script automatically redirects to desktop site when mobile links are opened on desktop. It does not change the behavior on mobile devices (unless desktop mode is enabled).

Installation

Add mw.loader.load("https://en.wikipedia.org/w/index.php?title=User:Aveaoz/AutoMobileRedirect.js&action=raw&ctype=text/javascript"); to your common.js file.

Thanks to

This is a very lazy script and just adds an extra check to User:Þjarkur/NeverUseMobileVersion, and as such most credit goes there. I also based this page on that documentation page.

The mobile device detection logic is based on https://stackoverflow.com/a/7995898/3286892.