1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 20:14:11 +01:00

Display a sensible prompt rather than a dialog for ;s. Co-opt ;a for "Add bookmark".

This commit is contained in:
Kris Maglione
2011-01-16 15:58:25 -05:00
parent 79382a083f
commit f442a35f8d
7 changed files with 99 additions and 36 deletions

View File

@@ -104,7 +104,11 @@ var Bookmarks = Module("bookmarks", {
* @param {Element} elem A form element for which to add a keyword.
*/
addSearchKeyword: function (elem) {
let [url, post, charset] = util.parseForm(elem);
if (elem instanceof HTMLFormElement || elem.form)
var [url, post, charset] = util.parseForm(elem);
else
var [url, post, charset] = [elem.href || elem.src, null, elem.ownerDocument.characterSet];
let options = { "-title": "Search " + elem.ownerDocument.title };
if (post != null)
options["-post"] = post;