MediaWiki:Common.js: Difference between revisions

From Lenn's Fun Stuff

No edit summary
Tags: Mobile edit Mobile web edit
No edit summary
Tags: Mobile edit Mobile web edit
Line 1: Line 1:
/* FORCE DESKTOP MODE ON MOBILE */
if ( window.location.href.indexOf('mobileaction=toggle_view_mobile') === -1 &&
    window.location.href.indexOf('mobileaction=toggle_view_desktop') === -1 &&
    /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
   
    var url = new URL(window.location.href);
    url.searchParams.set('mobileaction', 'toggle_view_desktop');
    window.location.href = url.href;
}
/* FORCE DESKTOP SCALE */
/* FORCE DESKTOP SCALE */
(function() {
(function() {

Revision as of 01:47, 15 March 2026

/* FORCE DESKTOP MODE ON MOBILE */
if ( window.location.href.indexOf('mobileaction=toggle_view_mobile') === -1 && 
     window.location.href.indexOf('mobileaction=toggle_view_desktop') === -1 &&
     /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
    
    var url = new URL(window.location.href);
    url.searchParams.set('mobileaction', 'toggle_view_desktop');
    window.location.href = url.href;
}

/* FORCE DESKTOP SCALE */
(function() {
    var meta = document.createElement('meta');
    meta.name = "viewport";
    meta.content = "width=1200, initial-scale=0.3, maximum-scale=1.0";
    document.getElementsByTagName('head')[0].appendChild(meta);
})();