In the previous episode, I talked a bit about why I really, really don’t like the existing prompting code in Mozilla. I’ve been working on improving the situation.
The first big chunk of work is up for review in bug 563274. This basically removes all of the existing prompting code from
/embedding, and creates a new component in
For this first step, I’ve tried to keep things backwards-compatible and avoid breaking existing code. In fact, the UI is the exactly the same and the pile of nsIPrompt* / nsIAuthPrompt* interfaces are unchanged; there’s just a shiny new implementation underneath it all. But if anyone’s likely to find surprises, it’s probably embedders who are providing their own implementation of the existing code (eg, to implement their own non-XUL prompts). In theory those existing implementations should still work, but there might be some subtle bugs, build-goop changes, or patch dependencies on now-deleted code… The typical kinds of things that are expected when overhauling crufty old code, but these shouldn’t be hard to fix.
That said, this is just the first step. Upcoming steps are more likely to require changes that may break existing code. Even previously frozen interfaces like nsIPrompt / nsIPromptService might be thawed and changed (though we won’t take that step lightly). A few of the things I’m mulling over:
- Make password manager watch prompt notifications, instead of implementing prompt interfaces.
- Implementing tab-modal prompts.
- Eliminate the nsIAuthPrompt-in-nsIAuthPrompt2 wrappers
- Simplify the way chrome XHR handlers can override the default authentication prompting
- Simplify the existing pile of interfaces (so instead of having 6 ways to do the same thing there are only 2 or 3. :)
More updates as plans solidify.