Intro skipper

try to take over the world!

目前为 2017-10-05 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Intro skipper
  3. // @version 0.1
  4. // @description try to take over the world!
  5. // @author lolamtisch@gmail.com
  6. // @license Creative Commons; http://creativecommons.org/licenses/by/4.0/
  7. // @supportURL https://discord.gg/cTH4yaw
  8. // @include *
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // @grant GM_notification
  12. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
  13. // @namespace https://greasyfork.org/users/92233
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. 'use strict';
  18. var five = GM_getValue(document.domain, 0);
  19. $( document).ready(function(){
  20. $(document).keydown(function(e) {
  21. if (e.ctrlKey && e.keyCode === 39) {
  22. $('video').get(0).currentTime = parseInt($('video').get(0).currentTime) + 80;
  23. }
  24. if (e.ctrlKey && e.keyCode === 37) {
  25. $('video').get(0).currentTime = parseInt($('video').get(0).currentTime) - 80;
  26. }
  27. if(five){
  28. if (e.keyCode === 39) {
  29. $('video').get(0).currentTime = parseInt($('video').get(0).currentTime) + 5;
  30. }
  31. if (e.keyCode === 37) {
  32. $('video').get(0).currentTime = parseInt($('video').get(0).currentTime) - 5;
  33. }
  34. }
  35. if (e.ctrlKey && e.keyCode === 53) {
  36. if(five){
  37. five = 0;
  38. }else{
  39. five = 1;
  40. }
  41.  
  42. var message = "5 second skip "+ ((five) ? "activated" : "deactivated") +" for "+document.domain;
  43. try{
  44. GM_notification(message);
  45. }catch(e){
  46. alert(message);
  47. }
  48. GM_setValue(document.domain, five);
  49. }
  50. });
  51. });
  52. })();