คู่มือนี้มี 4 ส่วน: 1) Bookmarklet 2) Userscript 3) Extension 4) Eruda • เน้นใช้ console.js
เป็นหลัก
เลือกว่าจะโหลดจากไฟล์ในเครื่อง (รีโปนี้) หรือจากโปรเจกต์ที่ Deploy อยู่
https://goonee.netlify.app/console.js
../console.js
คัดลอกโค้ดไปสร้างปุ่มลัด แล้วกดบนหน้าเว็บที่ต้องใช้เครื่องมือ
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/console.js?t='+Date.now();s.onload=function(){try{toggleConsole&&toggleConsole();}catch(e){}};document.body.appendChild(s);})();
คัดลอกโค้ด เปิดไฟล์ console.js
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/loader.js?t='+Date.now();document.body.appendChild(s);})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/monitor.js';document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/Theme.js';document.body.appendChild(s)})();
หมายเหตุ: บางเว็บอาจบล็อกสคริปต์ภายนอก (CSP) ให้ใช้ Extension หรือ Userscript แทน
คัดลอกโค้ดสำหรับเครื่องมือที่ต้องการใช้งาน
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/monitor.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/Theme.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/snipers.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/burpshark.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/sharkscan.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/postshark.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/deldis.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/tool.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/BM.js?t='+Date.now();document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/sharktool/BM-postshark.js?t='+Date.now();document.body.appendChild(s)})();
ปล. ไฟล์ sharksnipers.js
ปัจจุบันว่างเปล่า จึงยังไม่สร้าง Bookmarklet ให้
คัดลอกสคริปต์นี้ไปวาง
// ==UserScript==
// @name SharkTool Console Toggle (Floating Button)
// @namespace sharktool
// @version 1.0.0
// @description Floating button to toggle the SharkTool console loaded from your Netlify
// @match *://*/*
// @grant GM_addStyle
// @run-at document-end
// ==/UserScript==
(function(){
'use strict';
const SCRIPT_URL = 'https://goonee.netlify.app/console.js'; // ← เปลี่ยนเป็นไฟล์ของคุณ
// ตั้ง URL ของ Eruda เองได้ (ถ้าจะใช้)
window.ERUDA_URL = 'https://cdn.jsdelivr.net/npm/eruda@3/eruda.min.js';
if (window.__shark_console_btn) return;
function addStyle(css){
try{ if (typeof GM_addStyle==='function'){ GM_addStyle(css); return; } }catch(_){ }
const s=document.createElement('style'); s.textContent=css; document.head.appendChild(s);
}
addStyle(`
#__shark_toggle_btn{position:fixed;right:16px;bottom:16px;width:48px;height:48px;border-radius:50%;
background:#00ff41;color:#062;display:flex;align-items:center;justify-content:center;font-size:22px;font-weight:700;
box-shadow:0 6px 18px rgba(0,0,0,.35),0 0 0 2px #00ff41 inset;cursor:pointer;user-select:none;z-index:2147483647;
transition:transform .12s ease, box-shadow .12s ease;touch-action:none}
#__shark_toggle_btn:hover{ transform: translateY(-1px); box-shadow:0 8px 22px rgba(0,0,0,.45),0 0 0 2px #00ff41 inset; }
#__shark_toggle_btn.__loading{ background:#ccc;color:#333;box-shadow:0 0 0 2px #bbb inset }
`);
function ensureConsoleLoaded(){
return new Promise((resolve, reject)=>{
if (window.toggleConsole){ resolve(undefined); return; }
const id='__shark_console_loader';
if (document.getElementById(id)){
const chk=setInterval(()=>{ if(window.toggleConsole){ clearInterval(chk); resolve(undefined);} },80);
setTimeout(()=>{ clearInterval(chk); window.toggleConsole?resolve(undefined):reject(new Error('Timeout')); },10000);
return;
}
const s=document.createElement('script'); s.id=id; s.src=SCRIPT_URL; s.async=true;
s.onload=()=> resolve(undefined);
s.onerror=()=> reject(new Error('Failed to load console.js'));
document.documentElement.appendChild(s);
});
}
function createButton(){
const btn=document.createElement('div');
btn.id='__shark_toggle_btn';
btn.title='SharkTool Console';
btn.textContent='≡';
btn.addEventListener('click', async ()=>{
btn.classList.add('__loading');
try{ await ensureConsoleLoaded(); window.toggleConsole(); }
catch(err){ console.error('[SharkTool] load error:',err); alert('Cannot load console.js'); }
finally{ btn.classList.remove('__loading'); }
});
document.body.appendChild(btn);
window.__shark_console_btn = btn;
}
createButton();
})();
หมายเหตุ: ถ้าเว็บไซต์มี CSP เข้มงวด อาจบล็อกการโหลดสคริปต์จากโดเมนภายนอก ให้โฮสต์ไฟล์ไว้บนโดเมนที่ได้รับอนุญาต หรือใช้ @require ของ Userscript แทน
กดปุ่ม 🧪 Eruda ในคอนโซลของ Goonee เพื่อโหลด/แสดง/ซ่อน
javascript:(function(){var s=document.createElement('script');s.src='https://cdn.jsdelivr.net/npm/eruda@3/eruda.min.js';s.onload=function(){eruda.init();eruda.show();};document.body.appendChild(s)})();
javascript:(function(){var s=document.createElement('script');s.src='https://goonee.netlify.app/console.js?t='+Date.now();s.onload=function(){try{toggleConsole&&toggleConsole();}catch(e){}};document.body.appendChild(s);})();
อย่านำไปใช้แบบมั่ว ๆ หรือใช้กับเว็บไซต์ที่ไม่ได้รับอนุญาต การรันโค้ดจากภายนอกหรือโค้ดที่แก้เอง (รวมถึง Bookmarklet) อาจใช้ eval
หรือสร้างสคริปต์ไดนามิก ซึ่งมีความเสี่ยงต่อความปลอดภัยและความเป็นส่วนตัวของคุณ
ควรใช้เฉพาะกับหน้าเว็บที่คุณมีสิทธิ์ทดสอบ/พัฒนา เท่านั้น และเข้าใจสิ่งที่โค้ดทำจริง ๆ หากคุณไม่ใช่นักพัฒนา การคัดลอกโค้ดจากที่อื่นมาใช้โดยไม่ตรวจสอบ อาจทำให้บัญชีหรือข้อมูลของคุณตกอยู่ในความเสี่ยง
สรุป: ใช้อย่างมีวิจารณญาณ ทดสอบบนสภาพแวดล้อมที่ควบคุมได้ และงดใช้งานบนเว็บที่ห้ามหรือผิดกฎ/กฎหมาย