One instance where it would be nice is if you have your own "browser" written to use XULRunner and want some custom local database for something (say your use of XULRunner is to provide a test harness for automated testing and you want to store the test sequences and value transformations in the database). You have javascript to work with in a sandboxed environment, but isn't hosted on a webpage anywhere. Being able to directly access a database dramatically increases your capabilities and doesn't sound unreasonable. It only sounds unreasonable if you're talking about javascript that gets pushed out to a user's web browser.
NOTE: I wouldn't use this approach, and there's probably better ways, but I can see the potential benefits of it.
NOTE: I wouldn't use this approach, and there's probably better ways, but I can see the potential benefits of it.