乾淨ㄉ原價屋

讓我好好的選零件…

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         乾淨ㄉ原價屋
// @namespace    https://github.com/FlandreDaisuki
// @description  讓我好好的選零件…
// @version      2021.05.20
// @author       FlandreDaisuki
// @match        *://www.coolpc.com.tw/evaluate.php
// @require      https://unpkg.com/[email protected]/dist/sentinel.js
// @noframes
// @license      MIT
// ==/UserScript==

// 推薦搭配 AdGuard Annoyances 過濾清單

/* cSpell:ignore vwpro mesg Ttitle Fitem */
/* global sentinel */

const $ = (s) => document.querySelector(s);

// 取消鎖右鍵
document.body.removeAttribute('oncontextmenu');
document.body.removeAttribute('onselectstart');

// 總金額預覽移到上面
sentinel.on('#fDiv', (floatingBar) => {
  sentinel.off('#fDiv');
  floatingBar.remove();
  $('#know').insertAdjacentElement('afterend', floatingBar);
});

// 保留輸出圖片功能
sentinel.on('#vwpro', () => {
  $('#doc').classList.add('zTop');
});

sentinel.on('button[onclick="Gauze(2)"]', (imageExportCancelBtnEl) => {
  sentinel.off('button[onclick="Gauze(2)"]');
  imageExportCancelBtnEl.addEventListener('click', () => {
    $('#doc').classList.remove('zTop');
  });
});

// 刪除無用的 iframe
const iframeSelectors = [
  'iframe[src^="/home"]',
  'iframe[src$="eval-mesg.php"]',
];

sentinel.on(String(iframeSelectors), (iframe) => {
  iframe.remove();
});

// 調整樣式
const styleEl = document.createElement('style');
document.body.appendChild(styleEl);
styleEl.textContent = `
body {
  overflow: auto !important;
}
#Psu,
#hid,
#Ttitle > tbody > tr:nth-of-type(1) > td:nth-of-type(2),
#Ttitle > tbody > tr:nth-of-type(2) {
  display: none !important;
}
#doc {
  z-index: -1 !important;
}
form[action="eva-excel.php"] {
  position: relative;
}
#Ttitle > tbody > tr:first-of-type > td:first-of-type {
  display: grid;
  grid-template-columns: repeat(2, auto);
}
#fDiv {
  position: relative;
  display: flex;
  transform: initial;
  left: inherit !important
}
#ftb {
  margin: 0;
  border: 2px solid black;
}
#Fitem {
  position: relative !important;
}
#doc.zTop {
  z-index: 20 !important;
  background: rgba(0, 0, 0, 0.8);
}
#MatchArea {
  position: absolute;
  top: 100%;
}`;