Redirect to high res image

Automatically redirects the browser to the full resolution image for any landing page on imagetwist.com imgspice.com acidimg.cc imx.to pixhost.to imagebam.com imgbox.com kropic.com vipr.im

当前为 2020-11-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Redirect to high res image
  3. // @namespace RedirectToHiRes
  4. // @include *imagetwist.com/*
  5. // @include *imgspice.com/*
  6. // @include *turboimagehost.com/*.html
  7. // @include *acidimg.cc/*
  8. // @include *imx.to/*
  9. // @include *pixhost.to/*
  10. // @include *imagebam.com/*
  11. // @include *imgbox.com/*
  12. // @include *kropic.com/*
  13. // @include *vipr.im/*
  14. // @grant none
  15. // @version 1.0
  16. // @author codingjoe
  17. // @description Automatically redirects the browser to the full resolution image for any landing page on imagetwist.com imgspice.com acidimg.cc imx.to pixhost.to imagebam.com imgbox.com kropic.com vipr.im
  18. // @run-at document-idle
  19. // ==/UserScript==
  20.  
  21.  
  22. function goToImage() {
  23. location.href = document.querySelector(".centred").src;
  24. }
  25.  
  26. (function() {
  27. 'use strict';
  28. let img;
  29.  
  30. if (location.href.includes("imagetwist.com")) {
  31. let arr = Array.from(document.querySelectorAll("a")).filter(r => r.innerText === "Continue to your image");
  32. img = document.querySelector(".pic");
  33.  
  34. if (img) {
  35. location.href = img.src;
  36. } else {
  37. if (arr.length > 0) {
  38. arr[0].click();
  39. }
  40. }
  41. } else if (location.href.includes("imgspice.com")) {
  42. img = document.querySelector("#imgpreview");
  43. if (img) {
  44. location.href = img.src;
  45. }
  46. } else if (location.href.includes("turboimagehost.com")) {
  47. img = document.querySelector("#uImage");
  48. if (img) {
  49. location.href = img.src;
  50. }
  51. } else if (location.href.includes("acidimg.cc")) {
  52. let btn = document.querySelector("input[type=submit]");
  53.  
  54. if (btn) {
  55. btn.click();
  56.  
  57. window.setTimeout(function() {
  58. goToImage();
  59. }, 2000);
  60. } else {
  61. goToImage();
  62. }
  63. } else if (location.href.includes("imx.to")) {
  64. let blueButton = document.querySelector(".button") || document.querySelector("#continuebutton");
  65.  
  66. if (blueButton != null) {
  67. blueButton.click();
  68. window.setTimeout(function() {
  69. goToImage();
  70. }, 500);
  71. } else {
  72. goToImage();
  73. }
  74. } else if (location.href.includes("pixhost.to")) {
  75. img = document.querySelector("img#image");
  76. if (img) {
  77. // redirect to full res
  78. location.href = img.src;
  79. }
  80. } else if (location.href.includes("imagebam.com")) {
  81. let anchor = Array.from(document.querySelectorAll("a")).filter(r => r.innerText === "Continue to your image");
  82. img = document.querySelector("img.image");
  83. if (img) {
  84. // redirect to full res
  85. location.href = img.src;
  86. } else {
  87. if (anchor.length > 0) {
  88. // click "Continue to your image"
  89. anchor[0].click();
  90. }
  91. }
  92. } else if (location.href.includes("imgbox.com")) {
  93. img = document.querySelector("img.image-content");
  94. if (img) {
  95. // redirect to full res
  96. location.href = img.src;
  97. }
  98. } else if (location.href.includes("kropic.com")) {
  99. let btn = Array.from(document.querySelectorAll("input[type='submit']")).filter(r => r.value === "Continue to image...");
  100. let img = document.querySelector("img.pic");
  101. if (img) {
  102. // redirect to full res
  103. location.href = img.src;
  104. } else {
  105. if (btn.length > 0) {
  106. // click "Continue to image..."
  107. btn[0].click();
  108. }
  109. }
  110. } else if (location.href.includes("vipr.im")) {
  111. img = document.querySelector(".img-responsive");
  112. if (img) {
  113. location.href = img.src;
  114. }
  115. }
  116. })();