aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/follow.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/data/scripts/follow.js')
-rw-r--r--examples/data/scripts/follow.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/data/scripts/follow.js b/examples/data/scripts/follow.js
index 782b1d1..5ecdcef 100644
--- a/examples/data/scripts/follow.js
+++ b/examples/data/scripts/follow.js
@@ -16,10 +16,10 @@ uzbldivid = 'uzbl_link_hints';
uzbl.follow = function() {
// Export
charset = arguments[0];
- if (arguments[2] == 'click') {
+ if (arguments[2] == 0 || arguments[2] == 'click') {
newwindow = false;
returnuri = false;
- } else if (arguments[2] == 'newwindow') {
+ } else if (arguments[2] == 1 || arguments[2] == 'newwindow') {
newwindow = true;
returnuri = false;
} else if (arguments[2] == 'returnuri') {
@@ -135,19 +135,19 @@ uzbl.follow.generateHint = function(doc, el, label, top, left) {
// but at least set the href of the link. (needs some improvements)
uzbl.follow.clickElem = function(item) {
if(!item) return;
- var name = item.tagName;
- if (name == 'INPUT') {
- var type = item.getAttribute('type').toUpperCase();
- if (type == 'TEXT' || type == 'FILE' || type == 'PASSWORD') {
+ if (item instanceof HTMLInputElement) {
+ var type = item.type;
+ if (type == 'text' || type == 'file' || type == 'password') {
item.focus();
item.select();
return "XXXEMIT_FORM_ACTIVEXXX";
}
// otherwise fall through to a simulated mouseclick.
- } else if (name == 'TEXTAREA' || name == 'SELECT') {
+ } else if (item instanceof HTMLTextAreaElement || item instanceof HTMLSelectElement) {
item.focus();
- item.select();
+ if(typeof item.select != 'undefined')
+ item.select();
return "XXXEMIT_FORM_ACTIVEXXX";
}