Greasy Fork

Greasy Fork is available in English.

13 京东手机版跳转电脑版

京东手机版跳转电脑版

当前为 2022-03-04 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         13 京东手机版跳转电脑版
// @namespace    使用说明网址 找插件网
// @version      1.0
// @description  京东手机版跳转电脑版
// @author       老码(老码农)
// @match        *://*/* 
// @grant        none
// ==/UserScript==
 

(function () {
    'use strict';

    var type = 2;//1 如果电脑端,转手机端;2 手机端转电脑端
    var lhref = location.href;
    if (type == 1) {
        if (!lhref.includes('.m.')) {
            var newurl = lhref.replace("https://item.jd.com/", "https://item.m.jd.com/product/");
            location.href = newurl;
        }
    }
    if (type == 2) {
        if (lhref.includes('.m.')) {
            var newurl = lhref.replace("https://item.m.jd.com/product/", "https://item.jd.com/");
            location.href = newurl;
        }
    }

})();