Greasy Fork

49直接跳包名页

49游戏链接直接跳包名页

当前为 2024-04-06 提交的版本,查看 最新版本

// ==UserScript==
// @name        49直接跳包名页
// @namespace   https://greasyfork.org/users/1284284
// @version     1.0
// @description 49游戏链接直接跳包名页
// @match       http://a.4399.cn/mobile/*.html
// @grant       none
// ==/UserScript==


(function() {
  const url = window.location.href;
  const regex = /http:\/\/a\.4399\.cn\/mobile\/(.+)\.html/;
  const match = url.match(regex);

  if (match) {
    const gameId = match[1];
    const newUrl = `https://dl.yxhapi.com/android/box/game/v6.2/apk.html?id=${gameId}`;

    window.location.href = newUrl;
  }
})();