~djl/bookmark-keys

98d0037b8b5eb472d946176b9bca24436e2d3183 — David Logie 12 years ago 4049b2c
Use PlacesUIUtils for bookmarklets.

This allows Command Keys to work with NoScript enabled.
1 files changed, 10 insertions(+), 6 deletions(-)

M src/chrome/content/command_keys.js
M src/chrome/content/command_keys.js => src/chrome/content/command_keys.js +10 -6
@@ 39,18 39,22 @@ var commandKeys = {
        var bookmarks_bar = result.root;
        bookmarks_bar.containerOpen = true;
        try {
            uri = bookmarks_bar.getChild(index).uri;
            node = bookmarks_bar.getChild(index);
        } catch (err) {
            uri = false;
            node = false;
        }
        bookmarks_bar.containerOpen = false;
        return uri
        return node
    },

    go: function(i) {
        var url = commandKeys.getBookmark(i);
        if (url) {
            gBrowser.loadURI(url);
        var node = commandKeys.getBookmark(i);
        if (node) {
            if (node.uri.indexOf("javascript:") == 0) {
                PlacesUIUtils.openNodeIn(node);
            } else {
                gBrowser.loadURI(node.uri);
            }
        }
    }
}