21 lines
593 B
JavaScript
21 lines
593 B
JavaScript
"use strict";
|
|
|
|
const statusEl = document.getElementById("status");
|
|
const manage = document.getElementById("manage");
|
|
|
|
browser.runtime.sendMessage({ type: "status" }).then((info) => {
|
|
if (info && info.bindError) {
|
|
statusEl.textContent = `Port ${info.listenPort} is not available.`;
|
|
return;
|
|
}
|
|
if (info && info.hostUp) {
|
|
statusEl.textContent = `Ready on 127.0.0.1:${info.listenPort} while Firefox is open.`;
|
|
return;
|
|
}
|
|
statusEl.textContent = "You can issue and revoke secrets here.";
|
|
});
|
|
|
|
manage.addEventListener("click", () => {
|
|
browser.runtime.openOptionsPage();
|
|
});
|