Greasy Fork

Greasy Fork is available in English.

强制缩放与桌面模式

浏览器ua为手机ua时启用强制缩放,浏览器ua非手机ua时启用桌面模式

当前为 2022-08-30 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        强制缩放与桌面模式
// @author      酷安@耗子Sky
// @description 浏览器ua为手机ua时启用强制缩放,浏览器ua非手机ua时启用桌面模式
// @match       *://*/*
// @grant       none
// @version     2.0
// @run-at      document-end
// @author      -
// @namespace http://greasyfork.icu/users/452911
// ==/UserScript==

!(function() {
   if (navigator.userAgent.indexOf('Mobile')<0) {
 document.querySelector('meta[name=viewport]').setAttribute('content','width=device-width,initial-scale=0.33,maximum-scale=10.0,user-scalable=1');
}
})();
!(function() {  if (navigator.userAgent.indexOf('Mobile')>=0 && window.innerWidth<700) { document.querySelector('meta[name=viewport]').setAttribute('content','width=device-width,initial-scale=1.0,maximum-scale=10.0,user-scalable=1');
}
})();