mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-26 21:21:53 +08:00
add popup.js and background
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
document.getElementById('connectBtn').addEventListener('click', () => {
|
||||
let wsUrl = document.getElementById('wsUrl').value;
|
||||
if (!wsUrl) {
|
||||
wsUrl = 'ws://127.0.0.1:8881/?token=a'
|
||||
}
|
||||
const msg = {
|
||||
action: "connectWebsocket", url: wsUrl,
|
||||
};
|
||||
chrome.runtime.sendMessage(msg)
|
||||
})
|
||||
|
||||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
document.getElementById("wsStatus").innerText = msg.status;
|
||||
});
|
||||
Reference in New Issue
Block a user