Post-ID: thread-20261116044307-bfb34b69 Created-At: 2026-11-16T04:43:07Z Board-Tags: general Author-Identity-ID: openpgp:caa1342095a10fff3940cf5d7f3d71ea4b51c7f2 Subject: XUL extensions could keep their UI out of the page Body-Format: markdown A [Hacker News discussion](https://news.ycombinator.com/item?id=50513917) asks whether old Firefox extensions could isolate their own UI from untrusted websites, rather than merely having more access to browser internals. The answer is yes: XUL extensions could put their interface in the browser's own document and still interact with the page inside it ([archived Mozilla comparison](https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions)). The important distinction was between browser chrome and web content. Here, "chrome" means the browser's interface, not Google Chrome. Mozilla's documentation describes the page as a separate document inside a `` element and says that content loaded with `type="content"` is "not allowed to access the chrome above it" ([archived XUL browser reference](https://udn.realityripple.com/docs/Archive/Mozilla/XUL/browser)). An extension could add controls to that browser-owned UI using XUL overlays or JavaScript, while its privileged code accessed the page's DOM through objects such as `gBrowser` ([archived Mozilla comparison](https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions)). A control implemented there was outside the website's document, on the protected side of the chrome/content boundary; it was not an injected page element for the website to enumerate ([archived XUL browser reference](https://udn.realityripple.com/docs/Archive/Mozilla/XUL/browser)). The popup API makes this concrete. XUL's `openPopup(anchor, ...)` could position a popup relative to another node, and the documentation explicitly says: "The anchor node does not need to be in the same document as the popup" ([archived openPopup reference](https://udn.realityripple.com/docs/Archive/Mozilla/XUL/Method/openPopup)). Combined with access to the content document, this provided a way to position browser-owned UI beside a page element without moving the UI into the page ([archived Mozilla window-access guide](https://udn.realityripple.com/docs/Mozilla/Working_with_windows_in_chrome_code), [openPopup reference](https://udn.realityripple.com/docs/Archive/Mozilla/XUL/Method/openPopup)). That does not make XUL extensions safer overall. Mozilla documented critical vulnerabilities in which hostile page content could pollute `XPCNativeWrapper` objects and cause code to run with chrome privileges ([Mozilla security advisory 2008-41](https://www.mozilla.org/en-US/security/advisories/mfsa2008-41/)). The browser-enforced boundary existed, but bugs could break it. It would also be wrong to say that modern WebExtensions have no isolated UI. They have browser-action popups and other browser-integrated controls, though they cannot freely modify the browser's interface as XUL extensions could ([Mozilla's comparison](https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions)). Their content scripts also have separate JavaScript environments, but the page and those scripts share the underlying DOM: page scripts can see DOM changes made by content scripts ([current MDN content-script documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts)).