I'm trying to add hidden browser
element dynamically from Firefox extension but, although it adds successfully, it gives me Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIWebNavigation.sessionHistory]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/bindings/browser.xml :: :: line 641" data: no]
Source File: chrome://global/content/bindings/browser.xml
Line: 647
Code looks like this:
let parent = document.querySelector("#browser");
let browser = document.createElement("browser");
browser.style.visibility = "hidden";
parent.appendChild(browser);
What I'm doing wrong here?