本帖最后由 于 2026-1-1 02:32 编辑
现在连iTunes 12.6.5.3都无法搜索应用了,不过好在能新购和下载APP。
除此之外,有些iPhone系统版本过低无法直接在手机App Store新购应用可以到iTunes上购买,购买完后手机上可能还是显示“购买”等字样,这是手机还没反应过来直接点击就会提示下载旧版本了。
脚本用法也很简单,浏览器打开App Store找到你要下载的应用然后点击侧栏的苹果图标跳转到iTunes。
脚本是纯AI写的,跳不过去的多试几遍。实在跳不过去就去问AI。
// ==UserScript==
// @name Apple Store跳转iTunes
// @version 1.0
// @match *://apps.apple.com/*
// @grant GM_setValue
// @grant GM_getValue
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
const getAppId = () => window.location.pathname.match(/\/id(\d+)/)?.[1];
const runJump = () => {
const appId = getAppId();
if (appId) {
window.location.href = `itms-apps://itunes.apple.com/app/id$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$${appId}?mt=8&ls=1`; }, 1000);
}
};
const initUI = () => {
if (document.getElementById('itunes-drawer-btn') || !window.location.pathname.includes('/app/')) return;
let side = GM_getValue('apple_side', 'right');
let topPos = GM_getValue('apple_top', window.innerHeight * 0.4);
const box = document.createElement('div');
box.id = 'itunes-drawer-btn';
box.innerHTML = `<div class="drawer-wrapper"><div class="drawer-h"></div><div class="drawer-btn">iTunes 打开</div></div>`;
const style = document.createElement('style');
style.textContent = `
#itunes-drawer-btn {
position: fixed; top: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$${topPos}px; height: 40px;
display: flex; align-items: center; z-index: 2147483647;
transition: opacity 0.3s; opacity: 0.6;
pointer-events: none; /* 防止隐形区域干扰 */
}
#itunes-drawer-btn:hover { opacity: 1; }
.drawer-wrapper {
display: flex; align-items: center; height: 100%;
background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(15px);
border: 0.5px solid rgba(255, 255, 255, 0.15);
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
pointer-events: auto; /* 仅让按钮区域响应鼠标 */
}
/* 右侧吸附修复:强制 0 间距 */
#itunes-drawer-btn.right { right: 0; margin-right: 0; }
#itunes-drawer-btn.right .drawer-wrapper {
border-radius: 20px 0 0 20px; border-right: none;
transform: translateX(calc(100% - 44px));
}
#itunes-drawer-btn.right:hover .drawer-wrapper { transform: translateX(0); }
/* 左侧吸附修复:强制 0 间距 */
#itunes-drawer-btn.left { left: 0; flex-direction: row-reverse; margin-left: 0; }
#itunes-drawer-btn.left .drawer-wrapper {
flex-direction: row-reverse; border-radius: 0 20px 20px 0; border-left: none;
transform: translateX(calc(-100% + 44px));
}
#itunes-drawer-btn.left:hover .drawer-wrapper { transform: translateX(0); }
.drawer-h {
width: 44px; height: 40px; color: #fff;
display: flex; align-items: center; justify-content: center;
font-size: 20px; flex-shrink: 0; cursor: pointer;
transition: transform 0.2s ease; user-select: none;
}
.drawer-h:hover { transform: scale(1.15); }
.drawer-btn {
padding: 0 15px 0 5px; color: rgba(255,255,255,0.9);
font-size: 12px; font-weight: 600; white-space: nowrap;
height: 100%; display: flex; align-items: center; cursor: pointer;
}
#itunes-drawer-btn.left .drawer-btn { padding: 0 5px 0 15px; }
`;
document.head.appendChild(style);
document.body.appendChild(box);
box.className = side;
let moved = false;
const h = box.querySelector('.drawer-h');
const btn = box.querySelector('.drawer-btn');
h.onclick = (e) => { if (!moved) runJump(); };
btn.onclick = () => runJump();
h.onmousedown = (e) => {
moved = false;
box.style.transition = 'none';
let startY = e.clientY, startTop = box.offsetTop;
const onMove = (ev) => {
if (Math.abs(ev.clientY - startY) > 5) {
moved = true;
box.style.top = (startTop + ev.clientY - startY) + 'px';
}
};
const onUp = (ev) => {
box.style.transition = '';
let s = (ev.clientX < window.innerWidth / 2) ? 'left' : 'right';
box.className = s;
GM_setValue('apple_side', s); GM_setValue('apple_top', box.offsetTop);
document.removeEventListener('mousemove', onMove);
document.removeEventListener('mouseup', onUp);
};
document.addEventListener('mousemove', onMove);
document.addEventListener('mouseup', onUp);
};
};
let lastUrl = location.href;
new MutationObserver(() => {
if (location.href !== lastUrl) {
lastUrl = location.href;
setTimeout(initUI, 500);
}
}).observe(document, {subtree: true, childList: true});
initUI();
})();
|