Handy Image

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

2024-09-13 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

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