vivo直接跳packname页

vivo游戏链接直接跳packname页

// ==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("当前链接不符合要求");
}