Mobile 1668 to Desktop

Auto Redirect from mobile 1668 to desktop

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Mobile 1668 to Desktop
// @namespace    https://www.reddit.com/user/RobotOilInc
// @version      0.1.1
// @description  Auto Redirect from mobile 1668 to desktop
// @author       RobotOilInc
// @match        https://m.1688.com/offer/*.html*offerId=*
// @match        https://m.1688.com/offer/*.html*
// @license      MIT
// @homepageURL  https://greasyfork.org/en/scripts/430178-mobile-1668-to-desktop
// @supportURL   https://greasyfork.org/en/scripts/430178-mobile-1668-to-desktop
// @run-at       document-start
// @icon         https://img.alicdn.com/tfs/TB1uh..zbj1gK0jSZFuXXcrHpXa-16-16.ico?x-icon
// ==/UserScript==

/* jshint esversion: 6 */

// Regex to grab offerId if not in URL
const regex = /https?:\/\/m\.1688\.com\/offer\/(.*)\.html/i;

// Get the offerId
let offerId = (new URLSearchParams(window.location.search)).get('offerId');
if (offerId == null) {
    offerId = regex.exec(window.location.href)[1]
}

window.location.href = `https://detail.1688.com/offer/${offerId}.html`;