postgresql-shortcut

try to take over the world!

目前为 2018-07-09 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name postgresql-shortcut
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.postgresql.org/docs/10/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. window.onload=function(){
  14. document.addEventListener('keyup',function(e) {
  15. //往后翻页
  16. if(e.keyCode===39) {
  17. var a = document.querySelectorAll('[accesskey="n"]')[0];
  18. window.location.href = a.getAttribute('href');
  19. }
  20. if(e.keyCode===37) {
  21. var b = document.querySelectorAll('[accesskey="p"]')[0];
  22. window.location.href = b.getAttribute('href');
  23. }
  24. })
  25. }
  26. // Your code here...
  27. })();