How to access a window and a document in the Add-on SDK

I want to receive active window cookie information in an extension built using the Add-on SDK. How can i do this? I could not find any method in the documentation that has access to the window or the document. Also in some forums , people say that there is no access to them. Is this still not possible?

+4
source share
1 answer

You can access the document and therefore document.cookie through the content script; for more information on working with content scripts, see the documentation:

https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/modifying-web-pages-url.html

Edit: here is a simple example that allows you to retrieve cookie data for the current tab in the main add-on code:

https://github.com/canuckistani/jp-page-mod-cookie

+4
source

Source: https://habr.com/ru/post/1386945/


All Articles