You can get to the current tab's HTML "document" with:
gBrowser.contentDocument
Otherwise, if you are in the context of your extension, document will direct you to the XULDocument, which lets you select the XUL elements in the browser, and the ones that you added to the browser from your extension.
The contextmenu that you get from that command, is another xul element from the browser.