Fix Inscriboor bridge and add update signaling

This commit is contained in:
matcha committed 2026-10-05 05:41:33 +00:00
1 parent 00309d7c4d
commit 30efbf92b9
11 files changed
+21 -10

No files matched your search

+3 -1
View File
@@ -13357,7 +13357,9 @@ chrome.runtime.onConnect.addListener((port) => {
if (port.name !== "inscriboor-provider") return;
port.onMessage.addListener(async (message) => {
try {
if (message.method === "bitcoin_getAccounts") {
if (message.method === "inscriboor_getVersion") {
port.postMessage({ id: message.id, result: chrome.runtime.getManifest().version });
} else if (message.method === "bitcoin_getAccounts") {
const me = await account();
port.postMessage({ id: message.id, result: [{ address: me.address, pubkey: me.pubkey, network: me.network }] });
} else if (message.method === "bitcoin_getNetwork") {
+1 -1
View File
@@ -1 +1 @@
(() => {n let port;n const connect = () => {n port = chrome.runtime.connect({ name: "inscriboor-provider" });n port.onMessage.addListener(message => window.postMessage({ source: "inscriboor-extension", ...message }, "*"));n port.onDisconnect.addListener(() => { port = null; });n };n connect();n window.addEventListener("message", event => {n if (event.source !== window || event.data?.source !== "inscriboor-page") return;n if (!port) connect();n port.postMessage({ id:event.data.id, method:event.data.method, params:event.data.params, origin:location.origin });n });n})();n
(() => {n let port;n const connect = () => {n port = chrome.runtime.connect({ name: "inscriboor-provider" });n port.onMessage.addListener(message => window.postMessage({ source: "inscriboor-extension", ...message }, "*"));n port.onDisconnect.addListener(() => { port = null; });n };n connect();n window.addEventListener("message", event => {n if (event.data?.source !== "inscriboor-page") return;n if (!port) connect();n port.postMessage({ id:event.data.id, method:event.data.method, params:event.data.params, origin:location.origin });n });n})();n
Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 238 B

+2 -2
View File
@@ -19,6 +19,6 @@
<button type="button" aria-pressed="false" data-feature="Nostr">Nostr</button>
<button type="button" aria-pressed="false" data-feature="Chain">Chain</button>
</nav>
<main aria-live="polite"><h2 id="feature">Wallet</h2><p id="description">Address, signing requests, and transaction approval.</p></main>
<p class="status">v0.2 · Super Testnet signing provider. Real-network vaulting comes later.</p>
<main aria-live="polite"><h2 id="feature">Wallet</h2><p id="description">Address, signing requests, and transaction approval.</p><a id="update-extension" class="update-link" href="#" hidden>Update Inscriboor ↓</a></main>
<p class="status" id="version-status"></p>
</body></html>
+4 -3
View File
@@ -2,25 +2,26 @@
if (window.inscriboor) return;
const pending = new Map();
window.addEventListener("message", event => {
if (event.source !== window || event.data?.source !== "inscriboor-extension") return;
if (event.data?.source !== "inscriboor-extension") return;
const request = pending.get(event.data.id);
if (!request) return;
pending.delete(event.data.id);
event.data.error ? request.reject(new Error(event.data.error)) : request.resolve(event.data.result);
});
const provider = Object.freeze({
isInscriboor: true,
isInscriboor: true,n version: "0.2.2",
request({ method, params = {} } = {}) {
if (typeof method !== "string" || !method) return Promise.reject(new Error("A provider method is required."));
const id = crypto.randomUUID();
return new Promise((resolve, reject) => {
pending.set(id, { resolve, reject });
window.postMessage({ source: "inscriboor-page", id, method, params }, "*");
const timeout = method === "ord_signInscription" ? 120000 : 5000;
setTimeout(() => {
if (!pending.has(id)) return;
pending.delete(id);
reject(new Error("Inscriboor request timed out."));
}, 120000);
}, timeout);
});
}
});
+5 -2
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Inscriboor",
"version": "0.2.1",
"version": "0.2.2",
"description": "Bitcoin/ordinal signing wallet for Super Testnet experiments.",
"permissions": [
"storage"
@@ -52,5 +52,8 @@
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
},
"host_permissions": [
"https://supertestnet.lol/*"
]
}
+3
View File
@@ -21,3 +21,6 @@ dl { display:grid; grid-template-columns:110px 1fr; gap:8px 12px; margin:18px 0;
dt { color:GrayText; } dd { margin:0; overflow-wrap:anywhere; }
.actions { display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
.error { color:#d33; }
.update-link { display:inline-block; margin-top:10px; color:#f7931a; font-weight:700; }
.update-link[hidden] { display:none; }