Handy Image

Shows just fullsize Image with hotkeys & without pop-ups on many image-hosting sites

As of 2024-03-17. See the latest version.

  1. // ==UserScript==
  2. // @name Handy Image
  3. // @version 2024.03.18
  4. // @author Owyn
  5. // @contributor ubless607, bitst0rm
  6. // @namespace handyimage
  7. // @description Shows just fullsize Image with hotkeys & without pop-ups on many image-hosting sites
  8. // @homepage https://github.com/Owyn/HandyImage
  9. // @supportURL https://github.com/Owyn/HandyImage/issues
  10. // @icon https://u.cubeupload.com/Owyn/W9zirOUGo1.png
  11. // @run-at document-start
  12. // @grant GM.getValue
  13. // @grant GM.setValue
  14. // @grant GM_registerMenuCommand
  15. // @grant GM_unregisterMenuCommand
  16. // @grant GM_getValue
  17. // @grant GM_setValue
  18. // @grant GM_download
  19. // @grant GM_addElement
  20. // @grant unsafeWindow
  21. // @sandbox JavaScript
  22. // @compatible Chrome
  23. // @compatible Firefox
  24. // @match https://www.imagebam.com/image/*
  25. // @match https://www.imagebam.com/view/*
  26. // @match http://imgchili.net/show*
  27. // @match *://imgbox.com/*
  28. // @match *://*.imagetwist.com/*
  29. // @match *://imagexport.com/*
  30. // @match https://*.imagevenue.com/*
  31. // @match *://*.imageshack.com/i/*
  32. // @match *://*.imageshack.com/f/*
  33. // @match *://*.image2you.ru/*/*/
  34. // @exclude *://image2you.ru/cabinet/*
  35. // @exclude *://www.image2you.ru/cabinet/*
  36. // @match https://imageban.ru/show*
  37. // @match *://fastpic.ru/view*
  38. // @match *://fastpic.ru/fullview*
  39. // @match https://fastpic.org/view/*
  40. // @match https://fastpic.org/fullview/*
  41. // @match *://pixhost.to/show/*
  42. // @match http://*.picpicture.com/image/*
  43. // @match http://*.pic5you.ru/*/*/
  44. // @match http://*.tinypic.com/view*
  45. // @match http://radical-foto.ru/*
  46. // @match http://radikal-foto.ru/*
  47. // @match https://radikal.ru/*
  48. // @exclude https://radikal.ru/video/*
  49. // @match http://f-page.ru/*
  50. // @match http://f-picture.net/*
  51. // @match https://*.pimpandhost.com/image*
  52. // @match https://*.pixroute.com/*/*
  53. // @match https://*.picforall.ru/*/*/
  54. // @match *://*.imagecurl.com/view*
  55. // @match *://*.imagecurl.org/view*
  56. // @match http://*.euro-pic.eu/*share*
  57. // @match http://*.xxxhost.me/view*
  58. // @match http://*.imadul.com/?*
  59. // @match *://postimg.org/image/*
  60. // @match *://postimg.cc/*
  61. // @match http://*.niceimage.pl/*.html
  62. // @match http://*.pics-money.ru/*
  63. // @match http://*.freeimgup.com/*.*
  64. // @match http://imgtiger.com/view*
  65. // @match https://*.imgspice.com/*/*
  66. // @match http://*.picage.ru/*/*
  67. // @match http://*.imgserve.net/img*
  68. // @match http://*.images-host.biz/*/*
  69. // @match http://*.imgfantasy.com/*
  70. // @match http://*.platimzafoto.ru/full/
  71. // @match http://*.platimzafoto.ru/*.html
  72. // @match http://imgdino.com/view*
  73. // @match http://*.pic-money.ru/*.html
  74. // @match http://*.pic-money.ru/full/
  75. // @match http://*.imgcandy.net/img*
  76. // @match http://*.imagefolks.com/img*
  77. // @match *://*.pzy.be/v*
  78. // @match https://www.turboimagehost.com/p*
  79. // @match http://*.subirimagenes.com/*.html
  80. // @match http://*.screenlist.ru/details.php?image_id=*
  81. // @match http://qrrro.com/images*
  82. // @match http://imgmade.com/images*
  83. // @match http://www.pic-upload.de/view*
  84. // @match http://picshare.geenza.com/pics*
  85. // @match https://www.imgbabes.com/*/*.htm*
  86. // @match http://ibunker.us/f*
  87. // @match http://ichan.org/image.php?path=*
  88. // @match http://*.imagearn.com/*
  89. // @match http://www.dumppix.com/view*
  90. // @match http://www.bilder-upload.eu/show*
  91. // @match http://www.bilder-hochladen.net/file*
  92. // @match http://www.bild.me/bild.php?*
  93. // @match *://www.imagesnake.com/show*
  94. // @match *://www.imagesnake.com/img*
  95. // @match *://www.imagesnake.com/view*
  96. // @match http://www.imagesnake.org/show*
  97. // @match http://www.imagesnake.org/img*
  98. // @match http://www.imagesnake.org/view*
  99. // @match https://www.freebunker.com/show*
  100. // @match https://www.freebunker.com/img*
  101. // @match https://www.freebunker.com/view*
  102. // @match http://bayimg.com/*
  103. // @match http://*.directupload.net/file*
  104. // @match http://*.imagecherry.com/*
  105. // @match https://funkyimg.com/view*
  106. // @match http://*.abload.de/image.php?*
  107. // @match http://*.picfox.org/share*
  108. // @match http://*.pixup.us/img-*
  109. // @match http://*.imagecarry.com/*/*
  110. // @match http://*.imagedunk.com/*/*
  111. // @match http://*.imageswitch.com/*/*
  112. // @match http://*.piclambo.net/*/*
  113. // @match http://*.picleet.com/*/*
  114. // @match http://*.yankoimages.net/*/*
  115. // @match http://*.picturedip.com/*/*
  116. // @match https://*.imagedecode.com/img-*
  117. // @match https://*.imagefruit.com/img*
  118. // @match https://*.imagefruit.com/show*
  119. // @match https://*.miragepics.com/view*
  120. // @match http://*.freeimagehosting.net/*
  121. // @match http://*.keptarolo.hu/*
  122. // @match http://www.uploadhouse.com/view*
  123. // @match http://*.dumpt.com/img/view*
  124. // @match http://imagezilla.net/show/*
  125. // @match https://*.imageup.ru/img*
  126. // @match http://*.casimages.com/photos/*/*/*
  127. // @match http://*.casimages.com/img*
  128. // @match http://*.cyberpics.net/p*
  129. // @match *://vvcap.com/*
  130. // @match https://*.freeimage.us/share*
  131. // @match http://*.pix-x.net/*/*
  132. // @match http://*.shareimages.com/image*
  133. // @match http://www.xtremeshack.com/image/*
  134. // @match http://*.mrjh.org/gallery.php?entry=*
  135. // @match http://*.itmages.ru/image/view*
  136. // @match http://shrani.najdi.si/*
  137. // @match http://*.iv.pl/view*
  138. // @match http://*.image18.org/show/*
  139. // @match http://*.pic4you.ru/*
  140. // @match http://picload.org/view*
  141. // @match http://*.thebestpichost.com/picture/*
  142. // @match *://*.lostpic.net/image/*
  143. // @match http://subefotos.com/ver/*
  144. // @exclude http://subefotos.com/ver/*#codigos
  145. // @match http://*.pixsor.com/share*
  146. // @match http://*.pixsor.com/XXX/share*
  147. // @match http://*.image-share.com/i*html
  148. // @match http://*.npicture.net/share-*
  149. // @match http://*.overpic.net/view*
  150. // @match http://*.imagecross.com/*
  151. // @match http://*.mojoimage.com/*
  152. // @match http://www.use.com/*
  153. // @match http://www.hostingpics.net/view*
  154. // @match http://*.pictureshoster.com/view*
  155. // @match http://*.imageshost.ru/photo*
  156. // @match http://*.imagestime.com/show*
  157. // @match http://sharenxs.com/view*
  158. // @match http://sharenxs.com/gallery/*/*
  159. // @match http://img4.imagetitan.com/img*
  160. // @match *://*.imagenpic.com/*
  161. // @match http://*.stuffed.ru/images*
  162. // @match http://*.wstaw.org/w/*
  163. // @match http://www.imagesocket.com/photos*
  164. // @match http://www.imagesocket.com/social*
  165. // @match http://imageban.net/show*
  166. // @match http://*.otofotki.pl/*
  167. // @match http://*.imgsin.com/view*
  168. // @match http://*.imagenetz.de/*
  169. // @match http://pix.toile-libre.org/?img*
  170. // @match *://servimg.com/view/*
  171. // @match http://*.upix.me/files/*
  172. // @match http://*.upix.me/i/v/?q=*
  173. // @match http://*.pixelup.net/image*
  174. // @match http://*.pixelup.net/image*
  175. // @match http://*.picsee.net/*
  176. // @match http://www.fotosik.pl/pokaz_obrazek/pelny*
  177. // @match https://*.depic.me/*
  178. // @match http://www.xup.in/dl*
  179. // @match http://*.hotchyx.com/d*
  180. // @match http://*.imageupper.com/i/*
  181. // @match *://beeimg.com/view*
  182. // @match http://www.noelshack.com/*.*
  183. // @match http://www.turbopix.fr/v/*
  184. // @match http://thumbsnap.com/*
  185. // @match http://deffe.com/image/*
  186. // @match http://*.imageno.com/*.html
  187. // @match http://*.imagehousing.com/image*
  188. // @match http://www.picfront.org/d/*
  189. // @match http://*.imagehost.thasnasty.com/?*
  190. // @match http://*.imagilive.com/*.htm*
  191. // @match http://*.picturevip.com/*
  192. // @exclude http://*.picturevip.com/x/clean/
  193. // @match http://img.3ezy.net/*.htm
  194. // @match http://*.xximg.net/img-*
  195. // @match http://*.zaslike.com/view*
  196. // @match http://www.zimagez.com/zimage*
  197. // @match http://*.pictureturn.com/*.html
  198. // @match http://*.cubeupload.com/im/*
  199. // @match http://www.photo-host.org/view-image/*
  200. // @match http://www.fotoszok.pl/show*
  201. // @match http://*.imglink.ru/show*
  202. // @match http://zapodaj.net/*.html
  203. // @match http://www.pixic.ru/view*
  204. // @match http://www.imagesup.de/picture.php?code=*
  205. // @match https://www.pornbus.org/show*
  206. // @match http://www.bilder-space.de/bild-*
  207. // @match *://www.imgcarry.com/show*
  208. // @match http://*.saveimg.ru/show*
  209. // @match http://www.fotos-hochladen.net/view*
  210. // @match http://simplest-image-hosting.net/*
  211. // @match http://jpegbay.com/gallery/*.html
  212. // @match https://www.hostpic.org/view*
  213. // @match *://imagik.fr/image/*
  214. // @match http://www.image-load.net/show*
  215. // @match http://*.sxpics.nl/img-*
  216. // @match http://*.gallerycloud.net/image/*
  217. // @match http://tryimg.com/image/*
  218. // @match http://bilder.nixhelp.de/display-*
  219. // @match http://*.funextra.hostzi.com/view*
  220. // @match http://*.freakimage.com/view*
  221. // @match http://*.fotoo.pl/show.php?img=*.html
  222. // @match http://*.rapid-img.de/img.php?f=*
  223. // @match http://*.upload.djmaster.fr/?v=*
  224. // @match http://img.pereslavl.ru/share*
  225. // @match http://*.dwimg.com/view*
  226. // @match http://www.imageurlhost.com/view*
  227. // @match http://*.imagesup.net/*
  228. // @match http://*.superkipje.com/view*
  229. // @match https://*.2i.sk/i/*
  230. // @match https://imgadult.com/img-*
  231. // @match http://imagebic.com/?v=*
  232. // @match http://www.picshot.pl/public/view*
  233. // @match http://*.imagesmax.de/display-*
  234. // @match http://*.ifotos.pl/zobacz/*
  235. // @match http://www.zimage.fr/photo.php?id=*
  236. // @match http://www.zimage.fr/taillereel.php?id=*
  237. // @match http://ngarko.online.fr/view*
  238. // @match http://*.b4he.com/?v=*
  239. // @match http://*.oxily.com/?*
  240. // @match http://ghanaimages.co/?*
  241. // @match http://*.imgplus.info/view*
  242. // @match http://firepic.org/?v=*
  243. // @match http://savepic.org/*.htm
  244. // @match http://*.fastimages.ru/p*
  245. // @match http://ipic.su/?page=img&pic=*
  246. // @match http://*.jpegshare.net/*.html
  247. // @match http://*.overdream.cz/*
  248. // @match http://*.fastpics.net/?v=*
  249. // @match http://www.ii4.ru/image-*
  250. // @match http://*.picuploader.de/*
  251. // @match http://*.rupict.ru/share*
  252. // @match http://bildr.no/view*
  253. // @match http://www.subeimagenes.com/img*
  254. // @match http://screenshot.ru/*
  255. // @match http://*.hostpix.de/show.php?img*
  256. // @match http://*.freeuploadimages.org/view*
  257. // @match http://smages.com/?v=*
  258. // @match https://*.hostingkartinok.com/show-image.php?id=*
  259. // @match http://*.4put.ru/*max*
  260. // @match http://www.pictureshack.ru/view*
  261. // @match http://*.host99.byethost4.com/share.php?id=*
  262. // @match http://*.eazypics.net/share*
  263. // @match http://xtupload.com/share.php?id=*
  264. // @match http://t.williamgates.net/share*
  265. // @match *://photosex.biz/v.php?id=*
  266. // @match http://*.imageteam.org/img-*
  267. // @match http://*.hostimage.ru/photo*
  268. // @match http://www.loaditup.de/*.html
  269. // @match http://*.imgbox.de/show/img*
  270. // @match http://*.picszone.net/view*
  271. // @match http://*.images.share-films.net/view*
  272. // @match http://www.uploadking.biz/show*
  273. // @match http://foto.xhost.lv/show.php?img=*
  274. // @match http://*.imagefile.org/view*
  275. // @match http://*.onimage.net/show*
  276. // @match http://*.uploadagent.de/show*
  277. // @match http://*.bildjunkies.de/view*
  278. // @match http://*.foto.hcfor.pl/view*
  279. // @match http://*.pic.tooptarinha.com/view*
  280. // @match http://*.poopr.org/view*
  281. // @match http://*.xp-images.hi2.ro/view*
  282. // @match http://*.dayzeddesigns.com/view*
  283. // @match http://*.freeimghosting.co.uk/view*
  284. // @match http://*.123poze.3x.ro/view*
  285. // @match http://*.upload.removed.us/view*
  286. // @match http://*.ximg.co.uk/view*
  287. // @match http://sl-images.ath.cx/view*
  288. // @match http://*.picatom.com/*
  289. // @match https://*.picshare.ru/image/*
  290. // @match http://*.imghost.pl/index.php?id=*
  291. // @match http://*.udostepniaj.pl/view*
  292. // @match http://*.hosting-zdjec.pl/view*
  293. // @match http://*.zapisz.net/view*
  294. // @match http://www.imagehosting.cz/?v=*
  295. // @match http://www.dumparump.com/view*
  296. // @match http://*.myxpic.com/showpic*
  297. // @match http://*.picness.com/image/*
  298. // @match http://h4z.it/View*
  299. // @match http://*.freeamateurteens.net/view*
  300. // @match http://*.fotoshack.us/foto*
  301. // @match https://*.imagebin.ca/v/*
  302. // @match http://*.loadpix.de/*.html
  303. // @match http://www.public-pic.de/image/show/*
  304. // @match http://*.9foto.ru/photo/*
  305. // @match http://uploads.ru/*
  306. // @match http://*.storepic.com/show*
  307. // @match http://www.myimg.de/?img=*
  308. // @match http://*.root-space.eu/file*
  309. // @match http://*.hot-file.org/p*
  310. // @match http://*.hostarea.de/show*
  311. // @match http://mepic.ru/view/?id=*
  312. // @match http://*.upislam.com/view*
  313. // @match http://*.ngarko.free.fr/view*
  314. // @match http://*.add-screen.com/view*
  315. // @match http://image.siroro.co.uk/p*
  316. // @match http://thaisharing.online.fr/view*
  317. // @match http://*.images.collectiontricks.it/view*
  318. // @match http://*.my-collection.ru/view*
  319. // @match http://img.schattorie.nl/view*
  320. // @match http://*.forexrainbow.com/view*
  321. // @match http://*.imgupload.pl/view*
  322. // @match http://*.1y9y.com/view*
  323. // @match http://*.addpix.net/view*
  324. // @match http://www.myuploadedimages.com/view*
  325. // @match http://multihoster.saxonia-fighter.de/view*
  326. // @match http://knecht.novarata.net/?*
  327. // @match http://*.img.irandeliver.com/?*
  328. // @match http://*.xferz.com/?*
  329. // @match http://*.up.kfesfahan.com/?*
  330. // @match http://upload.khontai.com/?*
  331. // @match http://*.image.pantyhosemania.info/?*
  332. // @match http://*.addyourpics.com/image*
  333. // @match http://*.imgnext.com/img-*
  334. // @match http://*.qattach.com/p*
  335. // @match http://*.host4images.com/view*
  336. // @match http://*.imgbank.cz/*
  337. // @match http://*.nyanimg.com/*
  338. // @match http://*.geekpics.in/*
  339. // @match http://*.imagesloading.altervista.org/?*
  340. // @match http://*.showmyimage.com/*
  341. // @match http://*.phpbbmods.it/immaggini*
  342. // @match http://upload.supreme-elite.fr/?*
  343. // @match http://*.fotohelp.kz/image*
  344. // @match https://*.myimg.me/*
  345. // @match http://*.heberg-hush.org/?*
  346. // @match http://*.oltaciyukle.com/*
  347. // @match http://*.pichost.name/*
  348. // @match *://*.fsfiles.org/flightsimshotsv2/image/*
  349. // @match http://*.imagend.com/*
  350. // @match http://*.imagerocket.com/*
  351. // @match http://*.hyyathost.com/*
  352. // @match http://images.reptilescanada.com/*
  353. // @match http://*.lakhdaria.net/imagebank/?*
  354. // @match http://*.webjardiner.com/hebergement_images_photos/image*
  355. // @match http://*.intergranada.com/images/?*
  356. // @match http://*.partizansk.eu/foto/image*
  357. // @match http://*.xenopix.com/?*
  358. // @match http://*.wepic.ru/*
  359. // @match http://*.imgup.com/images*
  360. // @match http://*.picturepush.com/public*
  361. // @match http://*.upload-image.fr/*
  362. // @match http://*.iezz.com/?*
  363. // @match https://*.images.baconbits.org/?*
  364. // @match http://*.upanh.ovo.vn/*
  365. // @match http://*.wrzucaj.net/*
  366. // @match http://*.heberge-images.com/?*
  367. // @match http://www.image.kg/*
  368. // @match http://*.savemyimage.com/*
  369. // @match http://*.img.dramacafe.tv/*
  370. // @match http://*.hosturimage.com/img-*
  371. // @match http://*.pic-mir.ru/*/*
  372. // @match http://*.244pix.com/view*
  373. // @match http://*.uploadimage.ro/view*
  374. // @match https://*.imgflare.com/*/*
  375. // @match https://www.imagefap.com/photo/*
  376. // @match https://www.imagefap.com/video.php?vid=*
  377. // @match http://filefap.com/view*
  378. // @match https://imgur.com/*
  379. // @match https://m.imgur.com/*
  380. // @match https://motherless.com/*
  381. // @match https://*.tumblr.com/image/*
  382. // @match https://*.media.tumblr.com/*.*
  383. // @match http://*.imageporter.com/*
  384. // @match http://*.damimage.com/img-*
  385. // @match https://fapping.empornium.sx/image/*
  386. // @match http://imgboxxx.com/view*
  387. // @match http://*.imghere.net/view*
  388. // @match http://*.sharepic.biz/show-image.php?id=*
  389. // @match http://f-lite.ru/*
  390. // @match http://*.picturescream.com/*
  391. // @match http://*.imgdone.com/view*
  392. // @match https://*.2i.cz/i/*
  393. // @match http://awesomescreenshot.com/*
  394. // @match https://www.flickr.com/photos/*/*/
  395. // @exclude https://www.flickr.com/photos/*/galleries/*
  396. // @exclude https://www.flickr.com/photos/sets/*
  397. // @exclude https://www.flickr.com/photos/tags/*
  398. // @exclude https://www.flickr.com/photos/page*
  399. // @exclude https://www.flickr.com/photos/with*
  400. // @exclude https://www.flickr.com/photos/favorites*
  401. // @match http://www.amateri.cz/g*/*
  402. // @match *://*.wikipedia.org/wiki/*:*.jp*
  403. // @match *://*.wikipedia.org/wiki/*:*.png
  404. // @match *://*.wikimedia.org/wiki/*:*.jp*
  405. // @match *://*.wikimedia.org/wiki/*:*.pn*
  406. // @match *://*.xxxscreens.com/img-*
  407. // @match http://avenuexxx.com/*-*
  408. // @match http://avenuexxx.com/archives/*/*
  409. // @exclude http://avenuexxx.com/archives/category/*
  410. // @match http://www.bilderhoster.net/*.html
  411. // @match http://*.xxxscreens.com/img-*
  412. // @match http://*.imgdope.com/view*
  413. // @match http://*.imagehost.eu/*
  414. // @match http://*.aveimage.com/view*
  415. // @match *://*.fappic.com/*
  416. // @match http://*.imagenimage.com/*/*
  417. // @match http://*.adultur.com/img-*
  418. // @match https://*.imageshimage.com/*/*
  419. // @match http://*.imgswift.com/*/*
  420. // @match http://*.imageporn.eu/?v=*
  421. // @match https://*.500px.com/photo/*
  422. // @match http://*.greenpiccs.com/images/*.html
  423. // @match http://*.hostmat.eu/view*
  424. // @match http://*.photobucket.com/user/*/media/*.htm*
  425. // @match https://www.imgshots.com/img*
  426. // @match https://www.imgshots.com/show/*
  427. // @match https://*.3xplanet.com/view*
  428. // @match https://*.3xplanet.net/view*
  429. // @match http://*.imgmega.com/*.html
  430. // @match *://img.yt/img-*
  431. // @match http://*.payforpic.ru/*/*/
  432. // @match http://*.keep4u.ru/full/*
  433. // @match http://*.pic.re/*.html
  434. // @match http://*.freshpics.ru/*/*/
  435. // @match *://*.imgseeds.com/img-*
  436. // @match https://*.pronpic.org/*/*
  437. // @match https://prnt.sc/*
  438. // @match http://*.imgdream.net/view*
  439. // @match http://*.imgtab.net/*
  440. // @match http://*.kephost.com/image/*
  441. // @match http://i.ruspotting.net/image/*
  442. // @match https://*.gifyu.com/image/*
  443. // @match http://celebimg.com/image/*
  444. // @match http://*.sharepic.org/image/*
  445. // @match http://*.zuly.de/image/*
  446. // @match http://upload.vstanced.com/image/*
  447. // @match http://*.thro.bz/image/*
  448. // @match http://*.qoou.net/image/*
  449. // @match http://brightpic.tk/image/*
  450. // @match http://*.cweb-pix.com/image/*
  451. // @match http://hosting.webspell.fr/image/*
  452. // @match http://*.i-pict.ru/image/*
  453. // @match http://*.images.woh.to/image/*
  454. // @match http://*.imghaze.com/image/*
  455. // @match http://*.imgup.nl/image/*
  456. // @match http://*.nium.co/image/*
  457. // @match http://pix.hostux.net/image/*
  458. // @match http://*.pixoload.de/image/*
  459. // @match http://*.primeimg.co/image/*
  460. // @match http://pic.xtream-reallife.de/image/*
  461. // @match http://*.ultraimg.com/image/*
  462. // @match http://demo.chevereto.com/image/*
  463. // @match *://imgclick.net/*/*
  464. // @match http://*.gogoimage.org/img-*
  465. // @match http://imgmoney.ru/*.html
  466. // @match http://imgmoney.ru/full/
  467. // @match http://*.imglooks.com/img-*
  468. // @match http://*.you-logo.ru/show*
  469. // @match http://*.uploadimagex.com/view*
  470. // @match http://*.powerlogo.ru/show*
  471. // @match http://youpicture.org/?v=*
  472. // @match http://*.all-poster.ru/?v=*
  473. // @match http://*.picbug.ru/share*
  474. // @match http://*.sxpix.nl/img-*
  475. // @match http://*.hotflick.net/u/v/?q=*
  476. // @match http://*.hotflick.net/f/v/?q=*
  477. // @match http://vavvi.com/images/*.html
  478. // @match https://www.deviantart.com/*/art/*
  479. // @match http://*.myceleb.net/u/v/?q=*
  480. // @match http://*.imageblinks.com/img-*
  481. // @match *://*.gelbooru.com/index.php?page=post&s=view&id=*
  482. // @match *://*.youhate.us/index.php?page=post&s=view&id=*
  483. // @match https://safebooru.org/index.php?page=post&s=view&id=*
  484. // @match https://danbooru.donmai.us/posts/*
  485. // @match http://konachan.com/post/show/*
  486. // @match http://konachan.net/post/show/*
  487. // @match https://yande.re/post/show/*
  488. // @match https://chan.sankakucomplex.com/*posts/*
  489. // @match https://idol.sankakucomplex.com/*post/show/*
  490. // @match https://yande.re/post/show/*
  491. // @match http://www.zerochan.net/*
  492. // @match http://imgzap.com/view*
  493. // @match http://*.olivepix.com/view/*
  494. // @match http://*.ocaload.com/img-*
  495. // @match http://*.imghit.com/img-*
  496. // @match http://*.imageon.org/img-*
  497. // @match http://*.imgcentral.com/view*
  498. // @match http://*.chronos.to/*
  499. // @match http://picspornfree.me/img-*
  500. // @match http://*.pic-you.com/p*
  501. // @match http://*.image-bugs.com/*mage/*
  502. // @match https://*.imgdrive.net/img-*
  503. // @match https://www.pixiv.net/*/artworks/*
  504. // @match http://*.scrin.org/?v=*
  505. // @match http://*.thumbnailus.com/img-*
  506. // @match http://*.nimplus.com/img-*
  507. // @match https://*.imgtaxi.com/img-*
  508. // @match http://*.imgstudio.org/img-*
  509. // @match http://goimge.com/img-*
  510. // @match http://*.safeimage.biz/image/*
  511. // @match http://*.imgbase.online/*/*/
  512. // @match http://*.picpays.ru/*/*/
  513. // @match http://*.imgclover.com/image/*
  514. // @match http://*.imgz.pw/share-*
  515. // @match http://*.imgz.pw/ch/image/*
  516. // @match *://*.imgking.co/img*
  517. // @match http://ask.fm/*/photo/original
  518. // @match http://*.newimagepost.com/img-*
  519. // @match http://*.imageho.me/img-*
  520. // @match http://myimg.club/*
  521. // @match https://www.hotimage.uk/*mg-*
  522. // @match http://*.10.imageleon.com/i-*
  523. // @match https://www.dropbox.com/s/*/*
  524. // @match http://imgor.net/img-*
  525. // @match http://*.imagedax.net/*/*.html
  526. // @match https://*.imgmonkey.com/*/*.html
  527. // @match http://*.fapat.me/img-*
  528. // @match http://photo.weibo.com/*/large/photo_id/*
  529. // @match https://*.crazyimg.com/images/*.html
  530. // @match http://imgbe.com/img-*
  531. // @match https://*.imgextra.uk/image/*
  532. // @match http://*.extraimago.com/image/*
  533. // @match http://*.fireimg.cc/img-*
  534. // @match http://www.pornimagex.com/image/*
  535. // @match http://*.imgboom.net/*
  536. // @match http://*.img24.org/*.html
  537. // @match http://*.img24.org/full/
  538. // @match http://*.pic-maniac.com/*
  539. // @match https://*.instagram.com/p/*
  540. // @exclude https://instagram.com/p/*/embed/*
  541. // @exclude https://*.instagram.com/p/*/embed/*
  542. // @match http://*.imgsay.com/?v=*
  543. // @match http://*.imgsmile.com/?v=*
  544. // @match http://*.balkanelite.org/MultiHoster/view*
  545. // @match https://twitter.com/*/photo/*
  546. // @match https://mobile.twitter.com/*/photo/*
  547. // @match http://*.icezap.com/img-*
  548. // @match *://*.rapidimg.net/img-*
  549. // @match http://*.imgtornado.com/img-*
  550. // @match http://*.daily-img.com/image/*
  551. // @match http://*.imageab.com/image/*
  552. // @match http://*.erimge.com/img-*
  553. // @match http://*.imgtrial.com/img-*
  554. // @match https://imgtown.net/*.php
  555. // @match http://ameblo.jp/*/image-*
  556. // @match http://*.loftlm.ru/img-*
  557. // @match http://*.imgdragon.com/*/*.html
  558. // @match http://ftop.ru/*/*
  559. // @match http://*.imgurx.net/share*
  560. // @match http://savepic.ru/*.htm
  561. // @match http://*.imgmaid.net/*
  562. // @match http://*.imggold.org/*/*.html
  563. // @match http://*.imgcredit.xyz/img-*
  564. // @match http://*.imgcredit.xyz/p/img-*
  565. // @match http://*.imgcredit.xyz/image/*
  566. // @match http://*.dimtus.com/img-*
  567. // @match http://*.coreimg.net/*
  568. // @match http://sfwimg.com/image/*
  569. // @match http://*.img3x.com/image/*
  570. // @match http://*.imguniversal.com/*
  571. // @match http://*.imagepearl.com/view/*
  572. // @match http://*.imagepearl.com/verify/*
  573. // @match http://*.tinizo.com/img-*
  574. // @match *://*.imgkings.com/img*
  575. // @match http://*.imagerar.com/img*
  576. // @match http://*.sendpic.org/view/*
  577. // @match *://www.porncomix.info/*/*/
  578. // @exclude *://www.porncomix.info/gallery/*
  579. // @exclude *://www.porncomix.info/artist/*
  580. // @match *://*.picclock.ru/*/*/
  581. // @match http://*.svetmonet.ru/*.html
  582. // @match http://*.svetmonet.ru/full/
  583. // @match http://*.imgpix.net/*
  584. // @match http://*.freeimagehostin.com/img-*
  585. // @match http://www.mixbase.net/gallery/image.*
  586. // @match https://www.adultimages.xyz/*/image*.html
  587. // @match http://*.pic4share.ru/*.html
  588. // @match http://*.pic4share.ru/full/
  589. // @match http://*.sximg.nl/img-*
  590. // @match http://*.0img.net/?v=*
  591. // @match https://ss.movierls.net/image/*
  592. // @match http://www.xxximagetpb.org/image/*
  593. // @match http://www.pixsense.net/site/v/*
  594. // @match http://www.imgsky.net/*
  595. // @match http://www.imagespicy.site/site/v/*
  596. // @match https://outletpic.com/*.php
  597. // @match http://*.pix.ac/image/*
  598. // @match *://*.imgmak.com/image/*
  599. // @match http://*.freephotohostin.com/img-*
  600. // @match http://*.imgcat.pw/img-*
  601. // @match http://*.levinpic.org/*.html
  602. // @match https://www.sparrowpics.com/image/*
  603. // @match http://*.imgmax.com/image/*
  604. // @match http://lostpix.com/?v=*
  605. // @match https://extraimago.com/image/*
  606. // @match http://www.joblo.com/hollywood-celebrities/hottie-profile/*/image-gallery/*.jpg
  607. // @match *://extraimage.net/image/
  608. // @match *://www.bellazon.com/main/attachment/*
  609. // @match *://extraimage.net/image/*
  610. // @match https://www.artstation.com/artwork/*
  611. // @match http://bcy.net/illust/detail/*
  612. // @match http://*.imgpics.nl/img-*
  613. // @match http://*.imagexxx18.com/image/*
  614. // @match http://*.imagepics.xyz/img-*
  615. // @match *://postto.me/*
  616. // @match http://*.imgskull.xyz/image/*
  617. // @match http://*.imgskull.com/image/*
  618. // @match *://*.ninjaimages.com/*.html
  619. // @match *://*.imgprime.com/img*
  620. // @match *://*.piccash.net/*/*/
  621. // @exclude *://piccash.net/cabinets/*
  622. // @exclude *://www.piccash.net/cabinets/*
  623. // @match http://imgwo.com/img-*
  624. // @match http://luxpic.ru/images/*.html
  625. // @match http://*.pic-images.ru/full/
  626. // @match http://*.pic-images.ru/*.html
  627. // @match http://*.imgspic.ru/full/
  628. // @match http://*.imgspic.ru/*.html
  629. // @match http://imgleveret.com/img-*
  630. // @match http://porn84.org/img-*
  631. // @match https://*.ima.gy/i/*
  632. // @match http://picpower.ru/full/
  633. // @match http://picpower.ru/*.html
  634. // @match http://piccloud.ru/full/
  635. // @match http://piccloud.ru/*.html
  636. // @match https://imgbase.ru/*/*/
  637. // @match http://*.sexybabepics.net/img-*.html
  638. // @match http://*.sexybabepics.net/x/image/*
  639. // @match http://*.imagecrest.com/verify/*
  640. // @match http://*.imagecrest.com/view/*
  641. // @match https://*.picz.site/img-*.html
  642. // @match http://*.allxpix.com/img-*.html
  643. // @match http://pixxsees.ru/full/
  644. // @match http://pixxsees.ru/*.html
  645. // @match http://imgblank.com/img-*.html
  646. // @match http://imgtrex.com/*/*
  647. // @match https://imgwallet.com/img-*.html
  648. // @match http://2picsun.ru/full/
  649. // @match http://2picsun.ru/*.html
  650. // @match http://picpie.org/image/*
  651. // @match *://*.xeimg.yt/img-*.html
  652. // @match *://*.imagedisco.net/?v=*
  653. // @match http://*.imgmain.com/img-*.html
  654. // @match http://*.imgvisits.com/*
  655. // @match *://pixxxels.org/image/*
  656. // @match http://img-pika.ru/full/
  657. // @match http://img-pika.ru/*.html
  658. // @match http://imgcach.ru/*/*/
  659. // @match https://*.xhamster19.com/photos/gallery/*/*
  660. // @match https://*.xhamster11.com/photos/gallery/*/*
  661. // @match https://*.xhamster4.com/photos/gallery/*/*
  662. // @match https://*.xhamster3.com/photos/gallery/*/*
  663. // @match https://*.xhamster.com/photos/gallery/*/*
  664. // @match https://*.xhamster.desi/photos/gallery/*/*
  665. // @exclude /^https://(.*\.)?xhamster(\d{1,2})?\.(com|desi)/photos/gallery/.*/\d{1,3}$/
  666. // @match http://*.imghall.com/?v=*
  667. // @match https://*.acidimg.cc/img-*
  668. // @match https://imgcloud.pw/image/*
  669. // @match https://z4a.net/image/*
  670. // @match https://t.hogor.net/?pm=*
  671. // @match http://xxxwebdlxxx.org/*.html
  672. // @match https://www.sizzlingclicks.com/image/*
  673. // @match http://wwxxww.ru/*.html
  674. // @match http://wwxxww.ru/full/
  675. // @match http://passpix.com/images/*
  676. // @match http://*.imgseed.com/img-*.html
  677. // @match http://img.folluo.me/image/*
  678. // @match *://imgpart.com/img-*
  679. // @match https://picstate.com/view/full/*
  680. // @match https://jerking.empornium.ph/image/*
  681. // @match https://truepic.org/*
  682. // @match https://www.jiopic.com/image/*
  683. // @match https://imx.to/img-*
  684. // @match https://imx.to/i/*
  685. // @match https://pixxxels.cc/*
  686. // @match http://picpic.online/*/*/
  687. // @match http://imgking.xyz/*.html
  688. // @match http://moreimage.pw/image/*
  689. // @match https://imgsha.com/i/*
  690. // @match https://www.pic-upload.de/view-*/*.html
  691. // @match http://pic3you.org/*.html
  692. // @match http://pic3you.org/full/
  693. // @match *://*.vipix.pw/images/*.html
  694. // @match https://*.imgazure.com/*.html
  695. // @match https://*.imgazure.com/full/
  696. // @match *://*.dpic.me/*
  697. // @match *://*.picmoza.com//img-*.html
  698. // @match *://suckmypic.net/*
  699. // @match *://pic.hotimg.site/img-*.html
  700. // @match http://*.shaggyimg.pro/*.html
  701. // @match http://*.shaggyimg.pro/full/
  702. // @match https://*.imgjazz.xyz/img-*.html
  703. // @match https://22pixx.xyz/i*-*/*.html
  704. // @match https://22pixx.xyz/i-*/*.html
  705. // @match https://22pixx.xyz/x-*/*.html
  706. // @match https://22pixx.xyz/y-*/*.html
  707. // @match *://trueimg.xyz/u-*/*.html
  708. // @match *://imgsmarts.info/*.html
  709. // @match *://imgsmarts.info/full/
  710. // @match *://www.keepimg.com/image/*
  711. // @match https://ibb.co/*
  712. // @match http://*.imgsee.net/*
  713. // @match *://*.picbaron.com/*/*.html
  714. // @match *://*.imgbaron.com/*/*
  715. // @match https://kvador.com/*/*.html
  716. // @match http://picshost.info//img-*.html
  717. // @match *://imagescanner.cc/images/*.html
  718. // @match http://batpic.com/image/*
  719. // @match http://*.1pic.org/view/*.html
  720. // @match *://lookimg.com/image/*
  721. // @match http://*.xfap.fun/img-*.html
  722. // @match *://*.hdmoza.com//img-*.html
  723. // @match *://trans.firm.in/images/*.html
  724. // @match http://*.imgtorrnt.in/view.php?id=*
  725. // @match https://*.dailyimages.xyz/*.html
  726. // @match https://*.dailyimages.xyz/full/
  727. // @match http://*.petrovixxxjav.com//img-*.html
  728. // @match *://*.placeimg.net/img-*.html
  729. // @match https://subefotos.com/ver/?*
  730. // @match http://*.imageshtorm.com/img-*.html
  731. // @match https://*.blameless.work/img-*.html
  732. // @match https://trumbhost.com/images/*.html
  733. // @match http://*.xxx.kodiak.top/img-*.html
  734. // @match *://*.your-pictures.net/p*/*.html
  735. // @match https://*.xaoutchouc.live/img-*.html
  736. // @match https://*.picusha.net/?v=*
  737. // @match https://e621.net/posts/*
  738. // @match https://rule34.xxx/index.php?page=post&s=view&id=*
  739. // @match https://*.rule34hentai.net/post/view/*
  740. // @match https://pixs.cx/*
  741. // @match *://mshelxxx.ru.com//img-*.html
  742. // @match *://www.hentai-foundry.com/pictures/*
  743. // @exclude *://www.hentai-foundry.com/pictures/user/*/page/*
  744. // @match *://imgcredit.xyz/image/*
  745. // @match *://drlink.online/*/*/
  746. // @match https://savepice.ru/full/*.html
  747. // @match https://kropic.com/*/*.html
  748. // @match http://*.imgzong.xyz/*
  749. // @match https://www.furaffinity.net/view/*
  750. // @match http://imageking.xyz/*
  751. // @match http://imgxx.xyz/*
  752. // @match http://imgao.xyz/*
  753. // @match http://imgweng.xyz/*
  754. // @match http://imgkes.xyz/*
  755. // @match https://imgair.net/*
  756. // @match https://imgtgd.shop/*
  757. // @match https://*.imgsto.com/*/*.html
  758. // @match https://*.pics4you.net/*/*.html
  759. // @match https://vipr.im/*
  760. // @match https://*.trans.firm.in/img-*.html
  761. // @match https://*.imgdawgknuttz.com/img-*.html
  762. // @match https://*.xxxwebdlxxx.top/img-*.html
  763. // @match https://*.olarixas.xyz/img-*.html
  764. // @match http://imgkoi.xyz/*
  765. // @match https://imagehaha.com/*/*
  766. // @match https://picshick.com/*/*
  767. // @match https://imgsen.com/*/*.html
  768. // @match https://premalo.com/*/*.html
  769. // @match https://picdollar.com/*/*.html
  770. // @match https://fotokiz.com/*/*.html
  771. // @match https://silverpic.com/*/*.html
  772. // @match http://imglin.xyz/*
  773. // @match *://*.crownimg.com/*/*.html*
  774. // @match http://imgkr.xyz/*
  775. // @match *://*.xxxwebdlxxx.org/img-*.html
  776. // @match http://imgbird.xyz/*
  777. // @match https://*.pornhd720p.com//img-*.html
  778. // @match http://imgwewo.xyz/*
  779. // @match https://*.rintor.space/image/*
  780. // @match http://imgirx.xyz/*
  781. // @match http://*.imgalor.xyz/*
  782. // @match http://imgjut.buzz/*
  783. // @match http://imgtrw.buzz/*
  784. // @match http://imglina.xyz/*
  785. // @match http://imgkuiw.xyz/*
  786. // @match http://imgwang.buzz/*
  787. // @match https://imgbb.com/*
  788. // @match *://vfl.ru/fotos/*.html
  789. // @match https://*.imgstar.eu/*/*.html
  790. // @match https://dewimg.com/*.php
  791. // @match https://pictwn.com/*.php
  792. // @match https://comment-cdn.9gag.com/image?*
  793. // @match https://t.me/*/*
  794. // @match https://telegram.me/*/*
  795. // @match *://piccy.info/view3/*/*/
  796. // @match http://imgmeno.buzz/*
  797. // @match https://*.pics4upload.com/*/*.html
  798. // @match http://imgpekele.buzz/*
  799. // @match http://imglqw.buzz/*
  800. // @match http://imgyng.buzz/*
  801. // @match http://imgbbd.buzz/*
  802. // @match http://imgwia.buzz/*
  803. // @match http://imgowk.buzz/*
  804. // @match http://imgokr.buzz/*
  805. // @match http://imgoiu.buzz/*
  806. // @match https://picmoney.org/image/*
  807. // @match *://skrinshoter.ru/s/*/*
  808. // @match https://photo-screen.ru/i/*
  809. // @match https://postlmg.cc/*
  810. // @match https://pasteboard.co/*
  811. // @match https://*.picklik.ru/image/*
  812. // @match https://*.jpg.church/img/*
  813. // @match https://rule34.us/index.php?r=posts/view&id=*
  814. // @match https://*.imghub.ru/i/*
  815. // @match https://imgeza.buzz/*
  816. // @match http://mrlzqoe.buzz/*
  817. // @match https://radikal.host/i/*
  818. // @match https://*.slowpic.xyz//img-*.html
  819. // @match https://yapx.ru/*/*
  820. // @match https://imgpukxxr.site/*
  821. // @match https://picngt.shop/*
  822. // @match https://realbooru.com/index.php?page=post&s=view&id=*
  823. // @match *://imgutkr.store/*
  824. // @match *://imghhr.online/*
  825. // @match *://imglaiw.store/*
  826. // @match https://meetimgz.com/*.php
  827. // @match *://imgvue.online/*
  828. // @match *://imgxgf.store/*
  829. // @match *://imgbibam.online/*
  830. // @match https://imgsh.net/a/*
  831. // @match *://imgqaz.online/*
  832. // @match *://imgurt.online/*
  833. // @match https://jpg.fish/img/*
  834. // @match https://jpg1.su/img/*
  835. // @match https://jpg2.su/img/*
  836. // @match https://jpg3.su/img/*
  837. // @match https://jpg4.su/img/*
  838. // @match *://imgwxr.online/*
  839. // @match *://imgyre.online/*
  840. // @match https://pixl.li/image/*
  841. // @match https://pixlev.store/*
  842. // @match https://pixmax.store/*
  843. // @match https://imgxqy.online/*
  844. // @match https://skr.sh/*
  845. // @match https://i.redd.it/*
  846. // @match https://preview.redd.it/*
  847. // @match https://www.reddit.com/media?url=*
  848. // @match https://vsco.co/*/media/*
  849. // @match https://www.gettyimages.com/detail*photo*
  850. // @match https://www.gettyimages.com/detail*video*
  851. // @match https://jpg.pet/img/*
  852. // @match https://jpeg.pet/img/*
  853. // @match https://imgnmh.cfd/*
  854. // @match https://im.ge/i/*
  855. // @match https://piczel.tv/gallery/image/*
  856. // @match https://www.redgifs.com/watch/*
  857. // @match https://v3.redgifs.com/watch/*
  858. // @match https://www.screencast.com/t/*
  859. // @match https://slushe.com/galleries/*.html
  860. // @match https://img.trafficimage.club/image/*
  861. // @match https://*.picturedent.org/image/*
  862. // @match https://pig69.com/upload/*
  863. // @match https://javball.com/upload/*
  864. // @match https://idol69.net/upload/*
  865. // @match https://picqaxs.cfd/*
  866. // @match https://www.zupimages.net/viewer.php?id=*
  867. // @match https://porn4f.com/upload/*
  868. // @match https://ovabee.com/upload/*
  869. // @match https://ai18.pics/upload/*
  870. // @match https://paste.pics/*
  871. // @match https://cnxx.me/upload/*
  872. // @match https://cnpics.org/upload/*
  873. // @match https://picvvvd.sbs/*
  874. // @match https://civitai.com/images/*
  875. // @match https://civitai.com/posts/*
  876. // @match https://cosplay18.pics/upload/*
  877. // @match https://*.mjj.today/i/*
  878. // @match https://adult-images.ru/*/*/
  879. // @match https://imgfoto.host/i/*
  880. // @match https://picabox.ru/pic/*
  881. // @match https://snipboard.io/*
  882. // @match https://www.seaart.ai/explore/detail/*
  883. // @match https://tensor.art/images/*
  884. // ==/UserScript==
  885.  
  886. "use strict";
  887.  
  888. console.debug("HandyImage Script running");
  889.  
  890. if (typeof unsafeWindow === "undefined")
  891. {
  892. unsafeWindow = window;
  893. console.warn("unsafeWindow missing");
  894. }
  895.  
  896. if (typeof GM_registerMenuCommand !== "undefined")
  897. {
  898. GM_registerMenuCommand("Handy Image Configuration", cfg, "C");
  899. }
  900.  
  901. if(window.location.href.lastIndexOf(window.location.hostname) + window.location.hostname.length + 1 == window.location.href.length)
  902. {
  903. console.warn("we are on website's main page, aren't we?");
  904. return false;
  905. }
  906. let type = document.contentType.substring(0,document.contentType.indexOf("/"));
  907. if (type === "image" || type === "video")
  908. {
  909. console.warn("Handy isn't needed for directly opened images or videos (if you want it this way - use CenterImage userscript");
  910. return false;
  911. }
  912. if(history.length !== 1 && document.referrer)
  913. {
  914. if(document.referrer.lastIndexOf(window.location.hostname) != -1 && document.referrer.lastIndexOf(window.location.hostname) +1 == document.referrer.length - window.location.hostname.length)
  915. {
  916. console.warn("Handy Image: userscript stopped itself from running INTENTIONALLY: cuz your previous page is websites mainpage so you probably have just uploaded a picture yourself");
  917. return false;
  918. }
  919. }
  920. if (document.title == "Attention Required! | Cloudflare")
  921. {
  922. console.warn("Cloudflare MITM guard page. Stopping.");
  923. return false;
  924. }
  925. if(sessionStorage.length)
  926. {
  927. if(sessionStorage.hji)
  928. {
  929. if(sessionStorage.hji.indexOf(window.location.href) != -1) // check address in case page failed to load b4
  930. {
  931. console.warn("Handy Image: userscript stopped itself from running INTENTIONALLY");
  932. sessionStorage.removeItem("hji");
  933. return false;
  934. }
  935. sessionStorage.removeItem("hji");
  936. }
  937. else if(sessionStorage.hji_back)
  938. {
  939. if(Date.now() < parseInt(sessionStorage.hji_back)) // 2 sec not yet passed
  940. {
  941. console.warn("Handy Image: userscript now helps you go to previous page automatically");
  942. sessionStorage.removeItem("hji_back");
  943. window.history.go(-1);
  944. return false;
  945. }
  946. sessionStorage.removeItem("hji_back");
  947. }
  948. }
  949.  
  950. function q(s){if(document.body){return document.body.querySelector(s);}return null;}
  951. var cfg_direct = false;
  952. var cfg_bgclr ="grey";
  953. var cfg_fitWH = true;
  954. var cfg_fitB = false;
  955. var cfg_fitS = true;
  956. var cfg_fitOS = false;
  957. var cfg_js;
  958. var cfg_vol = "0.5";
  959. var referrer_policy = "strict-origin-when-cross-origin"; // default browser behavior
  960. var dp = false;
  961. let orgImgWidth;
  962. let orgImgHeight;
  963. var rescaled = 0;
  964. var tb = 0;
  965. var tg = 0;
  966. var timeout = 1000;
  967. var FireFox = ((navigator.userAgent.indexOf('Firefox') != -1) ? true : false);
  968. var i;
  969. var j;
  970. var bStopScripts = false;
  971. var filename = "";
  972. var filename_ext = "";
  973. var skip_by = 5;
  974. var is_video = false;
  975. var is_gallery = false;
  976. var ext_list_not_image = ['zip', '7z', 'rar', 'psd', 'swf', 'doc', 'rtf', 'pdf'];
  977. var ext_list_video = ['webm', 'mp4', 'm4v', 'avi', 'flv', 'ogg'];
  978. var iurl = window.location.hostname;
  979. if(!iurl.indexOf("www."))
  980. {
  981. iurl = iurl.substr(4);
  982. }
  983. var host = iurl;
  984. if(window.location.pathname.indexOf("//") == 0)
  985. {
  986. iurl += "/";
  987. }
  988.  
  989. function ws()
  990. {
  991. if(!FireFox) // NOT firefox
  992. {
  993. window.stop();
  994. }
  995. }
  996.  
  997. function sanitize() // lol I'm such a hacker
  998. {
  999. removeAllListeners();
  1000. let lasttask = unsafeWindow.setTimeout(function() {},0);
  1001. for(let n = lasttask; n > 0; n--)
  1002. {
  1003. //if(n !== tg) // unsafeWindow.clear can't clear window.tasks set in the userscript but lets be safe
  1004. //{
  1005. unsafeWindow.clearTimeout(n); // only unsafeWindow has access to clear page tasks
  1006. //}
  1007. }
  1008. }
  1009.  
  1010. const protected_createElement = Document.prototype.createElement.bind(document);
  1011. protected_addEventListener.originalF = Element.prototype.addEventListener;
  1012. function protected_addEventListener (el, event, handler, capture = false)
  1013. {
  1014. return protected_addEventListener.originalF.call(el, event, handler, capture);
  1015. }
  1016.  
  1017. var _eventHandlers = {};
  1018. var origAdd = unsafeWindow.Element.prototype.addEventListener; // page's one
  1019. if(FireFox && typeof exportFunction === "function")
  1020. {
  1021. wrapper_addEventListener = exportFunction(wrapper_addEventListener, unsafeWindow); // TM magic
  1022. }
  1023. // addEventListener inside userscript's `window` doesn't change
  1024. unsafeWindow.Window.prototype.addEventListener = wrapper_addEventListener;
  1025. unsafeWindow.Document.prototype.addEventListener = wrapper_addEventListener;
  1026. unsafeWindow.Element.prototype.addEventListener = wrapper_addEventListener;
  1027.  
  1028. function wrapper_addEventListener (event, handler, capture = false)
  1029. {
  1030. //if (typeof _eventHandlers === "undefined") unsafeWindow._eventHandlers = {};
  1031. if (bStopScripts)
  1032. {
  1033. console.debug("HJI: stopped 1 addEventListener: " + event);
  1034. return null;
  1035. }
  1036. if (!(event in _eventHandlers)) _eventHandlers[event] = [];
  1037.  
  1038. _eventHandlers[event].push({ node: this || unsafeWindow, handler: handler, capture: capture });
  1039. console.debug("HJI: wrapped 1 addEventListener: " + event + ", "+ Object.keys(_eventHandlers).length);
  1040. return origAdd.call(this, event, handler, capture);
  1041. }
  1042.  
  1043. function removeAllListeners ()
  1044. {
  1045. console.debug("HJI: removed "+ Object.keys(_eventHandlers).length + " event listeners: " + Object.keys(_eventHandlers));
  1046. for(let event in _eventHandlers)
  1047. {
  1048. _eventHandlers[event].forEach(({ node, handler, capture }) => node.removeEventListener(event, handler, capture));
  1049. delete _eventHandlers[event];
  1050. }
  1051. }
  1052.  
  1053. function onVisibilityChange()
  1054. {
  1055. if (document.visibilityState === 'visible')
  1056. {
  1057. if(i && i.src)
  1058. {
  1059. window.removeEventListener('visibilitychange', onVisibilityChange);
  1060. autoresize();
  1061. }
  1062. }
  1063. }
  1064. window.addEventListener("visibilitychange", onVisibilityChange);
  1065.  
  1066. const AddElementToPage = typeof GM_addElement === "function" ? GM_addElement : function (node, type, content)
  1067. {
  1068. let el = protected_createElement(type);
  1069. el.textContent = content.textContent;
  1070. node.appendChild(el);
  1071. }; // stupid adGuard
  1072.  
  1073. function DeleteAllCookies()
  1074. {
  1075. document.cookie.split(";").forEach(function(c) {
  1076. document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
  1077. });
  1078. }
  1079.  
  1080. function onscript(e)
  1081. {
  1082. //console.debug( "STOPPED: " + e.target.src + e.target.innerHTML);
  1083. console.debug( "HJI: onscript stopped 1 script from loading");
  1084. e.preventDefault();
  1085. e.stopImmediatePropagation();
  1086. }
  1087.  
  1088. function onbeforeunload() // back helper
  1089. {
  1090. sessionStorage.hji_back = Date.now() + 2000; // 2 sec to help back from double-pages
  1091. }
  1092.  
  1093. function makeimage()
  1094. {
  1095. if(typeof cfg_js !== "string") { console.log("waiting for settings to load to makeimage()"); window.setTimeout(function() { makeimage(); }, 2); return false;} // lets wait for stupd async
  1096. if(cfg_direct === true){let a = protected_createElement('a'); a.setAttribute('href',i.src); a.click(); return false;}
  1097. if(cfg_bgclr){document.body.bgColor = cfg_bgclr;}
  1098. document.body.style.margin = "0px";
  1099. let css = (is_video? "video" : "img") +" { position: absolute; top: 0; right: 0; bottom: 0; left: 0; outline: none; image-orientation: from-image; background-color: "+cfg_bgclr+"; max-width: unset; max-height: unset; }";
  1100. AddElementToPage(document.documentElement, 'style', {textContent: css});
  1101. ws();
  1102. let isrc = i.src;
  1103. i = protected_createElement(is_video? "video" : "img");
  1104. i.src = isrc;
  1105. i.style.margin = "auto"; // center image
  1106. document.body.appendChild(i);
  1107. i.focus(); // so volume built-in hotkeys would work
  1108. if(!is_video)
  1109. {
  1110. protected_addEventListener(i, "click", rescale, true);
  1111. protected_addEventListener(i, "auxclick", rescale, true);
  1112. protected_addEventListener(i, "mousedown", mousedown, true); // chrome old fix - still needed
  1113. }
  1114. else
  1115. {
  1116. i.volume = cfg_vol;
  1117. protected_addEventListener(i, "volumechange", onvolumechange, true);
  1118. i.controls = true;
  1119. i.loop = true;
  1120. i.preload = "auto";
  1121. }
  1122. window.addEventListener("keydown", onkeydown, true);
  1123. if(dp){console.warn("you are on a double-page image hosting (probably)");window.addEventListener("beforeunload", onbeforeunload, true);}
  1124. onVisibilityChange(); // if tab is already active when opening image
  1125. if (typeof GM_registerMenuCommand !== "undefined")
  1126. {
  1127. GM_registerMenuCommand("Handy Image Download image", download_image, "N");
  1128. GM_registerMenuCommand("Handy Image Re-Load page normally", () => {sessionStorage.hji = window.location.href; window.location.reload();}, "R");
  1129. }
  1130. }
  1131.  
  1132. function find_text_in_scripts(text, stopword, start_from_top = null, search_after_word = null, content_type = "img")
  1133. {
  1134. let s = document.getElementsByTagName("script");
  1135. for(let c=0;c<s.length;c++)
  1136. {
  1137. if(search_after_word && s[c].innerHTML.indexOf(search_after_word) != -1){s[c].innerHTML = s[c].innerHTML.substring(0, s[c].innerHTML.indexOf(search_after_word));}
  1138. let start_pos = start_from_top ? s[c].innerHTML.indexOf(text) : s[c].innerHTML.lastIndexOf(text);
  1139. if(start_pos == -1){continue;}
  1140. start_pos += text.length;
  1141. let found_content = s[c].innerHTML.substring(start_pos,s[c].innerHTML.indexOf(stopword,start_pos));
  1142. found_content = JSON.parse('"' + found_content.replace('"', '\\"') + '"'); // unescape it
  1143. found_content = decodeURIComponent(found_content);
  1144. i = protected_createElement(content_type);
  1145. i.src = found_content;
  1146. console.debug("found url in the script: " + found_content);
  1147. return true;
  1148. }
  1149. return false;
  1150. }
  1151.  
  1152. function post(path, params, method)
  1153. {
  1154. method = method || "post";
  1155. let form = protected_createElement("form");
  1156. form.setAttribute("method", method);
  1157. form.setAttribute("action", path);
  1158. for(let key in params)
  1159. {
  1160. if(Object.hasOwn(params, key)) // hasOwnProperty
  1161. {
  1162. let hiddenField = protected_createElement("input");
  1163. hiddenField.setAttribute("type", "hidden");
  1164. hiddenField.setAttribute("name", key);
  1165. hiddenField.setAttribute("value", params[key]);
  1166.  
  1167. form.appendChild(hiddenField);
  1168. }
  1169. }
  1170. document.body.appendChild(form);
  1171. form.submit();
  1172. }
  1173.  
  1174. function makeworld()
  1175. {
  1176. let f;
  1177. if(i){return;}
  1178. // per-host image detection
  1179. switch (host)
  1180. {
  1181. case "simplest-image-hosting.net":
  1182. case "hostimage.ru":
  1183. case "imgchili.net":
  1184. case "adultimages.xyz":
  1185. i = q('img');
  1186. break;
  1187. case "myceleb.net":
  1188. case "depic.me":
  1189. case "dpic.me":
  1190. i = q('img#pic');
  1191. break;
  1192. case "imagebin.ca":
  1193. i = q('a img');
  1194. if(i){i.src = i.parentNode.href;}
  1195. break;
  1196. case "i.redd.it":
  1197. case "preview.redd.it":
  1198. i = q('faceplate-img, img');
  1199. if(i){i.src = i.getAttribute("src");}
  1200. break;
  1201. case "savepic.org":
  1202. case "savepic.ru":
  1203. i = q('a img:not([src*="/images/"])');
  1204. break;
  1205. case "motherless.com":
  1206. j = true;
  1207. i = q('div#media-media div a img');
  1208. break;
  1209. case "awesomescreenshot.com":
  1210. i = q('img#screenshot');
  1211. break;
  1212. case "zupimages.net":
  1213. i = q('img#img_size');
  1214. break;
  1215. case "dropbox.com":
  1216. j = true;
  1217. i = q('img.preview-image');
  1218. if(i)
  1219. {
  1220. i.src = i.src.replace(/(size_mode)=\d+/, '$1=5');
  1221. }
  1222. break;
  1223. case "img.3ezy.net":
  1224. case "image-bugs.com":
  1225. case "imgclover.com":
  1226. case "demo.chevereto.com":
  1227. case "daily-img.com":
  1228. case "celebimg.com":
  1229. case "sfwimg.com":
  1230. case "img3x.com":
  1231. case "imgskull.xyz":
  1232. case "imgskull.com":
  1233. case "2i.sk":
  1234. case "2i.cz":
  1235. case "deffe.com":
  1236. case "imagik.fr":
  1237. case "gallerycloud.net":
  1238. case "tryimg.com":
  1239. case "fsfiles.org":
  1240. case "picpicture.com":
  1241. case "picpie.org":
  1242. case "lostpic.net":
  1243. case "batpic.com":
  1244. //chevereto 3.x
  1245. i = document.head.querySelector('link[rel="image_src"]');
  1246. if(i)
  1247. {
  1248. i.src = i.href;
  1249. i.src = i.src.replace('_800.', '.'); //img.3ezy.net
  1250. }
  1251. break;
  1252. case "imagebam.com":
  1253. //j = true;
  1254. i = q("a i.fa-download");
  1255. if(i)
  1256. {
  1257. i.src = i.parentNode.href;
  1258. }
  1259. else
  1260. {
  1261. i = q("#continue a");
  1262. if(i)
  1263. {
  1264. let expires = '';
  1265. let date = new Date();
  1266. date.setTime(date.getTime() + (6 * 60 * 60 * 1000));
  1267. expires = "; expires=" + date.toUTCString();
  1268. document.cookie = "nsfw_inter=1" + expires + "; path=/";
  1269. i.click();
  1270. }
  1271. }
  1272. break;
  1273. case "directupload.net":
  1274. case "bilderhoster.net":
  1275. case "noelshack.com":
  1276. case "kephost.com":
  1277. case "i.ruspotting.net":
  1278. case "gifyu.com":
  1279. case "sharepic.org":
  1280. case "zuly.de":
  1281. case "upload.vstanced.com":
  1282. case "thro.bz":
  1283. case "qoou.net":
  1284. case "brightpic.tk":
  1285. case "cweb-pix.com":
  1286. case "hosting.webspell.fr":
  1287. case "i-pict.ru":
  1288. case "images.woh.to":
  1289. case "imghaze.com":
  1290. case "imgup.nl":
  1291. case "nium.co":
  1292. case "pix.hostux.net":
  1293. case "pixoload.de":
  1294. case "primeimg.co":
  1295. case "pic.xtream-reallife.de":
  1296. case "ultraimg.com":
  1297. case "safeimage.biz":
  1298. case "imgextra.uk":
  1299. case "ss.movierls.net":
  1300. case "xxximagetpb.org":
  1301. case "pix.ac":
  1302. case "sparrowpics.com":
  1303. case "prnt.sc":
  1304. case "imgmax.com":
  1305. case "extraimago.com":
  1306. case "extraimage.net":
  1307. case "imgcloud.pw":
  1308. case "z4a.net":
  1309. case "jiopic.com":
  1310. case "wwv.imgcredit.xyz":
  1311. case "moreimage.pw":
  1312. case "lookimg.com":
  1313. case "subefotos.com":
  1314. case "imgcredit.xyz":
  1315. case "rintor.space":
  1316. case "imgbb.com":
  1317. case "servimg.com":
  1318. case "picmoney.org":
  1319. case "skrinshoter.ru":
  1320. case "imgmak.com":
  1321. case "picklik.ru":
  1322. case "jpg.church":
  1323. case "imghub.ru":
  1324. case "radikal.host":
  1325. case "imgsh.net":
  1326. case "jpg.fish":
  1327. case "pixl.li":
  1328. case "skr.sh":
  1329. case "jpg.pet":
  1330. case "jpeg.pet":
  1331. case "im.ge":
  1332. case "screencast.com":
  1333. case "picshare.ru":
  1334. case "jpg1.su":
  1335. case "jpg2.su":
  1336. case "jpg3.su":
  1337. case "jpg4.su":
  1338. case 'img.trafficimage.club':
  1339. case 'pig69.com':
  1340. case 'javball.com':
  1341. case 'idol69.net':
  1342. case 'porn4f.com':
  1343. case 'ovabee.com':
  1344. case 'ai18.pics':
  1345. case "paste.pics":
  1346. case 'cnxx.me':
  1347. case 'cnpics.org':
  1348. case 'cosplay18.pics':
  1349. case 'mjj.today':
  1350. case "imgfoto.host":
  1351. case "picabox.ru":
  1352. case "snipboard.io":
  1353. case "seaart.ai":
  1354. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1355. if(i)
  1356. {
  1357. i.src = i.content;
  1358. }
  1359. else
  1360. {
  1361. i = q('a[download]');
  1362. if(i){i.src = i.href;}
  1363. }
  1364. break;
  1365. case "vsco.co":
  1366. i = document.querySelector('meta[property="og:image"]');
  1367. if(i)
  1368. {
  1369. i.src = i.content.substring(0, i.content.indexOf("?"));
  1370. }
  1371. break;
  1372. case "civitai.com":
  1373. j = true;
  1374. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1375. if(i)
  1376. {
  1377. i.src = i.content.replace("width=1200","width=3840"); // 4k
  1378. }
  1379. break;
  1380. case "tensor.art":
  1381. j = true;
  1382. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1383. if(i)
  1384. {
  1385. i.src = i.content.replace("w=600","w=3840"); // 4k (if available)
  1386. }
  1387. break;
  1388. case "mobile.twitter.com":
  1389. case "twitter.com":
  1390. j = true;
  1391. unsafeWindow.history.replaceState = unsafeWindow.console.log;
  1392. i = q('a[href*="/photo/' + Number(window.location.href.at(-1)) + '"] img');
  1393. if(i)
  1394. {
  1395. i.src = i.src.substring(0, i.src.indexOf("&name=")) + '&name=orig';
  1396. filename = "by " + document.head.querySelector('meta[property="og:title"]').content;
  1397. filename_ext = i.src.substring(i.src.indexOf("format=")+7 ,i.src.indexOf("&"));
  1398. }
  1399. break;
  1400. case "redgifs.com":
  1401. case "v3.redgifs.com":
  1402. j = true;
  1403. i = q('video, img.ImageGif-Thumbnail');
  1404. break;
  1405. case "m.imgur.com":
  1406. j = true;
  1407. i = q('img.Image');
  1408. break;
  1409. case "imgur.com":
  1410. j = true;
  1411. f = document.querySelectorAll(".image-placeholder,.post-image-placeholder,.image.post-image > img"); // for beta and non-beta
  1412. if(f.length)
  1413. {
  1414. if(f.length != 1)
  1415. {
  1416. is_gallery = true;
  1417. }
  1418. else
  1419. {
  1420. i = f[0];
  1421. let fi;
  1422. if((fi = i.src.indexOf("_d.webp")) != -1)
  1423. {
  1424. i.src = i.src.substr(0, fi) + ".jpg"; // png files will be named jpg too here
  1425. console.log("Handy Image: imgur replaced a LQ preview image with original one");
  1426. }
  1427. }
  1428. }
  1429. break;
  1430. case "ameblo.jp":
  1431. j = true;
  1432. i = q('img#imgItem');
  1433. break;
  1434. case "instagram.com":
  1435. j = true;
  1436. // find_text_in_scripts('"url":"', '"', false, '"image_versions2"')
  1437. if(q("header"))
  1438. {
  1439. f = document.querySelectorAll("div[role=button] > div > div img")
  1440. if(f.length === 1)
  1441. {
  1442. i = f[0];
  1443. }
  1444. else
  1445. {
  1446. is_gallery = true;
  1447. }
  1448. }
  1449. break;
  1450. case "flickr.com":
  1451. case "secure.flickr.com":
  1452. find_text_in_scripts('"displayUrl":"', '"', false, '"canComment"');
  1453. break;
  1454. case "artstation.com":
  1455. j = true;
  1456. f = document.querySelectorAll('a[href*="&dl="]')
  1457. if(f.length === 1)
  1458. {
  1459. i = f[0];
  1460. i.src = i.href;
  1461. }
  1462. break;
  1463. case "piczel.tv":
  1464. j = true;
  1465. f = document.querySelector("a.GalleryImage_SingleTag");
  1466. if(f)
  1467. {
  1468. i = q('a[href*="/gallery_image/"]');
  1469. if(i)
  1470. {
  1471. if(i.parentNode.previousSibling === null)
  1472. {
  1473. filename = f.parentNode.textContent.substring(1);
  1474. i.src = i.href;
  1475. }
  1476. else
  1477. {
  1478. is_gallery = true;
  1479. }
  1480. }
  1481. }
  1482. break;
  1483. case "pixiv.net":
  1484. j = true;
  1485. i = document.head.querySelector('meta[name="preload-data"]');
  1486. if (i)
  1487. {
  1488. let a = JSON.parse(i.getAttribute('content')).illust;
  1489. let b = a[Object.keys(a)[0]];
  1490. if(b.pageCount !== 1)
  1491. {
  1492. console.warn("Manga page with multiple images, no action taken further");
  1493. return;
  1494. }
  1495. else if(b.illustType == 2)
  1496. {
  1497. console.warn("Animated ugoira image found, no action taken further");
  1498. return;
  1499. }
  1500. i.src = b.urls.original;
  1501. filename = b.title + " by " + b.userName;
  1502. b.tags.tags.forEach(el => filename = filename + " " + el.tag);
  1503. }
  1504. break;
  1505. case "idol.sankakucomplex.com":
  1506. case "chan.sankakucomplex.com":
  1507. i = q('a[itemprop="contentUrl"]');
  1508. if(i)
  1509. {
  1510. use_booru_tags_in_dl_filename();
  1511. i.src = i.href;
  1512. referrer_policy = "no-referrer";
  1513. }
  1514. break;
  1515. case "bcy.net":
  1516. f = document.querySelectorAll("img.detail_clickable");
  1517. if(f.length == 1)
  1518. {
  1519. i = f[0];
  1520. i.src = f[0].src.replace('/w650', '');
  1521. }
  1522. break;
  1523. case "imageshack.com":
  1524. i = q('input[value*="' + iurl + '/f/"]');
  1525. if(i){window.location.href = i.value.replace('/f/', '/i/');}
  1526. i = q('img[data-width]');
  1527. break;
  1528. case "22pixx.xyz":
  1529. case "trueimg.xyz":
  1530. f = window.location.href.match(/[a-z]+-([a-z].+(?:\.jpe?g|png|gif|webp))/i);
  1531. if(f)
  1532. {
  1533. i = {src : window.location.origin + "/" + f[1]};
  1534. }
  1535. break;
  1536. case "h4z.it":
  1537. i = document.images[2];
  1538. if(i){i.src = i.parentNode.href;}
  1539. break;
  1540. case "thumbsnap.com":
  1541. i = q('img#thepic');
  1542. if(i && i.parentNode.href){i.src = i.src.replace('/s/', '/i/');}
  1543. break;
  1544. case "imgbox.com":
  1545. case "imageupper.com":
  1546. case "hotflick.net":
  1547. case "upix.me":
  1548. i = q('img#img');
  1549. if(!i && window.location.hash) // upix.me
  1550. {
  1551. i = q('a');
  1552. i.src = window.location.href.replace("#","");
  1553. }
  1554. break;
  1555. case "imagesnake.com":
  1556. case "imagesnake.org":
  1557. case "freebunker.com":
  1558. case "imagefruit.com":
  1559. case "imagestime.com":
  1560. case "imgcarry.com":
  1561. case "pornbus.org":
  1562. case "fotoo.pl":
  1563. case "hostpix.de":
  1564. case "uploadking.biz":
  1565. case "foto.xhost.lv":
  1566. case "onimage.net":
  1567. case "storepic.com":
  1568. case "hostarea.de":
  1569. case "imgshots.com":
  1570. i = q('img#img_obj');
  1571. break;
  1572. case "abload.de":
  1573. i = document.body.querySelectorAll('img#image');
  1574. if(i)
  1575. {
  1576. i = i[i.length-1];
  1577. }
  1578. break;
  1579. case "imagecrest.com":
  1580. case "imagepearl.com":
  1581. case "imageup.ru":
  1582. i = q('#verify2');
  1583. if(i)
  1584. {
  1585. let w = screen.width;
  1586. let h = screen.height;
  1587. let u = q('#i').value;
  1588. let r = q('#r').value;
  1589. let xhttp = new XMLHttpRequest();
  1590. xhttp.onreadystatechange = function() {
  1591. if (xhttp.readyState == 4 && xhttp.status == 200) {
  1592. location.reload();
  1593. }
  1594. };
  1595. xhttp.open("GET", "verify.php?w=" + w + "&h=" + h + "&i=" + u + "&r=" + r + "", false);
  1596. xhttp.send();
  1597. break;
  1598. }
  1599. i = q('img#image');
  1600. break;
  1601. case "fastpic.ru":
  1602. case "fastpic.org":
  1603. case "slowpic.xyz":
  1604. i = q('img[src*="/big/"]');
  1605. break;
  1606. case "bayimg.com":
  1607. i = q('img#mainImage');
  1608. break;
  1609. case "imageban.ru":
  1610. case "imageban.net":
  1611. i = q('img[src*="' + iurl + '/out/"]');
  1612. break;
  1613. case "xup.in":
  1614. i = q('img[src*="/exec/"]');
  1615. break;
  1616. case "jpegbay.com":
  1617. i = q('a[class]');
  1618. if(i){i.src = i.href;}
  1619. break;
  1620. case "keep4u.ru":
  1621. i = q('img[src*="/b/"]');
  1622. break;
  1623. case "euro-pic.eu":
  1624. case "picfox.org":
  1625. case "freeimage.us":
  1626. case "xxx.freeimage.us":
  1627. case "pixsor.com":
  1628. case "img.pereslavl.ru":
  1629. case "rupict.ru":
  1630. case "host99.byethost4.com":
  1631. case "eazypics.net":
  1632. case "xtupload.com":
  1633. case "t.williamgates.net":
  1634. case "imgz.pw":
  1635. case "imgurx.net":
  1636. //i = q('img#iimg');
  1637. if(!find_text_in_scripts("<img src='", "'"))
  1638. {
  1639. i = q('a[download]'); // imgz.pw
  1640. if(i){i.src = i.href;}
  1641. }
  1642. break;
  1643. case "amateri.cz":
  1644. if(find_text_in_scripts('var orig_url="', '"'))
  1645. {
  1646. i.src = i.src.replace('http://www.amateri.cz/orig.php?&img=', 'http://img2.amateri.cz/users/');
  1647. }
  1648. break;
  1649. case "imgtgd.shop":
  1650. j = true;
  1651. case "pixlev.store":
  1652. case "pixmax.store":
  1653. case "imgair.net":
  1654. case "imgxqy.online":
  1655. case "imgnmh.cfd":
  1656. case "imgpukxxr.site":
  1657. case "picngt.shop":
  1658. find_text_in_scripts('.src = "', '"');
  1659. break;
  1660. case "pix-x.net":
  1661. case "picclock.ru":
  1662. case "imgcach.ru":
  1663. case "picpic.online":
  1664. case "drlink.online":
  1665. i = q('img[onclick*="mshow"]');
  1666. if(i){i.src = i.src.replace('-thumb', '');i.src = i.src.replace('img_thumb', 'img_full');}
  1667. break;
  1668. case "pics-money.ru":
  1669. i = q('img[src*="/full/"]');if(i){break;}
  1670. case "pic5you.ru":
  1671. case "pic4you.ru":
  1672. case "picforall.ru":
  1673. case "adult-images.ru":
  1674. case "picage.ru":
  1675. case "images-host.biz":
  1676. case "pic-mir.ru":
  1677. case "payforpic.ru":
  1678. case "freshpics.ru":
  1679. case "imgbase.online":
  1680. case "picpays.ru":
  1681. case "piccash.net":
  1682. case "imgbase.ru":
  1683. i = q('img[src*="thumb"]');
  1684. if(i){i.src = i.src.replace('-thumb', '');i.src = i.src.replace('img_thumb', 'img_full');i.src = i.src.replace('_thumb', '');}
  1685. break;
  1686. case "tinypic.com":
  1687. i = q('img#imgElement');
  1688. break;
  1689. case "picshot.pl":
  1690. i = q('img[src*="' + iurl + '/p"]');
  1691. if(i){i.src = i.src.replace('thumb', 'file');}
  1692. break;
  1693. case "sharenxs.com":
  1694. i = q('img.view_photo');
  1695. if(i){i.src = i.src.replace('/thumbnails/', '/images/');
  1696. i.src = i.src.replace('/tn-', '/');
  1697. i.src = i.src.replace('/mid/', '/wz/');
  1698. f = q('div.alert.alert-info.nomargin.photo_name span');
  1699. if(f)
  1700. {
  1701. let url = i.src;
  1702. i.src = url.substring(0,url.lastIndexOf('/')+1) + f.textContent + url.substring(url.lastIndexOf('.'));
  1703. }}
  1704. break;
  1705. case "gettyimages.com":
  1706. j = true;
  1707. find_text_in_scripts('"largeMainImageURL":"', '"') || find_text_in_scripts('"filmCompUrl":"', '"',null,null,"video");
  1708. break;
  1709. case "radikal.ru":
  1710. case "radical-foto.ru":
  1711. case "radikal-foto.ru":
  1712. case "f-page.ru":
  1713. case "f-lite.ru":
  1714. case "f-picture.net":
  1715. find_text_in_scripts('"Url":"', '"');
  1716. break;
  1717. case "jerking.empornium.ph":
  1718. find_text_in_scripts(' url: "', '"', true);
  1719. break;
  1720. case "bilder-space.de":
  1721. case "imagesup.de":
  1722. i = q('img.picture');
  1723. break;
  1724. case "pix.toile-libre.org":
  1725. case "photo-host.org":
  1726. case "myxpic.com":
  1727. case "picness.com":
  1728. i = q('a[href*="original"]');
  1729. if(i){i.src = i.href;}
  1730. break;
  1731. case "pimpandhost.com":
  1732. i = q('div.main-image-wrapper');
  1733. if(i){i.src = i.dataset.src;}
  1734. break;
  1735. case "postlmg.cc":
  1736. i = q('img#main-image');
  1737. break;
  1738. case "sexybabepics.net":
  1739. case "keepimg.com":
  1740. case "ibb.co":
  1741. i = document.head.querySelector('meta[property="og:image"]');
  1742. if(i){i.src = i.content; break;}
  1743. case "pasteboard.co":
  1744. i = document.head.querySelector('meta[name="twitter:image"]');
  1745. if(i){i.src = i.content; break;}
  1746. case "picsee.net":
  1747. i = q('a[href*="/upload"]');
  1748. if(i){i.src = i.href;}
  1749. break;
  1750. case "imagevenue.com":
  1751. i = q('img#main-image');
  1752. break;
  1753. case "slushe.com":
  1754. j = true;
  1755. if(q('footer')){ i = q('img.big-photo'); }
  1756. if(i){use_booru_tags_in_dl_filename(); }
  1757. break;
  1758. case "hentai-foundry.com":
  1759. j = true;
  1760. i = q('.boxbody img');
  1761. if(i && i.onclick)
  1762. {
  1763. i.click();
  1764. }
  1765. break;
  1766. case "realbooru.com":
  1767. i = q('img#image');
  1768. if(!i)
  1769. {
  1770. i = q('video#gelcomVideoPlayer');
  1771. if(i && i.currentSrc){i.src = i.currentSrc;}
  1772. }
  1773. if(i){use_booru_tags_in_dl_filename(); }
  1774. break;
  1775. case "rule34.xxx":
  1776. case "rule34.us":
  1777. j = true;
  1778. i = q('a[href*="/images/"][href*="' + host + '/"]');
  1779. if(i){use_booru_tags_in_dl_filename(); i.src = i.href;}
  1780. break;
  1781. case "rule34hentai.net":
  1782. case "danbooru.donmai.us":
  1783. i = q('a[download]');
  1784. if(i){use_booru_tags_in_dl_filename(); i.src = i.href;}
  1785. break;
  1786. case "e621.net":
  1787. i = q('div#image-download-link a');
  1788. if(i){use_booru_tags_in_dl_filename(); i.src = i.href;}
  1789. break;
  1790. case "gelbooru.com":
  1791. case "youhate.us":
  1792. case "safebooru.org":
  1793. j = true;
  1794. i = q('a[href*="/images/"][style]');
  1795. if(i){use_booru_tags_in_dl_filename(); i.src = i.href;}
  1796. break;
  1797. case "deviantart.com":
  1798. j = true;
  1799. if(q('div[role="complementary"]')) // page loaded enough
  1800. {
  1801. i = q('a[download]');
  1802. if(i && i.href.indexOf("deviantart.com/users/outgoing?") == -1){i.src = i.href;console.log("found download link");}
  1803. else
  1804. {
  1805. if(parseInt(window.location.pathname.substring(window.location.pathname.lastIndexOf("-")+1)) <= 790677560) // max resolution hax (available only for old images - sadly)
  1806. {
  1807. i = document.head.querySelector('link[rel="preload"][as="image"]');
  1808. if(i)
  1809. {
  1810. i = q('img[src="' + i.href + '"]'); // need to check its cursor now
  1811. if(i)
  1812. {
  1813. if(getComputedStyle(i).cursor === "zoom-in")
  1814. {
  1815. f = i.src.search(/\/f\/[^\/]+\/[^\/]+/); // no idea what this code was for
  1816. if(f !== -1)
  1817. {
  1818. i.src = i.src.substring(0,f+i.src.match(/\/f\/[^\/]+\/[^\/]+/)[0].length);
  1819. }
  1820. //
  1821. i.src = i.src.replace('/f/', '/intermediary/f/');
  1822. console.log("hacked image resolution to maximum");
  1823. }
  1824. else
  1825. {
  1826. console.log("found very old and small image - no higher resolution to look for")
  1827. }
  1828. }
  1829. }
  1830. }
  1831. else
  1832. {
  1833. i = q('div[role="dialog"] div img'); // zoomed in
  1834. if(i)
  1835. {
  1836. console.log("found zoomed-in image");
  1837. f = i.src.match(/,q_\d\d,/);
  1838. if(f !== null)
  1839. {
  1840. i.src = i.src.replace(f[0], ',q_100,'); // max quality hax
  1841. console.log("hacked image quality to maximum (but not resolution)");
  1842. }
  1843. break;
  1844. }
  1845. i = q('div[data-hook="art_stage"] div div div img'); // not zoomed in yet
  1846. if(i){console.log("found un-zoomed image, clicked it");i.click();i=null;break;}
  1847. }
  1848. }
  1849. if(i)
  1850. {
  1851. filename = document.title.replace(" on DeviantArt","");
  1852. }
  1853. }
  1854. break;
  1855. case "furaffinity.net":
  1856. j = true;
  1857. i = q('div.download a');
  1858. if(i){i.src = i.href;}
  1859. break;
  1860. case "imagehost.eu":
  1861. i = q('a#image');
  1862. if(i){i.src = i.href;}
  1863. break;
  1864. case "imgplus.info":
  1865. i = q('img[src*="full"]');
  1866. break;
  1867. case "zerochan.net":
  1868. i = q('a[href*="full"]');
  1869. if(i){i.src = i.href;}
  1870. break;
  1871. case "wstaw.org":
  1872. i = q('a[href*="/m/"]');
  1873. if(i){i.src = i.href;}
  1874. break;
  1875. case "imageshost.ru":
  1876. i = q('a[href*="/img/"]');
  1877. if(i){i.src = i.href;}
  1878. break;
  1879. case "uploadimage.ro":
  1880. i = q('img[src*="img.php"]');
  1881. break;
  1882. case "imageno.com":
  1883. i = q('img[src*="image.php"]');
  1884. break;
  1885. case "loadpix.de":
  1886. i = q('img[src*="bild.php"]');
  1887. break;
  1888. case "bildr.no":
  1889. i = q('img[src*="image"]');
  1890. break;
  1891. case "iv.pl":
  1892. case "funextra.hostzi.com":
  1893. case "freakimage.com":
  1894. case "imageurlhost.com":
  1895. case "superkipje.com":
  1896. case "ximg.co.uk":
  1897. case "sl-images.ath.cx":
  1898. case "hosting-zdjec.pl":
  1899. case "upislam.com":
  1900. case "add-screen.com":
  1901. case "my-collection.ru":
  1902. case "img.schattorie.nl":
  1903. case "forexrainbow.com":
  1904. case "imgupload.pl":
  1905. case "addpix.net":
  1906. case "myuploadedimages.com":
  1907. case "multihoster.saxonia-fighter.de":
  1908. case "imgdone.com":
  1909. case "greenpiccs.com":
  1910. case "balkanelite.org":
  1911. case "qrrro.com":
  1912. case "vipix.pw":
  1913. case "imagecurl.com":
  1914. case "imagecurl.org":
  1915. case "imagescanner.cc":
  1916. i = q('a[href*="images/"]');
  1917. if(i){i.src = i.href;}
  1918. break;
  1919. case "fotoshack.us":
  1920. i = q('img[src*="/fotos/"]');
  1921. break;
  1922. case "subefotos.com":
  1923. j = true;
  1924. i = q('img[src*="fotos.' + iurl + '"]');
  1925. break;
  1926. case "pictureshoster.com":
  1927. case "zaslike.com":
  1928. case "dwimg.com":
  1929. case "uploadagent.de":
  1930. i = q('a[href*="files/"]');
  1931. if(i){i.src = i.href;}
  1932. break;
  1933. case "photosex.biz":
  1934. i = q('img[src*="/pic"]');
  1935. break;
  1936. case "pronpic.org":
  1937. i = q('img#small_img[src*="/pic/"]');
  1938. if(i){i.src = i.src.replace('th_', '');}
  1939. break;
  1940. case "imadul.com":
  1941. i = q('div.img_box a');
  1942. if(i){i.src = i.href;}
  1943. break;
  1944. case "imgmega.com":
  1945. case "pic.re":
  1946. case "picbaron.com":
  1947. case "imgbaron.com":
  1948. case "kvador.com":
  1949. case "pics4you.net":
  1950. i = q('input[type="submit"]');
  1951. dp=true;
  1952. if(i)
  1953. {
  1954. i.click();
  1955. break;
  1956. }
  1957. case "screenlist.ru":
  1958. case "picshare.geenza.com":
  1959. case "mojoimage.com":
  1960. case "imagecherry.com":
  1961. case "10.imageleon.com":
  1962. case "img4.imagetitan.com":
  1963. case "ninjaimages.com":
  1964. case "3xplanet.com":
  1965. case "3xplanet.net":
  1966. i = q('img[onload*="scale"]');
  1967. break;
  1968. case "bild.me":
  1969. case "imagecarry.com":
  1970. case "imagedunk.com":
  1971. case "imageswitch.com":
  1972. case "piclambo.net":
  1973. case "picleet.com":
  1974. case "yankoimages.net":
  1975. case "picturedip.com":
  1976. case "imagezilla.net":
  1977. case "hotchyx.com":
  1978. case "imagehousing.com":
  1979. case "cubeupload.com":
  1980. case "dumparump.com":
  1981. case "uploads.ru":
  1982. case "myimg.de":
  1983. case "root-space.eu":
  1984. case "mepic.ru":
  1985. case "postto.me":
  1986. i = q('img[src*="' + iurl + '"]');
  1987. break;
  1988. case "ask.fm":
  1989. i = q('img[src*="' + iurl + '"][id]');
  1990. i.src = i.src.replace('/original/', '/large/'); //ask.fm
  1991. break;
  1992. case "photo.weibo.com":
  1993. i = q('img[src*="/large/"]');
  1994. break;
  1995. case "picfront.org":
  1996. j = true;
  1997. i = q('img[src*="' + iurl + '"][title]');
  1998. break;
  1999. case "platimzafoto.ru":
  2000. case "pic-money.ru":
  2001. case "imgmoney.ru":
  2002. case "img24.org":
  2003. case "svetmonet.ru":
  2004. case "pic4share.ru":
  2005. case "pic-images.ru":
  2006. case "imgspic.ru":
  2007. case "picpower.ru":
  2008. case "piccloud.ru":
  2009. case "pixxsees.ru":
  2010. case "2picsun.ru":
  2011. case "img-pika.ru":
  2012. case "wwxxww.ru":
  2013. case "pic3you.org":
  2014. case "shaggyimg.pro":
  2015. case "imgsmarts.info":
  2016. case "dailyimages.xyz":
  2017. case "imgazure.com":
  2018. f = document.getElementsByTagName("button");
  2019. if(f.length)
  2020. {
  2021. f[f.length-1].click();
  2022. }
  2023. dp=true;
  2024. i = q('img[src*="/pic.jpeg"]');
  2025. break;
  2026. case "imagerar.com":
  2027. if(window.location.href.indexOf("img-") != -1)
  2028. {
  2029. window.location.href = window.location.href.replace("img-","img2-");
  2030. break;
  2031. }
  2032. case "imgprime.com":
  2033. if(window.location.href.indexOf("img-") != -1)
  2034. {
  2035. window.location.href = window.location.href.replace("img-","img3-");
  2036. break;
  2037. }
  2038. else if (window.location.href.indexOf("/imga-u/") != -1)
  2039. {
  2040. window.location.href = window.location.href.replace("/imga-u/","/imgb-u/");
  2041. break;
  2042. }
  2043. else if(window.location.href.indexOf("/imgb-u/") != -1)
  2044. {
  2045. i = q('img[src*="/u/b/"]');
  2046. break;
  2047. }
  2048. case "freeimagehosting.net":
  2049. case "uploadhouse.com":
  2050. case "fotos-hochladen.net":
  2051. case "imgtab.net":
  2052. i = q('img[src*="uploads/"]');
  2053. break;
  2054. case "xtremeshack.com":
  2055. i = q('img[src*="/photos/"]');
  2056. break;
  2057. case "500px.com":
  2058. j = true;
  2059. i = q('#copyrightTooltipContainer img');
  2060. if (i) {
  2061. var m = i.src.match('/photo/(\\d+)/');
  2062. if (m) {
  2063. var xhttp = new XMLHttpRequest();
  2064. xhttp.open('GET', 'https://api.500px.com/v1/photos?ids=' + m[1] + '&image_size=4096');
  2065. xhttp.onload = function() {
  2066. if (xhttp.status == 200) {
  2067. try {
  2068. i.src = JSON.parse(xhttp.response)['photos'][m[1]]['images'][0]['url'];
  2069. console.log("hacked image resolution to maximum");
  2070. } catch (e) {console.warn(e);}
  2071. }
  2072. }
  2073. xhttp.send();
  2074. }
  2075. }
  2076. break;
  2077. case "picturepush.com":
  2078. i = q('img[src*="/photo/"]');
  2079. break;
  2080. case "keptarolo.hu":
  2081. i = q('img[src*="/kep/"]');
  2082. break;
  2083. case "truepic.org":
  2084. i = q('img[src*="/u/"]');
  2085. break;
  2086. case "imagearn.com":
  2087. i = q('img[src*="/imags/"]');
  2088. break;
  2089. case "ichan.org":
  2090. i = q('img[src*="/src/"]');
  2091. break;
  2092. case "ibunker.us":
  2093. case "hostingpics.net":
  2094. i = q('img[src*="pics/"]');
  2095. break;
  2096. case "dewimg.com":
  2097. case "subirimagenes.com":
  2098. j = true;
  2099. dp = true;
  2100. f = document.querySelectorAll("input[type='submit']");
  2101. if(f.length)
  2102. {
  2103. let n;
  2104. for(n=f.length-1; n >= 0; n--)
  2105. {
  2106. if(window.getComputedStyle(f[n]).visibility != "hidden" && f[n].offsetWidth != 0 && f[n].value.indexOf("eply") == -1 && f[n].value.indexOf("Log") == -1)
  2107. {
  2108. f[n].removeAttribute("disabled");
  2109. f[n].click();
  2110. i = 1;
  2111. return;
  2112. }
  2113. }
  2114. }
  2115. i = q('img[onload*="scale"]');
  2116. break;
  2117. case "crownimg.com":
  2118. i = q('button');
  2119. dp=true;
  2120. j =true;
  2121. if(i)
  2122. {
  2123. i.click();
  2124. break;
  2125. }
  2126. case "myimg.club":
  2127. case "imgmonkey.com":
  2128. case "imgdragon.com":
  2129. case "imggold.org":
  2130. case "levinpic.org":
  2131. case "imgtown.net":
  2132. case "pixs.cx":
  2133. case "kropic.com":
  2134. case "outletpic.com":
  2135. case "pictwn.com":
  2136. case "meetimgz.com":
  2137. j = true;
  2138. dp=true;
  2139. f = document.querySelectorAll("input[type='submit']");
  2140. if(f.length)
  2141. {
  2142. let n;
  2143. for(n=f.length-1; n >= 0; n--)
  2144. {
  2145. if(window.getComputedStyle(f[n]).visibility != "hidden" && f[n].offsetWidth != 0 && f[n].value.indexOf("eply") == -1 && f[n].value.indexOf("Log") == -1)
  2146. {
  2147. //f[n].removeAttribute("disabled"); ok, let's wait
  2148. f[n].click();
  2149. break;
  2150. }
  2151. }
  2152. }
  2153. case "casimages.com":
  2154. case "thebestpichost.com":
  2155. case "ifotos.pl":
  2156. case "subeimagenes.com":
  2157. case "lostpix.com":
  2158. case "vvcap.com":
  2159. case "imgtrex.com":
  2160. case "pic-upload.de":
  2161. case "picusha.net":
  2162. i = q('img[src*="/img/"]');
  2163. break;
  2164. case "imagenetz.de":
  2165. i = q('img[src*="/img"]');
  2166. break;
  2167. case "picatom.com":
  2168. i = q('img[src*="img/"]');
  2169. break;
  2170. case "imgking.xyz":
  2171. case "imgazure.com":
  2172. i = q('img[src*="/img/"]');
  2173. if(i){i.src = i.src.replace('p.', '.');}
  2174. break;
  2175. case "imgbabes.com":
  2176. case "imgflare.com":
  2177. i = q('input[type="submit"]');
  2178. dp=true;
  2179. j=true;
  2180. if(i)
  2181. {
  2182. i.click();
  2183. i=null;
  2184. }
  2185. else
  2186. {
  2187. i = q('img[src*="i.php?"]');
  2188. }
  2189. break;
  2190. case "xxxhost.me":
  2191. case "bilder-hochladen.net":
  2192. case "dumpt.com":
  2193. case "imgsin.com":
  2194. case "loaditup.de":
  2195. case "123poze.3x.ro":
  2196. case "thaisharing.online.fr":
  2197. case "filefap.com":
  2198. case "imgswift.com":
  2199. case "1pic.org":
  2200. i = q('img[src*="/files/"]');
  2201. break;
  2202. case "image18.org":
  2203. i = q('img[src*="/file"]');
  2204. break;
  2205. case "picstate.com":
  2206. i = q('#image_container a img');
  2207. break;
  2208. case "zimagez.com":
  2209. i = q('img[src*="/full/"]');
  2210. break;
  2211. case "niceimage.pl":
  2212. i = q('img[src*="/uploaded/"]');
  2213. break;
  2214. case "imagefap.com":
  2215. j = true;
  2216. //find_text_in_scripts('"contentUrl": "', '"');
  2217. i = q('#slideshow img[src*="/full/"],#video-html5_html5_api');
  2218. break;
  2219. case "olivepix.com":
  2220. i = q('img[src*="view/"]');
  2221. break;
  2222. case "imgkings.com":
  2223. i = q('img[src*="uploads/"]');
  2224. if(i) break;
  2225. if(find_text_in_scripts('linkid="', '"', false))
  2226. {
  2227. window.location.href = i.src;
  2228. break;
  2229. }
  2230. else if(window.location.href.indexOf("imgs") != -1) // not sure if needed anymore
  2231. {
  2232. window.location.href = window.location.href.replace("imgs","imgv");
  2233. break;
  2234. }
  2235. else if(window.location.href.indexOf("img3") != -1) // not sure if needed anymore
  2236. {
  2237. window.location.href = window.location.href.replace("img3","img4");
  2238. break;
  2239. }
  2240. break;
  2241. case "imgadult.com":
  2242. j = true;
  2243. i = q('a.overlay_ad_link');
  2244. if(i)
  2245. {
  2246. i.click();
  2247. break;
  2248. }
  2249. case "imagefolks.com":
  2250. case "imgcandy.net":
  2251. case "imageteam.org":
  2252. case "imgnext.com":
  2253. case "hosturimage.com":
  2254. case "pixup.us":
  2255. case "xximg.net":
  2256. case "x.xximg.net":
  2257. case "sxpics.nl":
  2258. case "sxpix.nl":
  2259. case "img.yt":
  2260. case "xxxscreens.com":
  2261. case "i.sxpics.nl":
  2262. case "imageon.org":
  2263. case "nimplus.com":
  2264. case "imag.nimplus.com":
  2265. case "newimagepost.com":
  2266. case "fapat.me":
  2267. case "imgbe.com":
  2268. case "fireimg.cc":
  2269. case "rapidimg.net":
  2270. case "imgtornado.com":
  2271. case "erimge.com":
  2272. case "loftlm.ru":
  2273. case "tinizo.com":
  2274. case "imgpix.net":
  2275. case "freeimagehostin.com":
  2276. case "sximg.nl":
  2277. case "freephotohostin.com":
  2278. case "imgpics.nl":
  2279. case "imagepics.xyz":
  2280. case "imgwo.com":
  2281. case "ima.gy":
  2282. case "picz.site":
  2283. case "allxpix.com":
  2284. case "imgblank.com":
  2285. case "xeimg.yt":
  2286. case "imgmain.com":
  2287. case "acidimg.cc":
  2288. case "imgpart.com":
  2289. case "picmoza.com":
  2290. case "imgjazz.xyz":
  2291. case "picshost.info":
  2292. case "petrovixxxjav.com":
  2293. case "placeimg.net":
  2294. case "imageshtorm.com":
  2295. case "blameless.work":
  2296. case "xxx.kodiak.top":
  2297. case "xaoutchouc.live":
  2298. case "mshelxxx.ru.com":
  2299. case "trans.firm.in":
  2300. case "xxxwebdlxxx.top":
  2301. case "imgdawgknuttz.com":
  2302. case "olarixas.xyz":
  2303. case "pornhd720p.com":
  2304. dp=true;
  2305. f = document.getElementsByTagName("input");
  2306. if(f.length)
  2307. {
  2308. f[f.length-1].removeAttribute("disabled");
  2309. f[f.length-1].click();
  2310. }
  2311. case "fotoszok.pl":
  2312. case "damimage.com":
  2313. case "adultur.com":
  2314. case "imagedecode.com":
  2315. case "gogoimage.org":
  2316. case "imageblinks.com":
  2317. case "imglooks.com":
  2318. case "ocaload.com":
  2319. case "imgstudio.org":
  2320. case "goimge.com":
  2321. case "imageho.me":
  2322. case "imgor.net":
  2323. case "icezap.com":
  2324. case "imgtrial.com":
  2325. case "dimtus.com":
  2326. case "imgcat.pw":
  2327. case "imgseed.com":
  2328. case "imgcredit.xyz":
  2329. case "pic.hotimg.site":
  2330. case "xfap.fun":
  2331. case "xxxwebdlxxx.org":
  2332. i = q('img[src*="' + iurl + '/upload/"]');
  2333. break;
  2334. case "imgboom.net":
  2335. if(window.location.href.indexOf("img-") != -1)
  2336. {
  2337. window.location.href = "http://imgboom.net/view.php";
  2338. break;
  2339. }
  2340. case "thumbnailus.com":
  2341. case "imgleveret.com":
  2342. case "porn84.org":
  2343. i = q('input[type="submit"]');
  2344. dp=true;
  2345. if(i)
  2346. {
  2347. i.click();
  2348. break;
  2349. }
  2350. i = q('img[src*="' + iurl + '/upload/"].centred');
  2351. break;
  2352. case "imgking.co":
  2353. if(window.location.href.indexOf("img-") != -1)
  2354. {
  2355. window.location.href = window.location.href.replace("img-","img2-");
  2356. break;
  2357. }
  2358. i = q('img[src*="' + iurl + '/upload/"]');
  2359. break;
  2360. case "imgsky.net":
  2361. case "imgsee.net":
  2362. case "imgzong.xyz":
  2363. case "imageking.xyz":
  2364. case "imgxx.xyz":
  2365. case "imgao.xyz":
  2366. case "imgweng.xyz":
  2367. case "imgkes.xyz":
  2368. case "imgkoi.xyz":
  2369. case "imglin.xyz":
  2370. case "imgkr.xyz":
  2371. case "imgbird.xyz":
  2372. case "imgwewo.xyz":
  2373. case "imgirx.xyz":
  2374. case "imgalor.xyz":
  2375. case "imgjut.buzz":
  2376. case "imgtrw.buzz":
  2377. case "imglina.xyz":
  2378. case "imgkuiw.xyz":
  2379. case "imgwang.buzz":
  2380. case "imgmeno.buzz":
  2381. case "imgpekele.buzz":
  2382. case "imglqw.buzz":
  2383. case "imgyng.buzz":
  2384. case "imgbbd.buzz":
  2385. case "imgwia.buzz":
  2386. case "imgowk.buzz":
  2387. case "imgokr.buzz":
  2388. case "imgoiu.buzz":
  2389. case "imgeza.buzz":
  2390. case "mrlzqoe.buzz":
  2391. case "imgutkr.store":
  2392. case "imghhr.online":
  2393. case "imglaiw.store":
  2394. case "imgvue.online":
  2395. case "imgxgf.store":
  2396. case "imgbibam.online":
  2397. case "imgqaz.online":
  2398. case "imgurt.online":
  2399. case "imgwxr.online":
  2400. case "imgyre.online":
  2401. case "picqaxs.cfd":
  2402. case "picvvvd.sbs":
  2403. i = q('button');
  2404. dp=true;
  2405. j = true;
  2406. if(i)
  2407. {
  2408. i.click();
  2409. }
  2410. i = q('.big_img_box img[src*="http"]');
  2411. break;
  2412. case "picspornfree.me":
  2413. case "hotimage.uk":
  2414. case "xxxwebdlxxx.org":
  2415. case "hdmoza.com":
  2416. i = q('input[type="submit"]');
  2417. dp=true;
  2418. if(i)
  2419. {
  2420. i.click();
  2421. break;
  2422. }
  2423. case "avenuexxx.com":
  2424. case "uploadimagex.com":
  2425. case "hostingkartinok.com":
  2426. case "bellazon":
  2427. case "savepice.ru":
  2428. i = q('img[src*="/upload"]');
  2429. break;
  2430. case "imgseeds.com":
  2431. i = q('input');
  2432. if(i)
  2433. {
  2434. i.click();
  2435. break;
  2436. }
  2437. case "imghit.com":
  2438. i = q('img[alt="image"]');
  2439. break;
  2440. case "image-share.com":
  2441. i = q('img[src*="upload/"]');
  2442. break;
  2443. case "bilder-upload.eu":
  2444. i = q('input[src*="upload/"]');
  2445. break;
  2446. case "picload.org":
  2447. case "imagecross.com":
  2448. case "npicture.net":
  2449. case "public-pic.de":
  2450. case "picbug.ru":
  2451. i = q('img[src*="' + iurl + '/image"]');
  2452. break;
  2453. case "yande.re":
  2454. case "konachan.com":
  2455. case "konachan.net":
  2456. i = q('a[href*="' + iurl + '/image"]');
  2457. if(i){i.src = i.href;}
  2458. break;
  2459. case "imagesup.net":
  2460. i = q('a[href*="/di-"]');
  2461. if(i)
  2462. {
  2463. i.src = i.href;
  2464. }
  2465. break;
  2466. case "cyberpics.net":
  2467. case "fastimages.ru":
  2468. case "hot-file.org":
  2469. case "image.siroro.co.uk":
  2470. case "qattach.com":
  2471. case "fotohelp.kz":
  2472. case "pic-you.com":
  2473. i = q('a[href*="/di/"]');
  2474. if(i)
  2475. {
  2476. i.src = i.href;
  2477. }
  2478. break;
  2479. case "imagehost.thasnasty.com":
  2480. case "oxily.com":
  2481. case "ghanaimages.co":
  2482. case "knecht.novarata.net":
  2483. case "img.irandeliver.com":
  2484. case "xferz.com":
  2485. case "up.kfesfahan.com":
  2486. case "upload.khontai.com":
  2487. case "image.pantyhosemania.info":
  2488. case "t.hogor.net":
  2489. case "your-pictures.net":
  2490. i = q('a[href*="?di="]');
  2491. if(i)
  2492. {
  2493. i.src = i.href;
  2494. }
  2495. break;
  2496. case "pixxxels.org":
  2497. case "postimg.org":
  2498. case "postimg.cc":
  2499. case "pixxxels.cc":
  2500. j = true;
  2501. i = q('a[href*="?dl="]');
  2502. if(i)
  2503. {
  2504. i.src = i.href;
  2505. }
  2506. break;
  2507. case "zimage.fr":
  2508. i = q('img[src*="images.php"]');
  2509. if(i)
  2510. {
  2511. i.src = i.src.replace('.php?nom=', '/');
  2512. break;
  2513. }
  2514. case "dumppix.com":
  2515. i = q('a[href*="enter"]');
  2516. if(i)
  2517. {
  2518. window.location.href = i.href;
  2519. break;
  2520. }
  2521. case "mrjh.org":
  2522. case "stuffed.ru":
  2523. case "rapid-img.de":
  2524. case "ngarko.online.fr":
  2525. case "freeuploadimages.org":
  2526. case "picszone.net":
  2527. case "images.share-films.net":
  2528. case "bildjunkies.de":
  2529. case "foto.hcfor.pl":
  2530. case "pic.tooptarinha.com":
  2531. case "poopr.org":
  2532. case "xp-images.hi2.ro":
  2533. case "dayzeddesigns.com":
  2534. case "freeimghosting.co.uk":
  2535. case "upload.removed.us":
  2536. case "imghost.pl":
  2537. case "udostepniaj.pl":
  2538. case "ngarko.free.fr":
  2539. case "images.collectiontricks.it":
  2540. case "244pix.com":
  2541. case "imgboxxx.com":
  2542. case "imghere.net":
  2543. case "imgdope.com":
  2544. case "hostmat.eu":
  2545. case "imgdream.net":
  2546. case "imgcentral.com":
  2547. i = q('img[src*="images/"]');
  2548. break;
  2549. case "use.com":
  2550. i = q('img[src*="images/"][onload]');
  2551. if(i){i.src = i.src.replace('/s_2/', '/s_5/');}
  2552. break;
  2553. case "1y9y.com":
  2554. case "host4images.com":
  2555. case "aveimage.com":
  2556. i = q('img#photo');
  2557. break;
  2558. case "freeimgup.com":
  2559. case "picturevip.com":
  2560. case "image-load.net":
  2561. case "upload.djmaster.fr":
  2562. case "b4he.com":
  2563. case "firepic.org":
  2564. case "overdream.cz":
  2565. case "fastpics.net":
  2566. case "ii4.ru":
  2567. case "picuploader.de":
  2568. case "smages.com":
  2569. case "pictureshack.ru":
  2570. case "imgbox.de":
  2571. case "imagehosting.cz":
  2572. case "9foto.ru":
  2573. case "imagesloading.altervista.org":
  2574. case "phpbbmods.it":
  2575. case "lakhdaria.net":
  2576. case "partizansk.eu":
  2577. case "webjardiner.com":
  2578. case "imgup.com":
  2579. case "iezz.com":
  2580. case "picturescream.com":
  2581. case "all-poster.ru":
  2582. case "extraimage.net":
  2583. case "imagexxx18.com":
  2584. case "imgvisits.com":
  2585. case "imghall.com":
  2586. case "picturedent.org":
  2587. i = q('img[src*="/images/"]');
  2588. break;
  2589. case "intergranada.com":
  2590. i = q('img[src*="/images/images/"]');
  2591. break;
  2592. case "pixelup.net":
  2593. i = q('center img[src*="/images/"]');
  2594. break;
  2595. case "saveimg.ru":
  2596. case "imglink.ru":
  2597. case "4put.ru":
  2598. case "sharepic.biz":
  2599. case "you-logo.ru":
  2600. case "powerlogo.ru":
  2601. i = q('img[src*="pictures/"]');
  2602. break;
  2603. case "xenopix.com":
  2604. i = q('img[src*="/pix/"]');
  2605. break;
  2606. case "chronos.to":
  2607. case "imgmaid.net":
  2608. case "pic-maniac.com":
  2609. case "coreimg.net":
  2610. case "imx.to":
  2611. j = true;
  2612. i = q('input[type="submit"]');
  2613. dp=true;
  2614. if(i)
  2615. {
  2616. i.click();
  2617. break;
  2618. }
  2619. case "imgspice.com":
  2620. case "imagetwist.com":
  2621. case "dev.imagetwist.com":
  2622. case "imagexport.com":
  2623. case "pixroute.com":
  2624. case "pzy.be":
  2625. case "funkyimg.com":
  2626. case "itmages.ru":
  2627. case "imagenpic.com":
  2628. case "turbopix.fr":
  2629. case "pictureturn.com":
  2630. case "pixic.ru":
  2631. case "nyanimg.com":
  2632. case "geekpics.in":
  2633. case "imageporter.com":
  2634. case "imagenimage.com":
  2635. case "imageshimage.com":
  2636. case "imagedax.net":
  2637. case "pornimagex.com":
  2638. case "sendpic.org":
  2639. case "imagehaha.com":
  2640. case "picshick.com":
  2641. case "photo-screen.ru":
  2642. i = q('img[src*="/i/"]');
  2643. break;
  2644. case "imguniversal.com":
  2645. case "imgclick.net": // no submits
  2646. case "imgsto.com":
  2647. case "fappic.com":
  2648. case "imgsen.com":
  2649. case "premalo.com":
  2650. case "picdollar.com":
  2651. case "fotokiz.com":
  2652. case "silverpic.com":
  2653. case "pics4upload.com":
  2654. case "imgstar.eu":
  2655. i = q("form input[type='submit'][value*='continue to image' i]");
  2656. dp = true;
  2657. if(i)
  2658. {
  2659. i.click();
  2660. }
  2661. i = q("img.pic[src*='/i/'], img.pic[src*='/img/']");
  2662. break;
  2663. case "scrin.org":
  2664. i = q('a[href*="/i/"]');
  2665. if(i)
  2666. {
  2667. i.src = i.href;
  2668. break;
  2669. }
  2670. i = q('img[src*="/i/"]');
  2671. break;
  2672. case "miragepics.com":
  2673. i = q('input[value*="' + iurl + '/images/"]');
  2674. if(i){i.src = i.value;}
  2675. break;
  2676. case "ipic.su":
  2677. i = q('input[value*="' + iurl + ' img/"]');
  2678. if(i){i.src = i.value;}
  2679. break;
  2680. case "mixbase.net":
  2681. i = q('img[src*="media/storage/"]');
  2682. break;
  2683. case "image2you.ru":
  2684. i = q('img[src*="images/"]');
  2685. if(i){i.src = i.src.replace('2_', '');}
  2686. break;
  2687. case "imgmade.com":
  2688. i = q('form');
  2689. dp=true;
  2690. if(i)
  2691. {
  2692. i.submit();
  2693. break;
  2694. }
  2695. case "imgdrive.net":
  2696. case "imgtaxi.com":
  2697. case "imgwallet.com":
  2698. j = true;
  2699. i = q("a.overlay_ad_link");
  2700. if(i)
  2701. {
  2702. i.click();
  2703. break;
  2704. }
  2705. case "pixhost.to":
  2706. case "imgtiger.com":
  2707. case "imgserve.net":
  2708. case "imgdino.com":
  2709. case "overpic.net":
  2710. case "imagesocket.com":
  2711. case "hostpic.org":
  2712. case "zapodaj.net":
  2713. case "jpegshare.net":
  2714. case "screenshot.ru":
  2715. case "imagefile.org":
  2716. case "zapisz.net":
  2717. case "addyourpics.com":
  2718. case "imgbank.cz":
  2719. case "showmyimage.com":
  2720. case "upload.supreme-elite.fr":
  2721. case "myimg.me":
  2722. case "heberg-hush.org":
  2723. case "oltaciyukle.com":
  2724. case "pichost.name":
  2725. case "imagend.com":
  2726. case "imagerocket.com":
  2727. case "hyyathost.com":
  2728. case "images.reptilescanada.com":
  2729. case "wepic.ru":
  2730. case "upload-image.fr":
  2731. case "images.baconbits.org":
  2732. case "upanh.ovo.vn":
  2733. case "wrzucaj.net":
  2734. case "heberge-images.com":
  2735. case "image.kg":
  2736. case "savemyimage.com":
  2737. case "img.dramacafe.tv":
  2738. case "fapping.empornium.sx":
  2739. case "beeimg.com":
  2740. case "youpicture.org":
  2741. case "vavvi.com":
  2742. case "imgzap.com":
  2743. case "crazyimg.com":
  2744. case "extraimago.com":
  2745. case "ftop.ru":
  2746. case "porncomix.info":
  2747. case "luxpic.ru":
  2748. case "passpix.com":
  2749. case "trumbhost.com":
  2750. //Chevereto 2.x
  2751. i = q('img[src*="' + iurl + '/images/"]');
  2752. break;
  2753. case "shareimages.com":
  2754. case "imagesmax.de":
  2755. case "bilder.nixhelp.de":
  2756. i = q('img[src*="' + iurl + '/images"]');
  2757. break;
  2758. case "imgfantasy.com":
  2759. case "imageporn.eu":
  2760. case "imgsmile.com":
  2761. case "imgsay.com":
  2762. case "0img.net":
  2763. case "imagedisco.net":
  2764. //IMGReserve
  2765. j = true;
  2766. dp=true;
  2767. i = q('input[value="YES"]');
  2768. if(i){i.onclick();break;}
  2769. case "pic-upload.de":
  2770. case "shrani.najdi.si":
  2771. case "imageab.com":
  2772. case "turboimagehost.com":
  2773. i = q('img[onclick*="(this"]');
  2774. break;
  2775. case "joblo.com":
  2776. i = q('img');
  2777. if(i)
  2778. {
  2779. i.src = "http://www.joblo.com/moviehotties/images/profile-gallery/orig" + window.location.href.substr(window.location.href.lastIndexOf("/"));
  2780. }
  2781. break;
  2782. case "img.folluo.me":
  2783. case "sizzlingclicks.com":
  2784. case "imgsha.com":
  2785. i = q('img[data-load="full"]');
  2786. break;
  2787. case "yapx.ru":
  2788. j = true;
  2789. if(q("footer"))
  2790. {
  2791. f = document.body.querySelectorAll("[data-gallery-index]");
  2792. if(f.length === 1)
  2793. {
  2794. //i = f[0];
  2795. i = document.head.querySelector('meta[property="og:image:secure_url"]');
  2796. if(i)
  2797. {
  2798. i.src = i.content;
  2799. }
  2800. }
  2801. else
  2802. {
  2803. is_gallery = true;
  2804. }
  2805. }
  2806. break;
  2807. case "vfl.ru":
  2808. i = q('img[src*="/ii/"]');
  2809. break;
  2810. case "suckmypic.net":
  2811. i = q('#theImage');
  2812. break;
  2813. case "piccy.info":
  2814. i = q('a[href*="/orig/"]');
  2815. if(i){i.click();return;}
  2816. else{i = q('img#mainim');}
  2817. break;
  2818. case "t.me":
  2819. case "telegram.me":
  2820. j = true;
  2821. if(document.querySelector("body.body_widget_post"))
  2822. {
  2823. f = document.querySelectorAll('.tgme_widget_message_photo_wrap[style*="/file/"]');
  2824. if(f.length === 1)
  2825. {
  2826. i = f[0];
  2827. i.src = i.style.backgroundImage.slice(4, -1).replace(/"/g, "");
  2828. if(window.self !== window.top)
  2829. {
  2830. window.top.location.href = window.self.location.href;
  2831. }
  2832. }
  2833. }
  2834. break;
  2835. case "comment-cdn.9gag.com":
  2836. i = q('img');
  2837. if(i) {i.src = window.location.hash.substring(1,window.location.hash.length);}
  2838. break;
  2839. case "xhamster.com":
  2840. case "xhamster.desi":
  2841. case "xhamster3.com":
  2842. case "xhamster4.com":
  2843. case "xhamster11.com":
  2844. case "xhamster19.com":
  2845. j = true;
  2846. i = q('div.fotorama__active>img.fotorama__img');
  2847. break;
  2848. case "imgtorrnt.in":
  2849. window.location.replace("https://i.imgur.com/" + window.location.href.substr(window.location.href.lastIndexOf('=') + 1));
  2850. case "trans.firm.in":
  2851. if(window.location.href.search(/\.(?:jpe?g|png|gif|webp)\.html$/i) != -1)//check whether it's a valid image url
  2852. {
  2853. i = { src : window.location.href.replace(".html", "") };
  2854. }
  2855. case "vipr.im":
  2856. j = true;
  2857. i = q("a.ddownloader[download]");
  2858. if(i)
  2859. {
  2860. i.src = i.href;
  2861. break;
  2862. }
  2863. break;
  2864. default: // dynamic subdomain
  2865. switch(host.substr(host.indexOf(".")+1))
  2866. {
  2867. case "xhamster.com":
  2868. case "xhamster.desi":
  2869. case "xhamster3.com":
  2870. case "xhamster4.com":
  2871. case "xhamster11.com":
  2872. case "xhamster19.com":
  2873. j = true;
  2874. i = q('div.fotorama__active>img.fotorama__img');
  2875. break;
  2876. case "tumblr.com":
  2877. case "media.tumblr.com":
  2878. f = document.head.querySelectorAll('meta[property="og:image"]');
  2879. if(f.length === 1)
  2880. {
  2881. i = document.head.querySelector('meta[property="og:video"]');
  2882. if(!i)
  2883. {
  2884. i = f[0];
  2885. i.src = f[0].content;
  2886. }
  2887. else
  2888. {
  2889. i.src = i.content;
  2890. }
  2891. }
  2892. else if(f.length > 1)
  2893. {
  2894. is_gallery = true;
  2895. }
  2896. else
  2897. {
  2898. i = document.querySelector('div#base-container > div > div > div > div > img');
  2899. }
  2900. break;
  2901. case "wikipedia.org":
  2902. case "wikimedia.org":
  2903. i = q('a[href*="/upload"]');
  2904. if(i){i.src = i.href;}
  2905. break;
  2906. case "imgcredit.xyz":
  2907. i = q('img[src*="/upload/"]');
  2908. break;
  2909. case "photobucket.com":
  2910. find_text_in_scripts('originalUrl":"', '"');
  2911. break;
  2912. case "lostpic.net":
  2913. //chevereto 3.x
  2914. i = document.head.querySelector('link[rel="image_src"]');
  2915. if(i)
  2916. {
  2917. i.src = i.href;
  2918. }
  2919. break;
  2920. case "freeamateurteens.net":
  2921. i = q('img[src*="images/"]');
  2922. break;
  2923. case "otofotki.pl":
  2924. i = q('img[src*="/obrazki/"]');
  2925. break;
  2926. case "tinypic.com":
  2927. i = q('img#imgElement');
  2928. break;
  2929. case "imagilive.com":
  2930. i = q('a.button');
  2931. if(i)
  2932. {
  2933. dp=true;
  2934. i.click();
  2935. break;
  2936. }
  2937. i = q('img[src*="' + iurl + '"]');
  2938. break;
  2939. default: // for user-added sites
  2940. j = true;
  2941. console.warn("HJI is running on a custom website");
  2942.  
  2943. if(document.readyState !== "loading") // DOM loaded
  2944. {
  2945. f = document.querySelectorAll("img");
  2946. if(f.length !== 0)
  2947. {
  2948. let b = 0;
  2949. for(let n = 0; n < f.length; n++)
  2950. {
  2951. if(f[n].naturalWidth == 0 && !f[n].complete) // not yet loaded
  2952. {
  2953. if(timeout < 4000)
  2954. {
  2955. console.warn("waiting for this image to start loading to see its size and compare with others: ", f[n]);
  2956. b = -1;
  2957. break;
  2958. }
  2959. else // waited for 3+ sec, that's enough
  2960. {
  2961. console.warn("skipping broken images");
  2962. continue; // skip the broken image
  2963. }
  2964. }
  2965. else if(f[n].naturalWidth * f[n].naturalHeight >= f[b].naturalWidth * f[b].naturalHeight)
  2966. {
  2967. b = n;
  2968. }
  2969. }
  2970. if(b !== -1){i = f[b]; console.warn("showing biggest image");}
  2971. }
  2972. }
  2973. break;
  2974. }
  2975. break;
  2976. }
  2977. //
  2978. //firefox handmade noscript
  2979. if(!j)
  2980. {
  2981. j = true;
  2982. window.addEventListener('beforescriptexecute', onscript, true); // useless, but let it be
  2983. bStopScripts = true; // actually better than the event above, blocks more stuff for some reason
  2984. }
  2985. //
  2986. if(tb){window.clearTimeout(tb);}
  2987. if(is_gallery)
  2988. {
  2989. console.log("Handy Image: userscript stopped itself INTENTIONALLY, - cuz it is not just a single image on the page to fullsize but a gallery");
  2990. observer.disconnect();
  2991. return;
  2992. }
  2993. if(i && i.src)
  2994. {
  2995. bStopScripts = true; // in case JS was allowed before
  2996. observer.disconnect();
  2997. function clr_pgn()
  2998. {
  2999. unsafeWindow.open = null;
  3000. unsafeWindow.onload = null;
  3001. unsafeWindow.onbeforeunload = null;
  3002. document.replaceChild(document.importNode(document.implementation.createHTMLDocument("").documentElement, true), document.documentElement);
  3003. unsafeWindow.document.createElement = unsafeWindow.console.debug;
  3004. document.head.innerHTML = '<meta name="referrer" content="'+referrer_policy+'">';
  3005. }
  3006. if (i.nodeName === "VIDEO" || ext_list_video.indexOf(i.src.split('.').pop().split('?')[0].toLowerCase()) >= 0)
  3007. {
  3008. console.log("Found a video");
  3009. is_video = true;
  3010. }
  3011. else if (ext_list_not_image.indexOf(i.src.split('.').pop().split('?')[0].toLowerCase()) >= 0)
  3012. {
  3013. console.warn("What we found is not an image or a video");
  3014. i = null;
  3015. return false;
  3016. }
  3017. ws();
  3018. sanitize();
  3019. clr_pgn();
  3020. window.removeEventListener('beforescriptexecute', onscript, true);
  3021. makeimage();
  3022. }
  3023. else // try again
  3024. {
  3025. //console.warn("Didnt find image, trying again in " + timeout + " ms");
  3026. tb = window.setTimeout(function() { console.warn("Didnt find image, waited " + timeout + " ms to try again. page: " + window.location.href); tb=0; timeout*=2; i=0; makeworld(); }, timeout);
  3027. }
  3028. }
  3029.  
  3030. var grab_fav_tags = []; // set in Custom JS
  3031. function use_booru_tags_in_dl_filename()
  3032. {
  3033. let artist = document.querySelectorAll(".tag-type-artist a:not([href*='/books?'])[href*='tags='], .artist-tag > a, a.search-tag[itemprop='author'], a.model, .user-info-box .username > a");
  3034. for(let n = 0; n < artist.length; n++)
  3035. {
  3036. if(artist[n].text == "?") continue;
  3037. filename = "by " + artist[n].text.replaceAll(" ", "_") + " " + filename;
  3038. }
  3039.  
  3040. let character = document.querySelectorAll(".tag-type-character a:not([href*='/books?'])[href*='tags='], .character-tag > a, .character-tag-list a.search-tag, a.character");
  3041. for(let n = 0; n < character.length; n++)
  3042. {
  3043. if(character[n].text == "?") continue;
  3044. filename = character[n].text.replaceAll(" ", "_") + " " + filename;
  3045. }
  3046.  
  3047. /*if(character.length === 0)
  3048. {
  3049. let franchise = document.querySelectorAll(".tag-type-copyright > a, .copyright-tag > a, .copyright-tag-list a.search-tag");
  3050. for(let n = 0; n < franchise.length; n++)
  3051. {
  3052. if(franchise[n].text == "?") continue;
  3053. filename = franchise[n].text.replaceAll(" ", "_") + " " + filename;
  3054. break; // just one cuz else it'd get long
  3055. }
  3056. }*/
  3057. let general_tags = document.querySelectorAll(".tag-type-general a:not([href*='/books?'])[href*='tags='], .tag-type-genre > a, .general-tag > a, .general-tag-list > .tag-type-0 > a.search-tag, a.search-tag, div#tagLink > a,.tags-list a");
  3058.  
  3059. function do_grab_fav_tags()
  3060. {
  3061. if(typeof cfg_js !== "string")
  3062. {
  3063. console.log("waiting for async setting loading of cfg_js: " + (typeof cfg_js));
  3064. tg = window.setTimeout(do_grab_fav_tags, 2);
  3065. return;
  3066. }
  3067. if(cfg_js && cfg_js.indexOf("grab_fav_tags") != -1) {grab_fav_tags = cfg_js.substring(cfg_js.indexOf("[")+1,cfg_js.indexOf("]")).replaceAll(" ", "").replaceAll("_", " ").replaceAll(/\n/g, '').replaceAll("'", "").replaceAll('"','').split(",");} // load custom tags // also bypass CSP
  3068. console.debug("your favorite tags: "+ grab_fav_tags);
  3069. if(grab_fav_tags.length)
  3070. {
  3071. for(let n = 0; n < general_tags.length; n++)
  3072. {
  3073. if(general_tags[n].text == "?") continue;
  3074. if(grab_fav_tags.indexOf(general_tags[n].text.replaceAll("_", " ")) != -1)
  3075. {
  3076. filename = general_tags[n].text.replaceAll(" ", "_") + " " +filename;
  3077. }
  3078. }
  3079. }
  3080. filename = filename.replaceAll("_(", " ("); // but not the space before franchise
  3081. }
  3082. do_grab_fav_tags();
  3083. }
  3084.  
  3085. function onvolumechange()
  3086. {
  3087. GM.setValue("vid_volume", (i.muted? "0" : i.volume));
  3088. }
  3089.  
  3090. function changeCursor()
  3091. {
  3092. if(i.scrollHeight > window.innerHeight) // image pushing out-of-screen browser bug fix
  3093. {
  3094. i.style.margin = "0px auto";
  3095. }
  3096. else
  3097. {
  3098. i.style.margin = "auto";
  3099. }
  3100.  
  3101. if(is_video) return;
  3102.  
  3103. if(rescaled === 0) // original
  3104. {
  3105. if((orgImgWidth == window.innerWidth && orgImgHeight <= window.innerHeight) || (orgImgWidth <= window.innerWidth && orgImgHeight == window.innerHeight)) // perfect fit on one side, can't resize
  3106. {
  3107. i.style.cursor = "";
  3108. }
  3109. else if (orgImgWidth > window.innerWidth || orgImgHeight > window.innerHeight)
  3110. {
  3111. i.style.cursor = "zoom-out";
  3112. }
  3113. else
  3114. {
  3115. i.style.cursor = "zoom-in";
  3116. }
  3117. }
  3118. else if(rescaled === 2) // fill
  3119. {
  3120. if(orgImgWidth == window.innerWidth && orgImgHeight == window.innerHeight) // perfect fit, can't resize
  3121. {
  3122. i.style.cursor = "";
  3123. }
  3124. else if (orgImgWidth > i.width)
  3125. {
  3126. i.style.cursor = "zoom-in";
  3127. }
  3128. else
  3129. {
  3130. i.style.cursor = "zoom-out";
  3131. }
  3132. }
  3133. else // if(rescaled === 1) // fit
  3134. {
  3135. if((orgImgWidth == window.innerWidth && orgImgHeight <= window.innerHeight) || (orgImgWidth <= window.innerWidth && orgImgHeight == window.innerHeight)) // perfect fit on one side, can't resize
  3136. {
  3137. i.style.cursor = "";
  3138. }
  3139. else if (orgImgWidth > i.width)
  3140. {
  3141. i.style.cursor = "zoom-in";
  3142. }
  3143. else
  3144. {
  3145. i.style.cursor = "zoom-out";
  3146. }
  3147. }
  3148. }
  3149.  
  3150. function mousedown(event) // chrome scroll-wheel
  3151. {
  3152. if(event.which === 2) // middle mouse
  3153. {
  3154. event.preventDefault();
  3155. event.stopImmediatePropagation();
  3156. return;
  3157. }
  3158. }
  3159.  
  3160. function rescale(event, fill)
  3161. {
  3162. let ex,ey;
  3163. if(event) // mouse click
  3164. {
  3165. if (typeof event.y === "undefined") // Firefox
  3166. {
  3167. ex = event.clientX;
  3168. ey = event.clientY;
  3169. }
  3170. else
  3171. {
  3172. ex = event.x;
  3173. ey = event.y;
  3174. }
  3175. ex -= i.offsetLeft;
  3176. ey -= i.offsetTop;
  3177. if(event.which === 2) // middle mouse
  3178. {
  3179. fill = true;
  3180. event.preventDefault();
  3181. event.stopImmediatePropagation();
  3182. }
  3183. else if(event.which === 3) // right mouse
  3184. {
  3185. return;
  3186. }
  3187. }
  3188.  
  3189. document.body.style.overflowX = '';
  3190. document.body.style.overflowY = '';
  3191.  
  3192. let scrollMax_Y = window.scrollMaxY || ((document.body.scrollHeight || document.documentElement.scrollHeight)- document.documentElement.clientHeight);
  3193. let scrollMax_X = window.scrollMaxX || ((document.body.scrollWidth || document.documentElement.scrollWidth)- document.documentElement.clientWidth);
  3194.  
  3195. let scrollProgressY = window.pageYOffset / scrollMax_Y;
  3196. let scrollProgressX = window.pageXOffset / scrollMax_X;
  3197.  
  3198. let unFilling = false;
  3199.  
  3200. let sidesCMP;
  3201. if(fill)
  3202. {
  3203. if(rescaled === 2) // to original
  3204. {
  3205. rescaled = 0;
  3206. i.style.width = orgImgWidth + "px";
  3207. i.style.height = orgImgHeight + "px";
  3208. }
  3209. else // fill
  3210. {
  3211. sidesCMP = (orgImgWidth / orgImgHeight) < (window.innerWidth / window.innerHeight);
  3212. rescaled = 2;
  3213. }
  3214. }
  3215. else
  3216. {
  3217. if(rescaled != 0) // to original
  3218. {
  3219. if(rescaled === 2) {unFilling = true;}
  3220. rescaled = 0;
  3221. i.style.width = orgImgWidth + "px";
  3222. i.style.height = orgImgHeight + "px";
  3223. }
  3224. else // fit
  3225. {
  3226. sidesCMP = (orgImgWidth / orgImgHeight) > (window.innerWidth / window.innerHeight);
  3227. rescaled = 1;
  3228. }
  3229. }
  3230.  
  3231. if(rescaled != 0)
  3232. {
  3233. if(sidesCMP)
  3234. {
  3235. i.style.width = "100%";
  3236. i.style.height = "auto";
  3237. document.body.style.overflowX = 'hidden'; // we don't need unscrollable scrollbars if they appear
  3238. }
  3239. else
  3240. {
  3241. i.style.height = "100%";
  3242. i.style.width = "auto";
  3243. document.body.style.overflowY = 'hidden'; // we don't need unscrollable scrollbars if they appear
  3244. }
  3245. }
  3246.  
  3247. changeCursor();
  3248.  
  3249. if(event && (!unFilling && (!fill || (fill && (!scrollMax_Y && !scrollMax_X))))) // left mouse click (fill-click with no scrollbars and not left click after middle click - else preserve scroll percentage)
  3250. {
  3251. let scale = Math.min((window.innerWidth / i.width), (window.innerHeight / i.height));
  3252. window.scrollTo((ex / scale) - (window.innerWidth / 2), (ey / scale) - (window.innerHeight / 2));
  3253. }
  3254. else // keep percentage scroll progress for KB hotkeys
  3255. {
  3256. scrollMax_Y = window.scrollMaxY || ((document.body.scrollHeight || document.documentElement.scrollHeight)- document.documentElement.clientHeight);
  3257. scrollMax_X = window.scrollMaxX || ((document.body.scrollWidth || document.documentElement.scrollWidth)- document.documentElement.clientWidth);
  3258.  
  3259. window.scrollTo(Math.round(scrollProgressX * scrollMax_X), Math.round(scrollProgressY * scrollMax_Y));
  3260. }
  3261. }
  3262.  
  3263. var ARC = 0;
  3264. function autoresize()
  3265. {
  3266. if((!is_video && i.naturalHeight) || i.videoHeight)
  3267. {
  3268. orgImgWidth = Math.round((is_video ? i.videoWidth : i.naturalWidth) / window.devicePixelRatio);
  3269. orgImgHeight = Math.round((is_video ? i.videoHeight : i.naturalHeight) / window.devicePixelRatio);
  3270. i.style.width = orgImgWidth + "px";
  3271. i.style.height = orgImgHeight + "px";
  3272. let title = i.src.substr(i.src.lastIndexOf("/")+1);
  3273. if(title.indexOf("?") != -1)
  3274. {
  3275. title = title.substr(0, title.indexOf("?"));
  3276. }
  3277. title = decodeURIComponent(title);
  3278. if(is_video)
  3279. {
  3280. document.title = title + " (" + i.videoWidth + "x" + i.videoHeight + ")";
  3281. }
  3282. else
  3283. {
  3284. document.title = title + " (" + i.naturalWidth + "x" + i.naturalHeight + ")";
  3285. }
  3286. if(filename && filename.lastIndexOf(" ") != filename.length-1) {filename += " ";}
  3287. if(filename_ext) {filename_ext = "." + filename_ext;}
  3288. filename = filename + title + filename_ext;
  3289. /*let link = protected_createElement('link');
  3290. link.rel = 'icon';
  3291. link.href = i.src;
  3292. document.head.appendChild(link);*/ // big lag in general from this feature
  3293. let InitRescale = false;
  3294. if(cfg_fitWH && orgImgHeight > window.innerHeight && orgImgWidth > window.innerWidth) // both scrollbars
  3295. {
  3296. InitRescale = true;
  3297. }
  3298. else if(cfg_fitB && (orgImgHeight > window.innerHeight || orgImgWidth > window.innerWidth)) // one scrollbar
  3299. {
  3300. InitRescale = true;
  3301. }
  3302. else if(cfg_fitS && orgImgHeight <= window.innerHeight && orgImgWidth <= window.innerWidth) // no scrollbars
  3303. {
  3304. InitRescale = true;
  3305. }
  3306. if(InitRescale)
  3307. {
  3308. rescale(null, cfg_fitOS ? true : false);
  3309. }
  3310. else
  3311. {
  3312. changeCursor();
  3313. }
  3314. bStopScripts = false; // should be safe now, right?
  3315. if(cfg_js){eval(cfg_js);}
  3316. }
  3317. else // no onloadstart event for images, sadge
  3318. {
  3319. ARC++;
  3320. if(ARC < 1000)
  3321. {
  3322. if(ARC == 75 || ARC == 300 || ARC == 999) // about 1sec, 5sec, 15sec
  3323. {
  3324. i.src = i.src; // lol fix
  3325. console.warn("HJI: Trying to reload the image, " + ARC);
  3326. }
  3327. window.setTimeout(autoresize, 10);
  3328. }
  3329. else
  3330. {
  3331. console.warn("HJI: Gave up trying to reload the image, it is broken");
  3332. }
  3333. }
  3334. }
  3335.  
  3336. var observer = new MutationObserver((mutations) => {
  3337.  
  3338. makeworld();
  3339.  
  3340. if(bStopScripts) // Chrome handmade NoScript
  3341. {
  3342. for (const m of mutations)
  3343. {
  3344. for (const n of m.addedNodes)
  3345. {
  3346. if(n.tagName === "SCRIPT")
  3347. {
  3348. //console.debug("HJI: Script was stopped from loading: ", n);
  3349. console.debug( "HJI: stopped 1 script from loading ");
  3350. n.textContent = "";
  3351. n.remove();
  3352. }
  3353. }
  3354. }
  3355. }
  3356. });
  3357. observer.observe(document, {subtree: true, childList: true});
  3358.  
  3359. // hotkeys
  3360. if (typeof KeyEvent === "undefined")
  3361. {
  3362. var KeyEvent = {
  3363. DOM_VK_SPACE: 32,
  3364. DOM_VK_LEFT: 37,
  3365. DOM_VK_UP: 38,
  3366. DOM_VK_RIGHT: 39,
  3367. DOM_VK_DOWN: 40,
  3368. DOM_VK_A: 65,
  3369. DOM_VK_D: 68,
  3370. DOM_VK_P: 80,
  3371. DOM_VK_Q: 81,
  3372. DOM_VK_R: 82,
  3373. DOM_VK_S: 83,
  3374. DOM_VK_W: 87,
  3375. DOM_VK_NUMPAD2: 98,
  3376. DOM_VK_NUMPAD4: 100,
  3377. DOM_VK_NUMPAD5: 101,
  3378. DOM_VK_NUMPAD6: 102,
  3379. DOM_VK_NUMPAD8: 104,
  3380. DOM_VK_F5: 116,
  3381. DOM_VK_TAB: 9,
  3382. DOM_VK_ENTER: 13
  3383. };
  3384. }
  3385.  
  3386. function cancelEvent(a)
  3387. {
  3388. a = a ? a : window.event;
  3389. if (a.stopPropagation)
  3390. {
  3391. a.stopPropagation();
  3392. }
  3393. if (a.stopImmediatePropagation)
  3394. {
  3395. a.stopImmediatePropagation();
  3396. }
  3397. if (a.preventDefault)
  3398. {
  3399. a.preventDefault();
  3400. }
  3401. a.cancelBubble = true;
  3402. a.cancel = true;
  3403. a.returnValue = false;
  3404. return false;
  3405. }
  3406.  
  3407. function scroll_space(a, b)
  3408. {
  3409. let by = Math.round((b ? window.innerHeight : window.innerWidth) * 0.50 * (a ? -1 : 1));
  3410. if(!b)
  3411. {
  3412. window.scrollBy(0, by);
  3413. }
  3414. else
  3415. {
  3416. window.scrollBy(by, 0);
  3417. }
  3418. }
  3419.  
  3420. function download_image()
  3421. {
  3422. if(i && i.src)
  3423. {
  3424. filename = filename.replace(/[/\\?%*:|"<>]/g, '_'); // characters you can't use in filenames
  3425. let details = { url: i.src,
  3426. headers: referrer_policy != "no-referrer" ? {'Referer': window.location.href} : {}, // doesn't fully follow the page's referer policy but ok
  3427. name: filename,
  3428. saveAs: true}
  3429. console.log('downloading: ' + filename + " from: " + i.src);
  3430. details.onload = () => { console.log('download complete'); };
  3431. details.ontimeout = () => { console.error('download timeout'); };
  3432. details.onerror = (error, errorDetails) => { console.error('download failed', error, errorDetails); };
  3433. GM_download(details);
  3434. }
  3435. }
  3436.  
  3437. function onkeydown (b)
  3438. {
  3439. let a = (window.event) ? b.keyCode : b.which;
  3440.  
  3441. if(b.ctrlKey && a == KeyEvent.DOM_VK_S)
  3442. {
  3443. cancelEvent(b);
  3444. download_image();
  3445. return;
  3446. }
  3447. if (b.altKey || b.metaKey || (b.ctrlKey && a != KeyEvent.DOM_VK_SPACE && a != KeyEvent.DOM_VK_F5 && a != KeyEvent.DOM_VK_R))
  3448. {
  3449. return;
  3450. }
  3451.  
  3452. let by = Math.round(window.innerHeight * 0.10);
  3453.  
  3454. switch (a)
  3455. {
  3456. case KeyEvent.DOM_VK_RIGHT:
  3457. case KeyEvent.DOM_VK_D:
  3458. case KeyEvent.DOM_VK_NUMPAD6:
  3459. if(!is_video)
  3460. {
  3461. window.scrollBy(by, 0);
  3462. cancelEvent(b);
  3463. }
  3464. else
  3465. {
  3466. i.currentTime += skip_by;
  3467. }
  3468. break;
  3469. case KeyEvent.DOM_VK_LEFT:
  3470. case KeyEvent.DOM_VK_A:
  3471. case KeyEvent.DOM_VK_NUMPAD4:
  3472. if(!is_video)
  3473. {
  3474. window.scrollBy(by * -1, 0);
  3475. cancelEvent(b);
  3476. }
  3477. else
  3478. {
  3479. i.currentTime -= skip_by;
  3480. }
  3481. break;
  3482. case KeyEvent.DOM_VK_W:
  3483. case KeyEvent.DOM_VK_NUMPAD8:
  3484. window.scrollBy(0, by * -1);
  3485. cancelEvent(b);
  3486. break;
  3487. case KeyEvent.DOM_VK_S:
  3488. case KeyEvent.DOM_VK_NUMPAD2:
  3489. window.scrollBy(0, by);
  3490. cancelEvent(b);
  3491. break;
  3492. case KeyEvent.DOM_VK_SPACE:
  3493. if(!is_video)
  3494. {
  3495. scroll_space(b.shiftKey, b.ctrlKey);
  3496. }
  3497. else if(i.paused || i.ended)
  3498. {
  3499. i.play();
  3500. }
  3501. else
  3502. {
  3503. i.pause();
  3504. }
  3505. cancelEvent(b);
  3506. break;
  3507. case KeyEvent.DOM_VK_TAB:
  3508. case KeyEvent.DOM_VK_ENTER:
  3509. rescale(null, true);
  3510. cancelEvent(b);
  3511. break;
  3512. case KeyEvent.DOM_VK_Q:
  3513. case KeyEvent.DOM_VK_NUMPAD5:
  3514. rescale(null, false);
  3515. cancelEvent(b);
  3516. break;
  3517. case KeyEvent.DOM_VK_P:
  3518. cfg();
  3519. cancelEvent(b);
  3520. break;
  3521. case KeyEvent.DOM_VK_R:
  3522. if(!b.ctrlKey)
  3523. {
  3524. sessionStorage.hji = window.location.href;
  3525. window.location.reload();
  3526. cancelEvent(b);
  3527. }
  3528. else
  3529. {
  3530. window.removeEventListener("beforeunload", onbeforeunload, true);
  3531. }
  3532. break;
  3533. case KeyEvent.DOM_VK_F5:
  3534. window.removeEventListener("beforeunload", onbeforeunload, true);
  3535. break;
  3536. }
  3537. }
  3538.  
  3539. function cfg()
  3540. {
  3541. if (typeof GM.setValue !== "undefined")
  3542. {
  3543. function saveCfg()
  3544. {
  3545. GM.setValue("directImage", q("#hji_cfg_1_direct").checked);
  3546. GM.setValue("bgColor", q("#hji_cfg_2_bgclr").value);
  3547. GM.setValue("fitWH", q("#hji_cfg_3_fitWH").checked);
  3548. GM.setValue("fitB", q("#hji_cfg_4_fitB").checked);
  3549. GM.setValue("fitS", q("#hji_cfg_5_fitS").checked);
  3550. GM.setValue("fitOS", q("#hji_cfg_7_fitOS").checked);
  3551. GM.setValue("js", q("#hji_cfg_6_js").value);
  3552. alert("Configuration Saved");
  3553. if(q("#hji_cfg_2_bgclr").value){document.body.bgColor = q("#hji_cfg_2_bgclr").value;}else{document.body.removeAttribute("bgColor");}
  3554. }
  3555. if(i && i.src)
  3556. {
  3557. i.removeEventListener("click", rescale, true);
  3558. i.removeEventListener("auxclick", rescale, true);
  3559. i.removeEventListener("mousedown", mousedown, true);
  3560. }
  3561. window.removeEventListener("keydown", onkeydown, true);
  3562. document.head.innerHTML = "";
  3563. document.body.innerHTML = "";
  3564. ws();
  3565. let div = protected_createElement("div");
  3566. div.style = "margin: auto; width: fit-content; height: fit-content; border: 1px solid black; color: black; background: silver; position: absolute; top: 0; right: 0; bottom: 0; left: 0;";
  3567. div.innerHTML = "<b><center>Configuration</center></b><br><input id='hji_cfg_1_direct' type='checkbox'> Open images directly with browser (disables Handy)"
  3568. + "<br><br><input id='hji_cfg_2_bgclr' style='color: inherit; background: gainsboro;' type='text' size='6'> Background color (empty = default)"
  3569. + "<br><br>Fit to window images:" + " ( Fill to window instead <input id='hji_cfg_7_fitOS' type='checkbox'> )"
  3570. + "<br><br><input id='hji_cfg_3_fitWH' type='checkbox'> Larger than window both vertically and horizontally"
  3571. + "<br><br><input id='hji_cfg_4_fitB' type='checkbox'> Larger than window either vertically or horizontally"
  3572. + "<br><br><input id='hji_cfg_5_fitS' type='checkbox'> Smaller than window"
  3573. + "<br><br><center>Custom JS Action:<br><textarea id='hji_cfg_6_js' style='margin: 0px; width: 400px; height: 50px; color: inherit; background: gainsboro;'></textarea>"
  3574. + "<br><input id='hji_cfg_save' style='color: inherit; background: gainsboro;' type='button' value='Save configuration'></center>";
  3575. document.body.appendChild(div);
  3576. q("#hji_cfg_1_direct").checked = cfg_direct;
  3577. q("#hji_cfg_2_bgclr").value = cfg_bgclr;
  3578. q("#hji_cfg_3_fitWH").checked = cfg_fitWH;
  3579. q("#hji_cfg_4_fitB").checked = cfg_fitB;
  3580. q("#hji_cfg_5_fitS").checked = cfg_fitS;
  3581. q("#hji_cfg_7_fitOS").checked = cfg_fitOS;
  3582. q("#hji_cfg_6_js").value = cfg_js;
  3583. q("#hji_cfg_save").addEventListener("click", saveCfg, true);
  3584. }
  3585. else
  3586. {
  3587. alert("Sorry, userscripts in browser native mode (without a script manager) can't have configurations! Install TamperMonkey extension. (it's a very good userscript manager)");
  3588. }
  3589. }
  3590.  
  3591. var loadCfg;
  3592. if (typeof GM === 'undefined') // GM3 or native
  3593. {
  3594. if (typeof GM_getValue !== "undefined")
  3595. {
  3596. console.warn("using synchronous GM setting loading");
  3597. window.GM = {};
  3598. GM.getValue = GM_getValue;
  3599. GM.setValue = GM_setValue;
  3600. loadCfg = function()
  3601. {
  3602. cfg_direct = GM.getValue("directImage", false);
  3603. cfg_bgclr = GM.getValue("bgColor", "grey");
  3604. cfg_fitWH = GM.getValue("fitWH", true);
  3605. cfg_fitB = GM.getValue("fitB", false);
  3606. cfg_fitS = GM.getValue("fitS", true);
  3607. cfg_fitOS = GM.getValue("fitOS", false);
  3608. cfg_js = GM.getValue("js", "");
  3609. cfg_vol = GM.getValue("vid_volume", "0.5");
  3610. }
  3611. loadCfg();
  3612. }
  3613. else
  3614. {
  3615. cfg_js = "";
  3616. console.warn("no script manager found - using default settings mode");
  3617. }
  3618. }
  3619. else
  3620. {
  3621. loadCfg = async function ()
  3622. {
  3623. cfg_direct = await GM.getValue("directImage", false);
  3624. cfg_bgclr = await GM.getValue("bgColor", "grey");
  3625. cfg_fitWH = await GM.getValue("fitWH", true);
  3626. cfg_fitB = await GM.getValue("fitB", false);
  3627. cfg_fitS = await GM.getValue("fitS", true);
  3628. cfg_fitOS = await GM.getValue("fitOS", false);
  3629. cfg_js = await GM.getValue("js", "");
  3630. cfg_vol = await GM.getValue("vid_volume", "0.5");
  3631. }
  3632. loadCfg();
  3633. }