Search code examples
javascriptmozillathunderbird-addonthunderbird-webextensions

How do i access the thunderbird messenger window object from background script -Web extension


currently tried method. the returned object is not showing the array of window object,it showing only one object which is extension manager window , in fact there is two window opened in thundebrird one is messenger window (default) and the extension manager window. but even though it is not returning the html document object,it showing only some detail information of the window. I need to get the html document object of messenger window , please help me

Accessing from Background script var window = await browser.windows.getAll()


Solution

  • I do not believe you can access the HTML document of the window itself through the API. From the documentation, browser.windows.getAll() returns an array of Window objects, which only contain metadata about the window.

    Note that if you are trying to access to the HTML content of the messages themselves, this is doable through the messageDisplay API.

    Depending on your needs (and motivation), you could maybe work around the API's limitations by creating a so-called WebExtension Experiment.