🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

将V2ex移动版网页转为PC版网页

将 V2ex 移动版网页转为 PC 版网页

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         将V2ex移动版网页转为PC版网页
// @namespace    None
// @version      0.3
// @description  将 V2ex 移动版网页转为 PC 版网页
// @author       Owovo
// @match        *://*.v2ex.com/amp/*
// @grant        none
// ==/UserScript==

(function (){
    // 获取当前页面的 URL
    const url = location.href;

    // 判断 URL 中是否包含 "/amp/"
    if (url.includes("/amp/")) {
        // 将 URL 中的 "/amp/" 替换成 "/"
        const url1 = url.replace("/amp/", "/");

        // 截取 URL 中 "/t/" 后面的部分
        const url2 = url1.slice(url1.indexOf("/t/") + 1);

        // 构建新的 URL
        const newUrl = `${location.protocol}//www.v2ex.com/${url2}`;

        // 替换当前页面,并将新的 URL 重定向到新的 URL 上
        location.replace(newUrl);
    }
})();