Permalink
Browse files

new: open page later

  • Loading branch information...
0mg
0mg committed Mar 4, 2012
1 parent 11a7ccf commit e881b13b4577f5ca61206125e6b8a9c126000c75
Showing with 24 additions and 0 deletions.
  1. +24 −0 later.js
View
@@ -0,0 +1,24 @@
+// ==UserScript==
+// @include *
+// ==/UserScript==
+
+addEventListener("keyup", (function() {
+ var nthPress = 0, timer = null;
+ return function(ev) {
+ if (ev.target instanceof HTMLInputElement ||
+ ev.target instanceof HTMLTextAreaElement) return;
+ if (ev.keyCode === 76) { // 108, 76: L
+ if (nthPress) {
+ var url = location.href.replace(/'/g, "%2527");
+ var title = String(document.title).replace(/'/g, "%2527");
+ open("javascript:alert('" + title + "%5Cn" + url +
+ "'),location='" + url + "'");
+ close();
+ } else {
+ ++nthPress;
+ clearTimeout(timer);
+ timer = setTimeout(function() { doublePress = 0; }, 180);
+ }
+ }
+ };
+})(), true);

0 comments on commit e881b13

Please sign in to comment.