aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2011-11-23 19:53:56 -0700
committerGravatar Brendan Taylor <whateley@gmail.com>2011-11-23 19:53:56 -0700
commit620ead5cf60a446a2f7dc4e136d8cee895ea51df (patch)
tree3d8c7476fedeb570cfe1c38d8277f89d039ae3a2
parent9fb85cf04f0ec26de0245796c4a164973f760dde (diff)
don't use window.open in follow.js.
it's slow, forces you to turn on javascript_windows = 1, and on some systems results in multiple new windows/tabs.
-rw-r--r--examples/data/scripts/follow.js7
-rwxr-xr-xexamples/data/scripts/follow.sh3
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/data/scripts/follow.js b/examples/data/scripts/follow.js
index 45ecfc6..88f80f2 100644
--- a/examples/data/scripts/follow.js
+++ b/examples/data/scripts/follow.js
@@ -288,11 +288,10 @@ uzbl.follow.elementSelected = function(el) {
// we're opening a new window using the URL attached to this element
var uri = el.src || el.href;
if(uri.match(/javascript:/)) return;
- window.open(uri);
- return "XXXRESET_MODEXXX"
+ return "XXXNEW_WINDOWXXX " + uri;
} else {
- // we're just going to click the element
- return this.clickElem(el);
+ // we're just going to click the element
+ return this.clickElem(el);
}
}
diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh
index 01e92db..de126eb 100755
--- a/examples/data/scripts/follow.sh
+++ b/examples/data/scripts/follow.sh
@@ -13,6 +13,9 @@ case "$result" in
# a link was selected, reset uzbl's input mode
printf 'set mode=\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO"
;;
+ XXXNEW_WINDOWXXX*)
+ printf "set mode=\nevent KEYCMD_CLEAR\nevent NEW_WINDOW $@\n" > "$UZBL_FIFO"
+ ;;
XXXRETURNED_URIXXX*)
uriaction=$1
uri=${result#XXXRETURNED_URIXXX}