// ==UserScript== // @name 影片音量增強器 // @version 0.0.29 // @author HentaiSaru // @description 增強影片音量上限,最高增幅至 10 倍,尚未測試是否所有網域都可使用,當影片無聲時,禁止該腳本在該網域上運行。 // @match *://*/* // @exclude *://video.eyny.com/* // @icon https://cdn-icons-png.flaticon.com/512/8298/8298181.png // @license MIT // @namespace https://greasyfork.org/users/989635 // @run-at document-end // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle // @grant GM_registerMenuCommand // @downloadURL none // ==/UserScript== (function(){if(/^(http|https):\/\/(?!chrome\/|about\/).*$/i.test(document.URL)){var u,k,l=new Map,m=location.hostname,y=document.createDocumentFragment(),v=n("get","\u555f\u7528\u7db2\u57df",[]),q=v.includes(m);w();setTimeout(()=>{z()},1E3);async function w(){A("video",7,a=>{try{k=q?n("get",m)||1:1,u=B(a,k),GM_addStyle("\n .Booster-Modal-Background {\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n z-index: 9999;\n overflow: auto;\n position: fixed;\n align-items: center;\n justify-content: center;\n }\n .Booster-Modal-Button {\n top: 0;\n margin: 3% 2%;\n color: #d877ff;\n font-size: 16px;\n font-weight: bold;\n border-radius: 3px;\n background-color: #ffebfa;\n border: 1px solid rgb(124, 183, 252);\n }\n .Booster-Modal-Button:hover,\n .Booster-Modal-Button:focus {\n color: #fc0e85;\n cursor: pointer;\n text-decoration: none;\n }\n .Booster-Modal-Content {\n width: 400px;\n padding: 5px;\n overflow: auto;\n background-color: #cff4ff;\n border-radius: 10px;\n text-align: center;\n border: 2px ridge #82c4e2;\n border-collapse: collapse;\n margin: 2% auto 8px auto;\n }\n .Booster-Multiplier {\n font-size:25px;\n color:rgb(253, 1, 85);\n margin: 10px;\n font-weight:bold;\n }\n .Booster-Slider {width: 350px;}\n div input {cursor: pointer;}\n "), C(),D({"\ud83d\udd0a [\u958b\u95dc] \u81ea\u52d5\u589e\u5e45":()=>E(v,m),"\ud83d\udee0\ufe0f \u8a2d\u7f6e\u589e\u5e45":()=>x(),"\ud83d\udcdc \u83dc\u55ae\u71b1\u9375":()=>alert("\u71b1\u9375\u547c\u53eb\u8abf\u6574\u83dc\u55ae!!\n\n\u5feb\u6377\u7d44\u5408 : (Alt + B)")})}catch{}})}function B(a,d){const c=new window.AudioContext,b=c.createMediaElementSource(a),e=c.createGain(),f=c.createBiquadFilter(),p=c.createBiquadFilter(),g=c.createDynamicsCompressor();a.volume=1;e.gain.value=d*d;g.ratio.value= 6;g.knee.value=.5;g.threshold.value=-14;g.attack.value=.02;g.release.value=.4;f.frequency.value=250;f.type="lowshelf";f.gain.value=2.2;p.frequency.value=1E4;p.type="highshelf";p.gain.value=1.8;b.connect(e);e.connect(f);f.connect(p);e.connect(g);g.connect(c.destination);a.setAttribute("Video-Audio-Booster",!0);return{setVolume:function(r){e.gain.value=r*r;k=r}}}async function x(){const a=document.createElement("div"); a.innerHTML=`