summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2010-10-03 14:25:25 -0400
committerKris Maglione <maglione.k@gmail.com>2010-10-03 14:25:25 -0400
commit504c5a7386f6e4fc3aa4500e2d20a381a29e7f9b (patch)
tree9ce6051c06c03e022e58a771cd487ea8cc51692b
parent5c81791183d06ee67921f01a4579caa21bdf3325 (diff)
downloadpentadactyl-504c5a7386f6e4fc3aa4500e2d20a381a29e7f9b.tar.gz
Support multiple frames in :bmark completion.
-rw-r--r--common/content/bookmarks.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js
index 2f4700dc..ac9841c3 100644
--- a/common/content/bookmarks.js
+++ b/common/content/bookmarks.js
@@ -298,8 +298,11 @@ const Bookmarks = Module("bookmarks", {
names: ["-title", "-t"],
description: "Bookmark page title or description",
completer: function title(context, args) {
+ let frames = buffer.allFrames();
if (!args.bang)
- return [[content.document.title, "Current Page Title"]];
+ return [
+ [win.document.title, frames.length == 1 ? "Current Location" : "Frame: " + win.location.href]
+ for ([, win] in Iterator(frames))];
context.keys.text = "title";
context.keys.description = "url";
return bookmarks.get(args.join(" "), args["-tags"], null, { keyword: args["-keyword"], title: context.filter });
@@ -339,7 +342,10 @@ const Bookmarks = Module("bookmarks", {
completer: function (context, args) {
if (!args.bang) {
context.title = ["Page URL"];
- context.completions = [[content.document.documentURI, "Current Location"]];
+ let frames = buffer.allFrames();
+ context.completions = [
+ [win.document.documentURI, frames.length == 1 ? "Current Location" : "Frame: " + win.document.title]
+ for ([, win] in Iterator(frames))];
return;
}
completion.bookmark(context, args["-tags"], { keyword: args["-keyword"], title: args["-title"] });