Was this page helpful?

Change Firefox Save As Dialog

    Table of contents
    No headers

    The default GTK 'Save As...' dialog is painfully unintuitive, and I've found a way to make FireFox use the more familiar KDE/Qt style dialog.

    Edit the file /usr/lib/mozilla/components/nsFilePicker.js and find the following:

    function (compMgr, fileSpec, location, type)
    {
        debug("registering (all right -- a JavaScript module!)");
        compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
    
        compMgr.registerFactoryLocation(FILEPICKER_CID,
                                        "FilePicker JS Component",
    //@line 278 "/builds/tinderbox/Fx-Mozilla1.8.0....
                                        "",
    //@line 280 "/builds/tinderbox/Fx-Mozilla1.8.0....
                                        fileSpec,
                                        location,
                                        type);
    }
    

    ...and replace it with the following:

     

    function (compMgr, fileSpec, location, type)
    {
        debug("registering (all right -- a JavaScript module!)");
        compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
    
        compMgr.registerFactoryLocation(FILEPICKER_CID,
                                        "FilePicker JS Component",
    //@line 278 "/builds/tinderbox/Fx-Mozilla1.8.0....
                                        FILEPICKER_CONTRACTID,
    //@line 280 "/builds/tinderbox/Fx-Mozilla1.8.0....
                                        fileSpec,
                                        location,
                                        type);
    }
    

    Actually, the only thing that changed was the FILEPICKER_CONTRACTID, which appears in place of the original "" in the first block. But if it's too hard to spot, just replace the entire function.

    To make this change take effect, you need to reset Firefox's chrome registry, which you can do by installing or disabling an extension, then restarting Firefox. Now, when you need to open or save a file, it should come up with the KDE/Qt style dialog, rather than the default GTK file dialogs.

    To make GTK+ applications take on the current Qt/KDE theme by default, simply cast gtk-qt-engine.
    Was this page helpful?
    Tag page (Edit tags)
    • No tags
    You must login to post a comment.
    Powered by MindTouch Core