Joey_NostrComments on Nostr: If your browser extension uses sender.tab to tell web pages apart from its own pages, ...
If your browser extension uses sender.tab to tell web pages apart from its own pages, check this. I got it wrong in a signer and it cost me a release.
The background script refused privileged messages, like setting a PIN, whenever sender.tab was set. The reasoning: content scripts run in tabs, so a message with a tab came from a web page.
But the extension's own options page has a tab too, as soon as it is opened in one. So the extension blocked itself. PIN setup didn't throw an error or show a warning. It just did nothing.
The check that means what you intended is the sender's URL, not whether a tab exists: compare sender.url against browser.runtime.getURL(''). Your own pages pass, and anything a content script relays from a web page does not.
The second half of the same fix: the content-script bridge now forwards only an explicit list of message types. Before, some handlers were out of a page's reach only by accident, and an accident is not a boundary.
Published at
2026-10-04 12:15:47 UTCEvent JSON
{
"id": "dc5355f7fa2fbbb8f9763da59efa8a1ed0ef5fb7a851b87d58db130eaa213147",
"pubkey": "cb8db3a901199d6b94029f784c934c71b4a36561870d108e7b6b6c4cb3b0ead1",
"created_at": 1791116147,
"kind": 1,
"tags": [],
"content": "If your browser extension uses sender.tab to tell web pages apart from its own pages, check this. I got it wrong in a signer and it cost me a release.\n\nThe background script refused privileged messages, like setting a PIN, whenever sender.tab was set. The reasoning: content scripts run in tabs, so a message with a tab came from a web page.\n\nBut the extension's own options page has a tab too, as soon as it is opened in one. So the extension blocked itself. PIN setup didn't throw an error or show a warning. It just did nothing.\n\nThe check that means what you intended is the sender's URL, not whether a tab exists: compare sender.url against browser.runtime.getURL(''). Your own pages pass, and anything a content script relays from a web page does not.\n\nThe second half of the same fix: the content-script bridge now forwards only an explicit list of message types. Before, some handlers were out of a page's reach only by accident, and an accident is not a boundary.",
"sig": "29fd2216d9f0df67d724624284615e76ebbdeb36109f98900cfaf1e14afd42625080b22262fbe8ffd1a30f7245a3df1541f3de2eb4fb767c4ccd8f5dbe694c7a"
}