(网页版和手机版均适配,API数据获取可能需翻墙)支持1天、3天、7天、14天、30天价格走势图;“更新价格数据Update Data”按钮一次性获取近30日数据(约720条),不弹出图表;图表弹窗基于全量数据进行数据清洗、移动平均计算及趋势线显示(默认隐藏);记录用户选择的日期范围和图例显示状态;网页版为悬浮窗,手机版为弹窗全屏旋转90°展示,右上角有退出按钮。
< Părere la script-ul MWI Price History Viewer Modified - 银河牛牛商城中物品价格走势小助手
感谢提供解决方案,之后会一并更新解决已知问题
这个插件与一个任务列表美化的插件TaskManager冲突,会导致此插件的图标消失,可改按钮插入的这段代码解决
function handleMarketNavButtonContainerNode(mutationsList) {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
mutation.addedNodes.forEach(node => {
if (node.nodeType === Node.ELEMENT_NODE &&
node.classList.contains('MarketplacePanel_marketNavButtonContainer')) {
// 检查是否已添加过按钮
const existingButtons = node.querySelectorAll('#mwPriceHistoryBtn, #mwUpdateDataBtn');
if (existingButtons.length >= 2) return;
// 克隆并添加按钮
const buttons = node.querySelectorAll('button');
if (buttons.length > 0) {
const lastButton = buttons[buttons.length - 1];
const showButton = lastButton.cloneNode(true);
showButton.textContent = Strings.show_btn_title;
showButton.id = 'mwPriceHistoryBtn'; // 唯一ID
showButton.onclick = showPopup;
node.appendChild(showButton);
const updateButton = lastButton.cloneNode(true);
updateButton.textContent = Strings.update_btn_title;
updateButton.id = 'mwUpdateDataBtn'; // 唯一ID
updateButton.classList.add('updateDataBtn');
updateButton.onclick = updateData;
node.appendChild(updateButton);
}
}
});
}
}
}