vivo直接跳packname页

vivo游戏链接直接跳packname页

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         vivo直接跳packname页
// @namespace    https://greasyfork.org/users/1284284
// @version      0.1
// @description    vivo游戏链接直接跳packname页
// @author       喃哓盐主
// @run-at       document-start
// @match        https://*/*
// @grant        none
// ==/UserScript==


// 获取当前URL
var currentUrl = window.location.href;

// 如果当前URL包含https://game.vivo.com.cn/#/detail/和/?source
if (currentUrl.includes('https://game.vivo.com.cn/#/detail/') && currentUrl.includes('/?source')) {
   
    
    // 构建新的URL
    var newUrl = currentUrl.replace('https://game.vivo.com.cn/#/detail/', 'https://game.vivo.com.cn/api/game/getDetail?id=').replace('/?source', '&?source');

    // 访问新的URL
    window.location.href = newUrl;
} else {
    console.log("当前链接不符合要求");
}