FoxInABox/ThingsThatShouldWork
Things That Should Work
Here we detail features we think should work but don't yet. Once we've figured out how to make them work, we make some notes and attach a patch.
Keeler is on it. The first issue here is that context menu click events aren't being forwarded to the remote browser. Bug 682813 has a patch that fixed this at one point, but it bitrotted, so I had to reconstruct it. Good news: this seems to work fine, now.
The next issue is that the context menu code we currently have makes heavy use of both content and chrome. This is to be expected, though, as it basically inspects the page to determine what's been clicked on, decides what elements of the context menu to show, and then runs callbacks that affect chrome, content, or both when a menu item is clicked on. Luckily, this leads to a not-unreasonable separated architecture. Using the message manager, we load a frame script into the content process that listens for contextmenu events. Upon receiving an event, that code gathers all the information that will be needed later about what kind of element was clicked on, whether anything is selected, etc. That information is passed to the chrome process through the message manager, which passes it to the context menu implementation. Given that blob of information, the appropriate items in the context menu are shown. When a menu item is clicked on, the appropriate action is taken. This may involve making other chrome calls or making calls into content via the message manager.
This patch is a work in progress. There are a number of things wrong with it, but at least forward and back work.
alert / prompt / confirm / other JS dialogs
Keeler is also on this. I have a patch that makes it work, but now I'm thinking I may have been going about it wrong. There could be a much smaller and more elegant solution. I initially started on this because it seemed more tractable than context menus, so even though it may not be essential that these work, it was a good learning exercise.
The important parts are:
- how to get at the message manager from content code
- that accessing a browser's contentWindow from chrome code will pretty much not work
- the differences between the browser, a browser element, a tabbrowser element, a browser which is really a tab in a tabbrowser, and so on
reload
?!
(neither F5 nor the reload button in the urlbar work)