App Store BundleID Viewer

Display the bundleID on Apple App Store preview pages

当前为 2025-05-23 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         App Store BundleID Viewer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Display the bundleID on Apple App Store preview pages
// @author       sharmanhall
// @match        https://apps.apple.com/*/app/*/id*
// @icon         https://www.apple.com/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    async function getBundleID() {
        const appIdMatch = window.location.href.match(/id(\d+)/);
        if (!appIdMatch) {
            console.warn('[BundleID Viewer] App ID not found in URL.');
            return;
        }

        const appId = appIdMatch[1];
        const lookupUrl = `https://itunes.apple.com/lookup?id=${appId}`;

        try {
            const response = await fetch(lookupUrl);
            const data = await response.json();

            if (!data.results || !data.results[0] || !data.results[0].bundleId) {
                console.warn('[BundleID Viewer] Bundle ID not found in API response.');
                return;
            }

            const bundleId = data.results[0].bundleId;
            console.log('[BundleID Viewer] Found Bundle ID:', bundleId);
            showBundleID(bundleId);
        } catch (err) {
            console.error('[BundleID Viewer] Error fetching bundle ID:', err);
        }
    }

    function showBundleID(bundleId) {
        const infoBox = document.createElement('div');
        infoBox.textContent = `📦 Bundle ID: ${bundleId}`;
        infoBox.style.position = 'fixed';
        infoBox.style.bottom = '20px';
        infoBox.style.right = '20px';
        infoBox.style.backgroundColor = '#000';
        infoBox.style.color = '#fff';
        infoBox.style.padding = '8px 12px';
        infoBox.style.borderRadius = '6px';
        infoBox.style.boxShadow = '0 0 10px rgba(0,0,0,0.5)';
        infoBox.style.zIndex = '9999';
        infoBox.style.fontSize = '14px';
        infoBox.style.fontFamily = 'monospace';
        document.body.appendChild(infoBox);
    }

    window.addEventListener('load', getBundleID);
})();