Firefox Sidebar and Document object of DOM

There is a webpage loaded in the firefox sidebar and another webpage loaded in the main document. Now, how do I ask access the main document object through the Firefox sidebar? An example to do this through Javascript code in the firefox sidebar document to access the main document would be helpful.

Thanks for the answers. I have to refine my question however. The main window has some webpage loaded and the sidebar has a webpage. I want the sidebar window to know what text the user has selected on the main window when a link on the sidebar window is clicked. I know how to get the selected text from a window. Only that the sidebar element adds complexity to the problem that I am not able to surpass.

@PConory:

I like your answer, but when I try it there is an error:

Error: Permission denied to create wrapper for object of class UnnamedClass.

Thanks.

3
2022-07-25 20:41:51
Source Share
I'm not exactly sure just how a web page can ask for the opening of a web page in the sidebar, or the other way around. Yet if you can take care of that, make use of var child = window.open(...) to get a reference one instructions and also window.opener to get a reference the various other instructions.