Handy Image

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

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

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