Handy Image

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

As of 17.06.2024. See ბოლო ვერსია.

  1. // ==UserScript==
  2. // @name Handy Image
  3. // @version 2024.06.17
  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 https://x.com/*/photo/*
  548. // @match https://mobile.x.com/*/photo/*
  549. // @match http://*.icezap.com/img-*
  550. // @match *://*.rapidimg.net/img-*
  551. // @match http://*.imgtornado.com/img-*
  552. // @match http://*.daily-img.com/image/*
  553. // @match http://*.imageab.com/image/*
  554. // @match http://*.erimge.com/img-*
  555. // @match http://*.imgtrial.com/img-*
  556. // @match https://imgtown.net/*.php
  557. // @match http://ameblo.jp/*/image-*
  558. // @match http://*.loftlm.ru/img-*
  559. // @match http://*.imgdragon.com/*/*.html
  560. // @match http://ftop.ru/*/*
  561. // @match http://*.imgurx.net/share*
  562. // @match http://savepic.ru/*.htm
  563. // @match http://*.imgmaid.net/*
  564. // @match http://*.imggold.org/*/*.html
  565. // @match http://*.imgcredit.xyz/img-*
  566. // @match http://*.imgcredit.xyz/p/img-*
  567. // @match http://*.imgcredit.xyz/image/*
  568. // @match http://*.dimtus.com/img-*
  569. // @match http://*.coreimg.net/*
  570. // @match http://sfwimg.com/image/*
  571. // @match http://*.img3x.com/image/*
  572. // @match http://*.imguniversal.com/*
  573. // @match http://*.imagepearl.com/view/*
  574. // @match http://*.imagepearl.com/verify/*
  575. // @match http://*.tinizo.com/img-*
  576. // @match *://*.imgkings.com/img*
  577. // @match http://*.imagerar.com/img*
  578. // @match http://*.sendpic.org/view/*
  579. // @match *://www.porncomix.info/*/*/
  580. // @exclude *://www.porncomix.info/gallery/*
  581. // @exclude *://www.porncomix.info/artist/*
  582. // @match *://*.picclock.ru/*/*/
  583. // @match http://*.svetmonet.ru/*.html
  584. // @match http://*.svetmonet.ru/full/
  585. // @match http://*.imgpix.net/*
  586. // @match http://*.freeimagehostin.com/img-*
  587. // @match http://www.mixbase.net/gallery/image.*
  588. // @match https://www.adultimages.xyz/*/image*.html
  589. // @match http://*.pic4share.ru/*.html
  590. // @match http://*.pic4share.ru/full/
  591. // @match http://*.sximg.nl/img-*
  592. // @match http://*.0img.net/?v=*
  593. // @match https://ss.movierls.net/image/*
  594. // @match http://www.xxximagetpb.org/image/*
  595. // @match http://www.pixsense.net/site/v/*
  596. // @match http://www.imgsky.net/*
  597. // @match http://www.imagespicy.site/site/v/*
  598. // @match https://outletpic.com/*.php
  599. // @match http://*.pix.ac/image/*
  600. // @match *://*.imgmak.com/image/*
  601. // @match http://*.freephotohostin.com/img-*
  602. // @match http://*.imgcat.pw/img-*
  603. // @match http://*.levinpic.org/*.html
  604. // @match https://www.sparrowpics.com/image/*
  605. // @match http://*.imgmax.com/image/*
  606. // @match http://lostpix.com/?v=*
  607. // @match https://extraimago.com/image/*
  608. // @match http://www.joblo.com/hollywood-celebrities/hottie-profile/*/image-gallery/*.jpg
  609. // @match *://extraimage.net/image/
  610. // @match *://www.bellazon.com/main/attachment/*
  611. // @match *://extraimage.net/image/*
  612. // @match https://www.artstation.com/artwork/*
  613. // @match http://bcy.net/illust/detail/*
  614. // @match http://*.imgpics.nl/img-*
  615. // @match http://*.imagexxx18.com/image/*
  616. // @match http://*.imagepics.xyz/img-*
  617. // @match *://postto.me/*
  618. // @match http://*.imgskull.xyz/image/*
  619. // @match http://*.imgskull.com/image/*
  620. // @match *://*.ninjaimages.com/*.html
  621. // @match *://*.imgprime.com/img*
  622. // @match *://*.piccash.net/*/*/
  623. // @exclude *://piccash.net/cabinets/*
  624. // @exclude *://www.piccash.net/cabinets/*
  625. // @match http://imgwo.com/img-*
  626. // @match http://luxpic.ru/images/*.html
  627. // @match http://*.pic-images.ru/full/
  628. // @match http://*.pic-images.ru/*.html
  629. // @match http://*.imgspic.ru/full/
  630. // @match http://*.imgspic.ru/*.html
  631. // @match http://imgleveret.com/img-*
  632. // @match http://porn84.org/img-*
  633. // @match https://*.ima.gy/i/*
  634. // @match http://picpower.ru/full/
  635. // @match http://picpower.ru/*.html
  636. // @match http://piccloud.ru/full/
  637. // @match http://piccloud.ru/*.html
  638. // @match https://imgbase.ru/*/*/
  639. // @match http://*.sexybabepics.net/img-*.html
  640. // @match http://*.sexybabepics.net/x/image/*
  641. // @match http://*.imagecrest.com/verify/*
  642. // @match http://*.imagecrest.com/view/*
  643. // @match https://*.picz.site/img-*.html
  644. // @match http://*.allxpix.com/img-*.html
  645. // @match http://pixxsees.ru/full/
  646. // @match http://pixxsees.ru/*.html
  647. // @match http://imgblank.com/img-*.html
  648. // @match http://imgtrex.com/*/*
  649. // @match https://imgwallet.com/img-*.html
  650. // @match http://2picsun.ru/full/
  651. // @match http://2picsun.ru/*.html
  652. // @match http://picpie.org/image/*
  653. // @match *://*.xeimg.yt/img-*.html
  654. // @match *://*.imagedisco.net/?v=*
  655. // @match http://*.imgmain.com/img-*.html
  656. // @match http://*.imgvisits.com/*
  657. // @match *://pixxxels.org/image/*
  658. // @match http://img-pika.ru/full/
  659. // @match http://img-pika.ru/*.html
  660. // @match http://imgcach.ru/*/*/
  661. // @match https://*.xhamster19.com/photos/gallery/*/*
  662. // @match https://*.xhamster11.com/photos/gallery/*/*
  663. // @match https://*.xhamster4.com/photos/gallery/*/*
  664. // @match https://*.xhamster3.com/photos/gallery/*/*
  665. // @match https://*.xhamster.com/photos/gallery/*/*
  666. // @match https://*.xhamster.desi/photos/gallery/*/*
  667. // @exclude /^https://(.*\.)?xhamster(\d{1,2})?\.(com|desi)/photos/gallery/.*/\d{1,3}$/
  668. // @match http://*.imghall.com/?v=*
  669. // @match https://*.acidimg.cc/img-*
  670. // @match https://imgcloud.pw/image/*
  671. // @match https://z4a.net/image/*
  672. // @match https://t.hogor.net/?pm=*
  673. // @match http://xxxwebdlxxx.org/*.html
  674. // @match https://www.sizzlingclicks.com/image/*
  675. // @match http://wwxxww.ru/*.html
  676. // @match http://wwxxww.ru/full/
  677. // @match http://passpix.com/images/*
  678. // @match http://*.imgseed.com/img-*.html
  679. // @match http://img.folluo.me/image/*
  680. // @match *://imgpart.com/img-*
  681. // @match https://picstate.com/view/full/*
  682. // @match https://jerking.empornium.ph/image/*
  683. // @match https://truepic.org/*
  684. // @match https://www.jiopic.com/image/*
  685. // @match https://imx.to/img-*
  686. // @match https://imx.to/i/*
  687. // @match https://pixxxels.cc/*
  688. // @match http://picpic.online/*/*/
  689. // @match http://imgking.xyz/*.html
  690. // @match http://moreimage.pw/image/*
  691. // @match https://imgsha.com/i/*
  692. // @match https://www.pic-upload.de/view-*/*.html
  693. // @match http://pic3you.org/*.html
  694. // @match http://pic3you.org/full/
  695. // @match *://*.vipix.pw/images/*.html
  696. // @match https://*.imgazure.com/*.html
  697. // @match https://*.imgazure.com/full/
  698. // @match *://*.dpic.me/*
  699. // @match *://*.picmoza.com//img-*.html
  700. // @match *://suckmypic.net/*
  701. // @match *://pic.hotimg.site/img-*.html
  702. // @match http://*.shaggyimg.pro/*.html
  703. // @match http://*.shaggyimg.pro/full/
  704. // @match https://*.imgjazz.xyz/img-*.html
  705. // @match https://22pixx.xyz/i*-*/*.html
  706. // @match https://22pixx.xyz/i-*/*.html
  707. // @match https://22pixx.xyz/x-*/*.html
  708. // @match https://22pixx.xyz/y-*/*.html
  709. // @match *://trueimg.xyz/u-*/*.html
  710. // @match *://imgsmarts.info/*.html
  711. // @match *://imgsmarts.info/full/
  712. // @match *://www.keepimg.com/image/*
  713. // @match https://ibb.co/*
  714. // @match http://*.imgsee.net/*
  715. // @match *://*.picbaron.com/*/*.html
  716. // @match *://*.imgbaron.com/*/*
  717. // @match https://kvador.com/*/*.html
  718. // @match http://picshost.info//img-*.html
  719. // @match *://imagescanner.cc/images/*.html
  720. // @match http://batpic.com/image/*
  721. // @match http://*.1pic.org/view/*.html
  722. // @match *://lookimg.com/image/*
  723. // @match http://*.xfap.fun/img-*.html
  724. // @match *://*.hdmoza.com//img-*.html
  725. // @match *://trans.firm.in/images/*.html
  726. // @match http://*.imgtorrnt.in/view.php?id=*
  727. // @match https://*.dailyimages.xyz/*.html
  728. // @match https://*.dailyimages.xyz/full/
  729. // @match http://*.petrovixxxjav.com//img-*.html
  730. // @match *://*.placeimg.net/img-*.html
  731. // @match https://subefotos.com/ver/?*
  732. // @match http://*.imageshtorm.com/img-*.html
  733. // @match https://*.blameless.work/img-*.html
  734. // @match https://trumbhost.com/images/*.html
  735. // @match http://*.xxx.kodiak.top/img-*.html
  736. // @match *://*.your-pictures.net/p*/*.html
  737. // @match https://*.xaoutchouc.live/img-*.html
  738. // @match https://*.picusha.net/?v=*
  739. // @match https://e621.net/posts/*
  740. // @match https://rule34.xxx/index.php?page=post&s=view&id=*
  741. // @match https://*.rule34hentai.net/post/view/*
  742. // @match https://pixs.cx/*
  743. // @match *://mshelxxx.ru.com//img-*.html
  744. // @match *://www.hentai-foundry.com/pictures/*
  745. // @exclude *://www.hentai-foundry.com/pictures/user/*/page/*
  746. // @match *://imgcredit.xyz/image/*
  747. // @match *://drlink.online/*/*/
  748. // @match https://savepice.ru/full/*.html
  749. // @match https://kropic.com/*/*.html
  750. // @match http://*.imgzong.xyz/*
  751. // @match https://www.furaffinity.net/view/*
  752. // @match http://imageking.xyz/*
  753. // @match http://imgxx.xyz/*
  754. // @match http://imgao.xyz/*
  755. // @match http://imgweng.xyz/*
  756. // @match http://imgkes.xyz/*
  757. // @match https://imgair.net/*
  758. // @match https://imgtgd.shop/*
  759. // @match https://*.imgsto.com/*/*.html
  760. // @match https://*.pics4you.net/*/*.html
  761. // @match https://vipr.im/*
  762. // @match https://*.trans.firm.in/img-*.html
  763. // @match https://*.imgdawgknuttz.com/img-*.html
  764. // @match https://*.xxxwebdlxxx.top/img-*.html
  765. // @match https://*.olarixas.xyz/img-*.html
  766. // @match http://imgkoi.xyz/*
  767. // @match https://imagehaha.com/*/*
  768. // @match https://picshick.com/*/*
  769. // @match https://imgsen.com/*/*.html
  770. // @match https://premalo.com/*/*.html
  771. // @match https://picdollar.com/*/*.html
  772. // @match https://fotokiz.com/*/*.html
  773. // @match https://silverpic.com/*/*.html
  774. // @match http://imglin.xyz/*
  775. // @match *://*.crownimg.com/*/*.html*
  776. // @match http://imgkr.xyz/*
  777. // @match *://*.xxxwebdlxxx.org/img-*.html
  778. // @match http://imgbird.xyz/*
  779. // @match https://*.pornhd720p.com//img-*.html
  780. // @match http://imgwewo.xyz/*
  781. // @match https://*.rintor.space/image/*
  782. // @match http://imgirx.xyz/*
  783. // @match http://*.imgalor.xyz/*
  784. // @match http://imgjut.buzz/*
  785. // @match http://imgtrw.buzz/*
  786. // @match http://imglina.xyz/*
  787. // @match http://imgkuiw.xyz/*
  788. // @match http://imgwang.buzz/*
  789. // @match https://imgbb.com/*
  790. // @match *://vfl.ru/fotos/*.html
  791. // @match https://*.imgstar.eu/*/*.html
  792. // @match https://dewimg.com/*.php
  793. // @match https://pictwn.com/*.php
  794. // @match https://comment-cdn.9gag.com/image?*
  795. // @match https://t.me/*/*
  796. // @match https://telegram.me/*/*
  797. // @match *://piccy.info/view3/*/*/
  798. // @match http://imgmeno.buzz/*
  799. // @match https://*.pics4upload.com/*/*.html
  800. // @match http://imgpekele.buzz/*
  801. // @match http://imglqw.buzz/*
  802. // @match http://imgyng.buzz/*
  803. // @match http://imgbbd.buzz/*
  804. // @match http://imgwia.buzz/*
  805. // @match http://imgowk.buzz/*
  806. // @match http://imgokr.buzz/*
  807. // @match http://imgoiu.buzz/*
  808. // @match https://picmoney.org/image/*
  809. // @match *://skrinshoter.ru/s/*/*
  810. // @match https://photo-screen.ru/i/*
  811. // @match https://postlmg.cc/*
  812. // @match https://pasteboard.co/*
  813. // @match https://*.picklik.ru/image/*
  814. // @match https://*.jpg.church/img/*
  815. // @match https://rule34.us/index.php?r=posts/view&id=*
  816. // @match https://*.imghub.ru/i/*
  817. // @match https://imgeza.buzz/*
  818. // @match http://mrlzqoe.buzz/*
  819. // @match https://radikal.host/i/*
  820. // @match https://*.slowpic.xyz//img-*.html
  821. // @match https://yapx.ru/*/*
  822. // @match https://imgpukxxr.site/*
  823. // @match https://picngt.shop/*
  824. // @match https://realbooru.com/index.php?page=post&s=view&id=*
  825. // @match *://imgutkr.store/*
  826. // @match *://imghhr.online/*
  827. // @match *://imglaiw.store/*
  828. // @match https://meetimgz.com/*.php
  829. // @match *://imgvue.online/*
  830. // @match *://imgxgf.store/*
  831. // @match *://imgbibam.online/*
  832. // @match https://imgsh.net/a/*
  833. // @match *://imgqaz.online/*
  834. // @match *://imgurt.online/*
  835. // @match https://jpg.fish/img/*
  836. // @match https://jpg1.su/img/*
  837. // @match https://jpg2.su/img/*
  838. // @match https://jpg3.su/img/*
  839. // @match https://jpg4.su/img/*
  840. // @match *://imgwxr.online/*
  841. // @match *://imgyre.online/*
  842. // @match https://pixl.li/image/*
  843. // @match https://pixlev.store/*
  844. // @match https://pixmax.store/*
  845. // @match https://imgxqy.online/*
  846. // @match https://skr.sh/*
  847. // @match https://i.redd.it/*
  848. // @match https://preview.redd.it/*
  849. // @match https://www.reddit.com/media?url=*
  850. // @match https://vsco.co/*/media/*
  851. // @match https://www.gettyimages.com/detail*photo*
  852. // @match https://www.gettyimages.com/detail*video*
  853. // @match https://jpg.pet/img/*
  854. // @match https://jpeg.pet/img/*
  855. // @match https://imgnmh.cfd/*
  856. // @match https://im.ge/i/*
  857. // @match https://piczel.tv/gallery/image/*
  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. // @match https://rule34.paheal.net/post/view/*
  886. // @match https://imgjjtr.sbs/*
  887. // @match https://tezzpic.com/*.php
  888. // ==/UserScript==
  889.  
  890. "use strict";
  891.  
  892. console.debug("HandyImage Script running");
  893.  
  894. if (typeof unsafeWindow === "undefined")
  895. {
  896. unsafeWindow = window;
  897. console.warn("unsafeWindow missing");
  898. }
  899.  
  900. if (typeof GM_registerMenuCommand !== "undefined")
  901. {
  902. GM_registerMenuCommand("Handy Image Configuration", cfg, "C");
  903. }
  904.  
  905. if(window.location.href.lastIndexOf(window.location.hostname) + window.location.hostname.length + 1 == window.location.href.length)
  906. {
  907. console.warn("we are on website's main page, aren't we?");
  908. return false;
  909. }
  910. let type = document.contentType.substring(0,document.contentType.indexOf("/"));
  911. if (type === "image" || type === "video")
  912. {
  913. console.warn("Handy isn't needed for directly opened images or videos (if you want it this way - use CenterImage userscript");
  914. return false;
  915. }
  916. if(history.length !== 1 && document.referrer)
  917. {
  918. if(document.referrer.lastIndexOf(window.location.hostname) != -1 && document.referrer.lastIndexOf(window.location.hostname) +1 == document.referrer.length - window.location.hostname.length)
  919. {
  920. 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");
  921. return false;
  922. }
  923. }
  924. if (document.title == "Attention Required! | Cloudflare" || document.title == "Just a moment...")
  925. {
  926. console.warn("Cloudflare MITM guard page. Stopping.");
  927. return false;
  928. }
  929. if(sessionStorage.length)
  930. {
  931. if(sessionStorage.hji)
  932. {
  933. if(sessionStorage.hji.indexOf(window.location.href) != -1) // check address in case page failed to load b4
  934. {
  935. console.warn("Handy Image: userscript stopped itself from running INTENTIONALLY");
  936. sessionStorage.removeItem("hji");
  937. return false;
  938. }
  939. sessionStorage.removeItem("hji");
  940. }
  941. else if(sessionStorage.hji_back)
  942. {
  943. if(Date.now() < parseInt(sessionStorage.hji_back)) // 2 sec not yet passed
  944. {
  945. console.warn("Handy Image: userscript now helps you go to previous page automatically");
  946. sessionStorage.removeItem("hji_back");
  947. window.history.go(-1);
  948. return false;
  949. }
  950. sessionStorage.removeItem("hji_back");
  951. }
  952. }
  953.  
  954. function q(s){if(document.body){return document.body.querySelector(s);}return null;}
  955. var cfg_direct = false;
  956. var cfg_bgclr ="grey";
  957. var cfg_fitWH = true;
  958. var cfg_fitB = false;
  959. var cfg_fitS = true;
  960. var cfg_fitOS = false;
  961. var cfg_js;
  962. var cfg_vol = "0.5";
  963. var referrer_policy = "strict-origin-when-cross-origin"; // default browser behavior
  964. var dp = false;
  965. let orgImgWidth;
  966. let orgImgHeight;
  967. var rescaled = 0;
  968. var tb = 0;
  969. var tg = 0;
  970. var timeout = 1000;
  971. var FireFox = ((navigator.userAgent.indexOf('Firefox') != -1) ? true : false);
  972. var i;
  973. var j;
  974. var bStopScripts = false;
  975. var bUseCustomFilename = true;
  976. var filename = "";
  977. var filename_ext = "";
  978. var skip_by = 5;
  979. var is_video = false;
  980. var is_gallery = false;
  981. var ext_list_not_image = ['zip', '7z', 'rar', 'psd', 'swf', 'doc', 'rtf', 'pdf'];
  982. var ext_list_video = ['webm', 'mp4', 'm4v', 'avi', 'flv', 'ogg'];
  983. var iurl = window.location.hostname;
  984. if(!iurl.indexOf("www."))
  985. {
  986. iurl = iurl.substr(4);
  987. }
  988. var host = iurl;
  989. if(window.location.pathname.indexOf("//") == 0)
  990. {
  991. iurl += "/";
  992. }
  993.  
  994. function ws()
  995. {
  996. if(!FireFox) // NOT firefox
  997. {
  998. window.stop();
  999. }
  1000. }
  1001.  
  1002. function sanitize() // lol I'm such a hacker
  1003. {
  1004. removeAllListeners();
  1005. let lasttask = unsafeWindow.setTimeout(function() {},0);
  1006. for(let n = lasttask; n > 0; n--)
  1007. {
  1008. //if(n !== tg) // unsafeWindow.clear can't clear window.tasks set in the userscript but lets be safe
  1009. //{
  1010. unsafeWindow.clearTimeout(n); // only unsafeWindow has access to clear page tasks
  1011. //}
  1012. }
  1013. }
  1014.  
  1015. const protected_createElement = Document.prototype.createElement.bind(document);
  1016. protected_addEventListener.originalF = Element.prototype.addEventListener;
  1017. function protected_addEventListener (el, event, handler, capture = false)
  1018. {
  1019. return protected_addEventListener.originalF.call(el, event, handler, capture);
  1020. }
  1021.  
  1022. var _eventHandlers = {};
  1023. var origAdd = unsafeWindow.Element.prototype.addEventListener; // page's one
  1024. if(FireFox && typeof exportFunction === "function")
  1025. {
  1026. wrapper_addEventListener = exportFunction(wrapper_addEventListener, unsafeWindow); // TM magic
  1027. }
  1028. // addEventListener inside userscript's `window` doesn't change
  1029. unsafeWindow.Window.prototype.addEventListener = wrapper_addEventListener;
  1030. unsafeWindow.Document.prototype.addEventListener = wrapper_addEventListener;
  1031. unsafeWindow.Element.prototype.addEventListener = wrapper_addEventListener;
  1032.  
  1033. function wrapper_addEventListener (event, handler, capture = false)
  1034. {
  1035. //if (typeof _eventHandlers === "undefined") unsafeWindow._eventHandlers = {};
  1036. if (bStopScripts)
  1037. {
  1038. console.debug("HJI: stopped 1 addEventListener: " + event);
  1039. return null;
  1040. }
  1041. if (!(event in _eventHandlers)) _eventHandlers[event] = [];
  1042.  
  1043. _eventHandlers[event].push({ node: this || unsafeWindow, handler: handler, capture: capture });
  1044. console.debug("HJI: wrapped 1 addEventListener: " + event + ", "+ Object.keys(_eventHandlers).length);
  1045. return origAdd.call(this, event, handler, capture);
  1046. }
  1047.  
  1048. function removeAllListeners ()
  1049. {
  1050. console.debug("HJI: removed "+ Object.keys(_eventHandlers).length + " event listeners: " + Object.keys(_eventHandlers));
  1051. for(let event in _eventHandlers)
  1052. {
  1053. _eventHandlers[event].forEach(({ node, handler, capture }) => node.removeEventListener(event, handler, capture));
  1054. delete _eventHandlers[event];
  1055. }
  1056. }
  1057.  
  1058. function onVisibilityChange()
  1059. {
  1060. if (document.visibilityState === 'visible')
  1061. {
  1062. if(i && i.src)
  1063. {
  1064. window.removeEventListener('visibilitychange', onVisibilityChange);
  1065. onWindowResize();
  1066. autoresize();
  1067. }
  1068. }
  1069. }
  1070.  
  1071. const AddElementToPage = typeof GM_addElement === "function" ? GM_addElement : function (node, type, content)
  1072. {
  1073. let el = protected_createElement(type);
  1074. el.textContent = content.textContent;
  1075. node.appendChild(el);
  1076. }; // stupid adGuard
  1077.  
  1078. function DeleteAllCookies()
  1079. {
  1080. document.cookie.split(";").forEach(function(c) {
  1081. document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
  1082. });
  1083. }
  1084.  
  1085. function onscript(e)
  1086. {
  1087. //console.debug( "STOPPED: " + e.target.src + e.target.innerHTML);
  1088. console.debug( "HJI: onscript stopped 1 script from loading");
  1089. e.preventDefault();
  1090. e.stopImmediatePropagation();
  1091. }
  1092.  
  1093. function onbeforeunload() // back helper
  1094. {
  1095. sessionStorage.hji_back = Date.now() + 2000; // 2 sec to help back from double-pages
  1096. }
  1097.  
  1098. function makeimage()
  1099. {
  1100. 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
  1101. if(cfg_direct === true){let a = protected_createElement('a'); a.setAttribute('href',i.src); a.click(); return false;}
  1102. let css
  1103. = `:root, body
  1104. {
  1105. height: 100%;
  1106. width: 100%;
  1107. margin: 0px;
  1108. display: grid;
  1109. }
  1110. img, video
  1111. {
  1112. margin: auto;
  1113. outline: none;
  1114. max-width: unset;
  1115. max-height: unset;
  1116. image-orientation: from-image;
  1117. }
  1118. video::-webkit-media-controls-panel
  1119. {
  1120. background-image: linear-gradient(transparent, transparent) !important;
  1121. }
  1122. :root, body, img, video
  1123. {
  1124. min-width: 0px;
  1125. min-height: 0px;
  1126. background-color: ${cfg_bgclr};
  1127. }`; // don't mind the broken identation, multiline string demands it
  1128. AddElementToPage(document.documentElement, 'style', {textContent: css});
  1129. ws();
  1130. let isrc = i.src;
  1131. i = protected_createElement(is_video? "video" : "img");
  1132. i.src = isrc;
  1133. document.body.appendChild(i);
  1134. if(!is_video)
  1135. {
  1136. protected_addEventListener(i, "click", rescale, true);
  1137. }
  1138. else
  1139. {
  1140. i.volume = cfg_vol;
  1141. protected_addEventListener(i, "volumechange", onvolumechange, true);
  1142. i.controls = true;
  1143. i.loop = true;
  1144. i.preload = "auto";
  1145. i.focus(); // so video volume built-in hotkeys would work (until you unfocus it)
  1146. }
  1147. protected_addEventListener(i, "auxclick", rescale, true);
  1148. protected_addEventListener(i, "mousedown", mousedown, true); // chrome old fix - still needed
  1149. window.addEventListener("keydown", onkeydown, true);
  1150. window.addEventListener("resize", onWindowResize);
  1151. window.addEventListener("visibilitychange", onVisibilityChange);
  1152. onVisibilityChange(); // if tab is already active when opening image
  1153. if(dp){console.warn("you are on a double-page image hosting (probably)");window.addEventListener("beforeunload", onbeforeunload, true);}
  1154. if (typeof GM_registerMenuCommand !== "undefined")
  1155. {
  1156. GM_registerMenuCommand("Handy Image Download image", download_image, "N");
  1157. GM_registerMenuCommand("Handy Image Re-Load page normally", () => {sessionStorage.hji = window.location.href; window.location.reload();}, "R");
  1158. }
  1159. }
  1160.  
  1161. function find_text_in_scripts(text, stopword, start_from_top = null, search_after_word = null, content_type = "img")
  1162. {
  1163. let s = document.getElementsByTagName("script");
  1164. for(let c=0;c<s.length;c++)
  1165. {
  1166. 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));}
  1167. let start_pos = start_from_top ? s[c].innerHTML.indexOf(text) : s[c].innerHTML.lastIndexOf(text);
  1168. if(start_pos == -1){continue;}
  1169. start_pos += text.length;
  1170. let found_content = s[c].innerHTML.substring(start_pos,s[c].innerHTML.indexOf(stopword,start_pos));
  1171. found_content = JSON.parse('"' + found_content.replace('"', '\\"') + '"'); // unescape it
  1172. found_content = decodeURIComponent(found_content);
  1173. i = protected_createElement(content_type);
  1174. i.src = found_content;
  1175. console.debug("found url in the script: " + found_content);
  1176. return true;
  1177. }
  1178. return false;
  1179. }
  1180.  
  1181. function post(path, params, method)
  1182. {
  1183. method = method || "post";
  1184. let form = protected_createElement("form");
  1185. form.setAttribute("method", method);
  1186. form.setAttribute("action", path);
  1187. for(let key in params)
  1188. {
  1189. if(Object.hasOwn(params, key)) // hasOwnProperty
  1190. {
  1191. let hiddenField = protected_createElement("input");
  1192. hiddenField.setAttribute("type", "hidden");
  1193. hiddenField.setAttribute("name", key);
  1194. hiddenField.setAttribute("value", params[key]);
  1195.  
  1196. form.appendChild(hiddenField);
  1197. }
  1198. }
  1199. document.body.appendChild(form);
  1200. form.submit();
  1201. }
  1202.  
  1203. function makeworld()
  1204. {
  1205. let f;
  1206. if(i){return;}
  1207. // per-host image detection
  1208. switch (host)
  1209. {
  1210. case "simplest-image-hosting.net":
  1211. case "hostimage.ru":
  1212. case "imgchili.net":
  1213. case "adultimages.xyz":
  1214. i = q('img');
  1215. break;
  1216. case "myceleb.net":
  1217. case "depic.me":
  1218. case "dpic.me":
  1219. i = q('img#pic');
  1220. break;
  1221. case "imagebin.ca":
  1222. i = q('a img');
  1223. if(i){i.src = i.parentNode.href;}
  1224. break;
  1225. case "i.redd.it":
  1226. case "preview.redd.it":
  1227. i = q('faceplate-img, img');
  1228. if(i){i.src = i.getAttribute("src");}
  1229. break;
  1230. case "savepic.org":
  1231. case "savepic.ru":
  1232. i = q('a img:not([src*="/images/"])');
  1233. break;
  1234. case "motherless.com":
  1235. j = true;
  1236. i = q('div#media-media div a img');
  1237. break;
  1238. case "awesomescreenshot.com":
  1239. i = q('img#screenshot');
  1240. break;
  1241. case "zupimages.net":
  1242. i = q('img#img_size');
  1243. break;
  1244. case "dropbox.com":
  1245. j = true;
  1246. i = q('img.preview-image');
  1247. if(i)
  1248. {
  1249. i.src = i.src.replace(/(size_mode)=\d+/, '$1=5');
  1250. }
  1251. break;
  1252. case "img.3ezy.net":
  1253. case "image-bugs.com":
  1254. case "imgclover.com":
  1255. case "demo.chevereto.com":
  1256. case "daily-img.com":
  1257. case "celebimg.com":
  1258. case "sfwimg.com":
  1259. case "img3x.com":
  1260. case "imgskull.xyz":
  1261. case "imgskull.com":
  1262. case "2i.sk":
  1263. case "2i.cz":
  1264. case "deffe.com":
  1265. case "imagik.fr":
  1266. case "gallerycloud.net":
  1267. case "tryimg.com":
  1268. case "fsfiles.org":
  1269. case "picpicture.com":
  1270. case "picpie.org":
  1271. case "lostpic.net":
  1272. case "batpic.com":
  1273. //chevereto 3.x
  1274. i = document.head.querySelector('link[rel="image_src"]');
  1275. if(i)
  1276. {
  1277. i.src = i.href;
  1278. i.src = i.src.replace('_800.', '.'); //img.3ezy.net
  1279. }
  1280. break;
  1281. case "imagebam.com":
  1282. //j = true;
  1283. i = q("a i.fa-download");
  1284. if(i)
  1285. {
  1286. i.src = i.parentNode.href;
  1287. }
  1288. else
  1289. {
  1290. i = q("#continue a");
  1291. if(i)
  1292. {
  1293. let expires = '';
  1294. let date = new Date();
  1295. date.setTime(date.getTime() + (6 * 60 * 60 * 1000));
  1296. expires = "; expires=" + date.toUTCString();
  1297. document.cookie = "nsfw_inter=1" + expires + "; path=/";
  1298. i.click();
  1299. }
  1300. }
  1301. break;
  1302. case "directupload.net":
  1303. case "bilderhoster.net":
  1304. case "noelshack.com":
  1305. case "kephost.com":
  1306. case "i.ruspotting.net":
  1307. case "gifyu.com":
  1308. case "sharepic.org":
  1309. case "zuly.de":
  1310. case "upload.vstanced.com":
  1311. case "thro.bz":
  1312. case "qoou.net":
  1313. case "brightpic.tk":
  1314. case "cweb-pix.com":
  1315. case "hosting.webspell.fr":
  1316. case "i-pict.ru":
  1317. case "images.woh.to":
  1318. case "imghaze.com":
  1319. case "imgup.nl":
  1320. case "nium.co":
  1321. case "pix.hostux.net":
  1322. case "pixoload.de":
  1323. case "primeimg.co":
  1324. case "pic.xtream-reallife.de":
  1325. case "ultraimg.com":
  1326. case "safeimage.biz":
  1327. case "imgextra.uk":
  1328. case "ss.movierls.net":
  1329. case "xxximagetpb.org":
  1330. case "pix.ac":
  1331. case "sparrowpics.com":
  1332. case "prnt.sc":
  1333. case "imgmax.com":
  1334. case "extraimago.com":
  1335. case "extraimage.net":
  1336. case "imgcloud.pw":
  1337. case "z4a.net":
  1338. case "jiopic.com":
  1339. case "wwv.imgcredit.xyz":
  1340. case "moreimage.pw":
  1341. case "lookimg.com":
  1342. case "subefotos.com":
  1343. case "imgcredit.xyz":
  1344. case "rintor.space":
  1345. case "imgbb.com":
  1346. case "servimg.com":
  1347. case "picmoney.org":
  1348. case "skrinshoter.ru":
  1349. case "imgmak.com":
  1350. case "picklik.ru":
  1351. case "jpg.church":
  1352. case "imghub.ru":
  1353. case "radikal.host":
  1354. case "imgsh.net":
  1355. case "jpg.fish":
  1356. case "pixl.li":
  1357. case "skr.sh":
  1358. case "jpg.pet":
  1359. case "jpeg.pet":
  1360. case "im.ge":
  1361. case "screencast.com":
  1362. case "picshare.ru":
  1363. case "jpg1.su":
  1364. case "jpg2.su":
  1365. case "jpg3.su":
  1366. case "jpg4.su":
  1367. case 'img.trafficimage.club':
  1368. case 'pig69.com':
  1369. case 'javball.com':
  1370. case 'idol69.net':
  1371. case 'porn4f.com':
  1372. case 'ovabee.com':
  1373. case 'ai18.pics':
  1374. case "paste.pics":
  1375. case 'cnxx.me':
  1376. case 'cnpics.org':
  1377. case 'cosplay18.pics':
  1378. case 'mjj.today':
  1379. case "imgfoto.host":
  1380. case "picabox.ru":
  1381. case "snipboard.io":
  1382. case "seaart.ai":
  1383. case "freeimage.host":
  1384. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1385. if(i)
  1386. {
  1387. i.src = i.content;
  1388. }
  1389. else
  1390. {
  1391. i = q('a[download]');
  1392. if(i){i.src = i.href;}
  1393. }
  1394. break;
  1395. case "vsco.co":
  1396. i = document.querySelector('meta[property="og:image"]');
  1397. if(i)
  1398. {
  1399. i.src = i.content.substring(0, i.content.indexOf("?"));
  1400. }
  1401. break;
  1402. case "civitai.com":
  1403. j = true;
  1404. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1405. if(i)
  1406. {
  1407. i.src = i.content.replace("width=1200","width=3840"); // 4k
  1408. }
  1409. break;
  1410. case "tensor.art":
  1411. j = true;
  1412. i = document.querySelector('meta[property="og:image"], [name="og:image"]');
  1413. if(i)
  1414. {
  1415. i.src = i.content.replace("w=600","w=3840"); // 4k (if available)
  1416. }
  1417. break;
  1418. case "mobile.twitter.com":
  1419. case "twitter.com":
  1420. case "mobile.x.com":
  1421. case "x.com":
  1422. j = true;
  1423. unsafeWindow.history.replaceState = unsafeWindow.console.log;
  1424. i = q('a[href*="/photo/' + Number(window.location.href.at(-1)) + '"] img');
  1425. if(i)
  1426. {
  1427. i.src = i.src.substring(0, i.src.indexOf("&name=")) + '&name=orig';
  1428. filename = "by " + document.head.querySelector('meta[property="og:title"]').content;
  1429. filename_ext = i.src.substring(i.src.indexOf("format=")+7 ,i.src.indexOf("&"));
  1430. }
  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. case "tezzpic.com":
  2131. j = true;
  2132. dp = true;
  2133. f = document.querySelectorAll("input[type='submit']");
  2134. if(f.length)
  2135. {
  2136. let n;
  2137. for(n=f.length-1; n >= 0; n--)
  2138. {
  2139. if(window.getComputedStyle(f[n]).visibility != "hidden" && f[n].offsetWidth != 0 && f[n].value.indexOf("eply") == -1 && f[n].value.indexOf("Log") == -1)
  2140. {
  2141. f[n].removeAttribute("disabled");
  2142. f[n].click();
  2143. i = 1;
  2144. return;
  2145. }
  2146. }
  2147. }
  2148. i = q('img[onload*="scale"]');
  2149. break;
  2150. case "crownimg.com":
  2151. i = q('button');
  2152. dp=true;
  2153. j =true;
  2154. if(i)
  2155. {
  2156. i.click();
  2157. break;
  2158. }
  2159. case "myimg.club":
  2160. case "imgmonkey.com":
  2161. case "imgdragon.com":
  2162. case "imggold.org":
  2163. case "levinpic.org":
  2164. case "imgtown.net":
  2165. case "pixs.cx":
  2166. case "kropic.com":
  2167. case "outletpic.com":
  2168. case "pictwn.com":
  2169. case "meetimgz.com":
  2170. j = true;
  2171. dp=true;
  2172. f = document.querySelectorAll("input[type='submit']");
  2173. if(f.length)
  2174. {
  2175. let n;
  2176. for(n=f.length-1; n >= 0; n--)
  2177. {
  2178. if(window.getComputedStyle(f[n]).visibility != "hidden" && f[n].offsetWidth != 0 && f[n].value.indexOf("eply") == -1 && f[n].value.indexOf("Log") == -1)
  2179. {
  2180. //f[n].removeAttribute("disabled"); ok, let's wait
  2181. f[n].click();
  2182. break;
  2183. }
  2184. }
  2185. }
  2186. case "casimages.com":
  2187. case "thebestpichost.com":
  2188. case "ifotos.pl":
  2189. case "subeimagenes.com":
  2190. case "lostpix.com":
  2191. case "vvcap.com":
  2192. case "imgtrex.com":
  2193. case "pic-upload.de":
  2194. case "picusha.net":
  2195. i = q('img[src*="/img/"]');
  2196. break;
  2197. case "imagenetz.de":
  2198. i = q('img[src*="/img"]');
  2199. break;
  2200. case "picatom.com":
  2201. i = q('img[src*="img/"]');
  2202. break;
  2203. case "imgking.xyz":
  2204. case "imgazure.com":
  2205. i = q('img[src*="/img/"]');
  2206. if(i){i.src = i.src.replace('p.', '.');}
  2207. break;
  2208. case "imgbabes.com":
  2209. case "imgflare.com":
  2210. i = q('input[type="submit"]');
  2211. dp=true;
  2212. j=true;
  2213. if(i)
  2214. {
  2215. i.click();
  2216. i=null;
  2217. }
  2218. else
  2219. {
  2220. i = q('img[src*="i.php?"]');
  2221. }
  2222. break;
  2223. case "xxxhost.me":
  2224. case "bilder-hochladen.net":
  2225. case "dumpt.com":
  2226. case "imgsin.com":
  2227. case "loaditup.de":
  2228. case "123poze.3x.ro":
  2229. case "thaisharing.online.fr":
  2230. case "filefap.com":
  2231. case "imgswift.com":
  2232. case "1pic.org":
  2233. i = q('img[src*="/files/"]');
  2234. break;
  2235. case "image18.org":
  2236. i = q('img[src*="/file"]');
  2237. break;
  2238. case "picstate.com":
  2239. i = q('#image_container a img');
  2240. break;
  2241. case "zimagez.com":
  2242. i = q('img[src*="/full/"]');
  2243. break;
  2244. case "niceimage.pl":
  2245. i = q('img[src*="/uploaded/"]');
  2246. break;
  2247. case "imagefap.com":
  2248. j = true;
  2249. //find_text_in_scripts('"contentUrl": "', '"');
  2250. i = q('#slideshow img[src*="/full/"],#video-html5_html5_api');
  2251. break;
  2252. case "olivepix.com":
  2253. i = q('img[src*="view/"]');
  2254. break;
  2255. case "imgkings.com":
  2256. i = q('img[src*="uploads/"]');
  2257. if(i) break;
  2258. if(find_text_in_scripts('linkid="', '"', false))
  2259. {
  2260. window.location.href = i.src;
  2261. break;
  2262. }
  2263. else if(window.location.href.indexOf("imgs") != -1) // not sure if needed anymore
  2264. {
  2265. window.location.href = window.location.href.replace("imgs","imgv");
  2266. break;
  2267. }
  2268. else if(window.location.href.indexOf("img3") != -1) // not sure if needed anymore
  2269. {
  2270. window.location.href = window.location.href.replace("img3","img4");
  2271. break;
  2272. }
  2273. break;
  2274. case "imgadult.com":
  2275. j = true;
  2276. i = q('a.overlay_ad_link');
  2277. if(i)
  2278. {
  2279. i.click();
  2280. break;
  2281. }
  2282. case "imagefolks.com":
  2283. case "imgcandy.net":
  2284. case "imageteam.org":
  2285. case "imgnext.com":
  2286. case "hosturimage.com":
  2287. case "pixup.us":
  2288. case "xximg.net":
  2289. case "x.xximg.net":
  2290. case "sxpics.nl":
  2291. case "sxpix.nl":
  2292. case "img.yt":
  2293. case "xxxscreens.com":
  2294. case "i.sxpics.nl":
  2295. case "imageon.org":
  2296. case "nimplus.com":
  2297. case "imag.nimplus.com":
  2298. case "newimagepost.com":
  2299. case "fapat.me":
  2300. case "imgbe.com":
  2301. case "fireimg.cc":
  2302. case "rapidimg.net":
  2303. case "imgtornado.com":
  2304. case "erimge.com":
  2305. case "loftlm.ru":
  2306. case "tinizo.com":
  2307. case "imgpix.net":
  2308. case "freeimagehostin.com":
  2309. case "sximg.nl":
  2310. case "freephotohostin.com":
  2311. case "imgpics.nl":
  2312. case "imagepics.xyz":
  2313. case "imgwo.com":
  2314. case "ima.gy":
  2315. case "picz.site":
  2316. case "allxpix.com":
  2317. case "imgblank.com":
  2318. case "xeimg.yt":
  2319. case "imgmain.com":
  2320. case "acidimg.cc":
  2321. case "imgpart.com":
  2322. case "picmoza.com":
  2323. case "imgjazz.xyz":
  2324. case "picshost.info":
  2325. case "petrovixxxjav.com":
  2326. case "placeimg.net":
  2327. case "imageshtorm.com":
  2328. case "blameless.work":
  2329. case "xxx.kodiak.top":
  2330. case "xaoutchouc.live":
  2331. case "mshelxxx.ru.com":
  2332. case "trans.firm.in":
  2333. case "xxxwebdlxxx.top":
  2334. case "imgdawgknuttz.com":
  2335. case "olarixas.xyz":
  2336. case "pornhd720p.com":
  2337. dp=true;
  2338. f = document.getElementsByTagName("input");
  2339. if(f.length)
  2340. {
  2341. f[f.length-1].removeAttribute("disabled");
  2342. f[f.length-1].click();
  2343. }
  2344. case "fotoszok.pl":
  2345. case "damimage.com":
  2346. case "adultur.com":
  2347. case "imagedecode.com":
  2348. case "gogoimage.org":
  2349. case "imageblinks.com":
  2350. case "imglooks.com":
  2351. case "ocaload.com":
  2352. case "imgstudio.org":
  2353. case "goimge.com":
  2354. case "imageho.me":
  2355. case "imgor.net":
  2356. case "icezap.com":
  2357. case "imgtrial.com":
  2358. case "dimtus.com":
  2359. case "imgcat.pw":
  2360. case "imgseed.com":
  2361. case "imgcredit.xyz":
  2362. case "pic.hotimg.site":
  2363. case "xfap.fun":
  2364. case "xxxwebdlxxx.org":
  2365. i = q('img[src*="' + iurl + '/upload/"]');
  2366. break;
  2367. case "imgboom.net":
  2368. if(window.location.href.indexOf("img-") != -1)
  2369. {
  2370. window.location.href = "http://imgboom.net/view.php";
  2371. break;
  2372. }
  2373. case "thumbnailus.com":
  2374. case "imgleveret.com":
  2375. case "porn84.org":
  2376. i = q('input[type="submit"]');
  2377. dp=true;
  2378. if(i)
  2379. {
  2380. i.click();
  2381. break;
  2382. }
  2383. i = q('img[src*="' + iurl + '/upload/"].centred');
  2384. break;
  2385. case "imgking.co":
  2386. if(window.location.href.indexOf("img-") != -1)
  2387. {
  2388. window.location.href = window.location.href.replace("img-","img2-");
  2389. break;
  2390. }
  2391. i = q('img[src*="' + iurl + '/upload/"]');
  2392. break;
  2393. case "imgsky.net":
  2394. case "imgsee.net":
  2395. case "imgzong.xyz":
  2396. case "imageking.xyz":
  2397. case "imgxx.xyz":
  2398. case "imgao.xyz":
  2399. case "imgweng.xyz":
  2400. case "imgkes.xyz":
  2401. case "imgkoi.xyz":
  2402. case "imglin.xyz":
  2403. case "imgkr.xyz":
  2404. case "imgbird.xyz":
  2405. case "imgwewo.xyz":
  2406. case "imgirx.xyz":
  2407. case "imgalor.xyz":
  2408. case "imgjut.buzz":
  2409. case "imgtrw.buzz":
  2410. case "imglina.xyz":
  2411. case "imgkuiw.xyz":
  2412. case "imgwang.buzz":
  2413. case "imgmeno.buzz":
  2414. case "imgpekele.buzz":
  2415. case "imglqw.buzz":
  2416. case "imgyng.buzz":
  2417. case "imgbbd.buzz":
  2418. case "imgwia.buzz":
  2419. case "imgowk.buzz":
  2420. case "imgokr.buzz":
  2421. case "imgoiu.buzz":
  2422. case "imgeza.buzz":
  2423. case "mrlzqoe.buzz":
  2424. case "imgutkr.store":
  2425. case "imghhr.online":
  2426. case "imglaiw.store":
  2427. case "imgvue.online":
  2428. case "imgxgf.store":
  2429. case "imgbibam.online":
  2430. case "imgqaz.online":
  2431. case "imgurt.online":
  2432. case "imgwxr.online":
  2433. case "imgyre.online":
  2434. case "picqaxs.cfd":
  2435. case "picvvvd.sbs":
  2436. case "imgjjtr.sbs":
  2437. i = q('button');
  2438. dp=true;
  2439. j = true;
  2440. if(i)
  2441. {
  2442. i.click();
  2443. }
  2444. i = q('.big_img_box img[src*="http"]');
  2445. break;
  2446. case "picspornfree.me":
  2447. case "hotimage.uk":
  2448. case "xxxwebdlxxx.org":
  2449. case "hdmoza.com":
  2450. i = q('input[type="submit"]');
  2451. dp=true;
  2452. if(i)
  2453. {
  2454. i.click();
  2455. break;
  2456. }
  2457. case "avenuexxx.com":
  2458. case "uploadimagex.com":
  2459. case "hostingkartinok.com":
  2460. case "bellazon":
  2461. case "savepice.ru":
  2462. i = q('img[src*="/upload"]');
  2463. break;
  2464. case "imgseeds.com":
  2465. i = q('input');
  2466. if(i)
  2467. {
  2468. i.click();
  2469. break;
  2470. }
  2471. case "imghit.com":
  2472. i = q('img[alt="image"]');
  2473. break;
  2474. case "image-share.com":
  2475. i = q('img[src*="upload/"]');
  2476. break;
  2477. case "bilder-upload.eu":
  2478. i = q('input[src*="upload/"]');
  2479. break;
  2480. case "picload.org":
  2481. case "imagecross.com":
  2482. case "npicture.net":
  2483. case "public-pic.de":
  2484. case "picbug.ru":
  2485. i = q('img[src*="' + iurl + '/image"]');
  2486. break;
  2487. case "yande.re":
  2488. case "konachan.com":
  2489. case "konachan.net":
  2490. i = q('a[href*="' + iurl + '/image"]');
  2491. if(i){i.src = i.href;}
  2492. break;
  2493. case "imagesup.net":
  2494. i = q('a[href*="/di-"]');
  2495. if(i)
  2496. {
  2497. i.src = i.href;
  2498. }
  2499. break;
  2500. case "cyberpics.net":
  2501. case "fastimages.ru":
  2502. case "hot-file.org":
  2503. case "image.siroro.co.uk":
  2504. case "qattach.com":
  2505. case "fotohelp.kz":
  2506. case "pic-you.com":
  2507. i = q('a[href*="/di/"]');
  2508. if(i)
  2509. {
  2510. i.src = i.href;
  2511. }
  2512. break;
  2513. case "imagehost.thasnasty.com":
  2514. case "oxily.com":
  2515. case "ghanaimages.co":
  2516. case "knecht.novarata.net":
  2517. case "img.irandeliver.com":
  2518. case "xferz.com":
  2519. case "up.kfesfahan.com":
  2520. case "upload.khontai.com":
  2521. case "image.pantyhosemania.info":
  2522. case "t.hogor.net":
  2523. case "your-pictures.net":
  2524. i = q('a[href*="?di="]');
  2525. if(i)
  2526. {
  2527. i.src = i.href;
  2528. }
  2529. break;
  2530. case "pixxxels.org":
  2531. case "postimg.org":
  2532. case "postimg.cc":
  2533. case "pixxxels.cc":
  2534. j = true;
  2535. i = q('a[href*="?dl="]');
  2536. if(i)
  2537. {
  2538. i.src = i.href;
  2539. }
  2540. break;
  2541. case "zimage.fr":
  2542. i = q('img[src*="images.php"]');
  2543. if(i)
  2544. {
  2545. i.src = i.src.replace('.php?nom=', '/');
  2546. break;
  2547. }
  2548. case "dumppix.com":
  2549. i = q('a[href*="enter"]');
  2550. if(i)
  2551. {
  2552. window.location.href = i.href;
  2553. break;
  2554. }
  2555. case "mrjh.org":
  2556. case "stuffed.ru":
  2557. case "rapid-img.de":
  2558. case "ngarko.online.fr":
  2559. case "freeuploadimages.org":
  2560. case "picszone.net":
  2561. case "images.share-films.net":
  2562. case "bildjunkies.de":
  2563. case "foto.hcfor.pl":
  2564. case "pic.tooptarinha.com":
  2565. case "poopr.org":
  2566. case "xp-images.hi2.ro":
  2567. case "dayzeddesigns.com":
  2568. case "freeimghosting.co.uk":
  2569. case "upload.removed.us":
  2570. case "imghost.pl":
  2571. case "udostepniaj.pl":
  2572. case "ngarko.free.fr":
  2573. case "images.collectiontricks.it":
  2574. case "244pix.com":
  2575. case "imgboxxx.com":
  2576. case "imghere.net":
  2577. case "imgdope.com":
  2578. case "hostmat.eu":
  2579. case "imgdream.net":
  2580. case "imgcentral.com":
  2581. i = q('img[src*="images/"]');
  2582. break;
  2583. case "use.com":
  2584. i = q('img[src*="images/"][onload]');
  2585. if(i){i.src = i.src.replace('/s_2/', '/s_5/');}
  2586. break;
  2587. case "1y9y.com":
  2588. case "host4images.com":
  2589. case "aveimage.com":
  2590. i = q('img#photo');
  2591. break;
  2592. case "freeimgup.com":
  2593. case "picturevip.com":
  2594. case "image-load.net":
  2595. case "upload.djmaster.fr":
  2596. case "b4he.com":
  2597. case "firepic.org":
  2598. case "overdream.cz":
  2599. case "fastpics.net":
  2600. case "ii4.ru":
  2601. case "picuploader.de":
  2602. case "smages.com":
  2603. case "pictureshack.ru":
  2604. case "imgbox.de":
  2605. case "imagehosting.cz":
  2606. case "9foto.ru":
  2607. case "imagesloading.altervista.org":
  2608. case "phpbbmods.it":
  2609. case "lakhdaria.net":
  2610. case "partizansk.eu":
  2611. case "webjardiner.com":
  2612. case "imgup.com":
  2613. case "iezz.com":
  2614. case "picturescream.com":
  2615. case "all-poster.ru":
  2616. case "extraimage.net":
  2617. case "imagexxx18.com":
  2618. case "imgvisits.com":
  2619. case "imghall.com":
  2620. case "picturedent.org":
  2621. i = q('img[src*="/images/"]');
  2622. break;
  2623. case "intergranada.com":
  2624. i = q('img[src*="/images/images/"]');
  2625. break;
  2626. case "pixelup.net":
  2627. i = q('center img[src*="/images/"]');
  2628. break;
  2629. case "saveimg.ru":
  2630. case "imglink.ru":
  2631. case "4put.ru":
  2632. case "sharepic.biz":
  2633. case "you-logo.ru":
  2634. case "powerlogo.ru":
  2635. i = q('img[src*="pictures/"]');
  2636. break;
  2637. case "xenopix.com":
  2638. i = q('img[src*="/pix/"]');
  2639. break;
  2640. case "chronos.to":
  2641. case "imgmaid.net":
  2642. case "pic-maniac.com":
  2643. case "coreimg.net":
  2644. case "imx.to":
  2645. j = true;
  2646. i = q('input[type="submit"]');
  2647. dp=true;
  2648. if(i)
  2649. {
  2650. i.click();
  2651. break;
  2652. }
  2653. case "imgspice.com":
  2654. case "imagetwist.com":
  2655. case "dev.imagetwist.com":
  2656. case "imagexport.com":
  2657. case "pixroute.com":
  2658. case "pzy.be":
  2659. case "funkyimg.com":
  2660. case "itmages.ru":
  2661. case "imagenpic.com":
  2662. case "turbopix.fr":
  2663. case "pictureturn.com":
  2664. case "pixic.ru":
  2665. case "nyanimg.com":
  2666. case "geekpics.in":
  2667. case "imageporter.com":
  2668. case "imagenimage.com":
  2669. case "imageshimage.com":
  2670. case "imagedax.net":
  2671. case "pornimagex.com":
  2672. case "sendpic.org":
  2673. case "imagehaha.com":
  2674. case "picshick.com":
  2675. case "photo-screen.ru":
  2676. i = q('img[src*="/i/"]');
  2677. break;
  2678. case "imguniversal.com":
  2679. case "imgclick.net": // no submits
  2680. case "imgsto.com":
  2681. case "fappic.com":
  2682. case "imgsen.com":
  2683. case "premalo.com":
  2684. case "picdollar.com":
  2685. case "fotokiz.com":
  2686. case "silverpic.com":
  2687. case "pics4upload.com":
  2688. case "imgstar.eu":
  2689. i = q("form input[type='submit'][value*='continue to image' i]");
  2690. dp = true;
  2691. if(i)
  2692. {
  2693. i.click();
  2694. }
  2695. i = q("img.pic[src*='/i/'], img.pic[src*='/img/']");
  2696. break;
  2697. case "scrin.org":
  2698. i = q('a[href*="/i/"]');
  2699. if(i)
  2700. {
  2701. i.src = i.href;
  2702. break;
  2703. }
  2704. i = q('img[src*="/i/"]');
  2705. break;
  2706. case "miragepics.com":
  2707. i = q('input[value*="' + iurl + '/images/"]');
  2708. if(i){i.src = i.value;}
  2709. break;
  2710. case "ipic.su":
  2711. i = q('input[value*="' + iurl + ' img/"]');
  2712. if(i){i.src = i.value;}
  2713. break;
  2714. case "mixbase.net":
  2715. i = q('img[src*="media/storage/"]');
  2716. break;
  2717. case "image2you.ru":
  2718. i = q('img[src*="images/"]');
  2719. if(i){i.src = i.src.replace('2_', '');}
  2720. break;
  2721. case "imgmade.com":
  2722. i = q('form');
  2723. dp=true;
  2724. if(i)
  2725. {
  2726. i.submit();
  2727. break;
  2728. }
  2729. case "imgdrive.net":
  2730. case "imgtaxi.com":
  2731. case "imgwallet.com":
  2732. j = true;
  2733. i = q("a.overlay_ad_link");
  2734. if(i)
  2735. {
  2736. i.click();
  2737. break;
  2738. }
  2739. case "pixhost.to":
  2740. case "imgtiger.com":
  2741. case "imgserve.net":
  2742. case "imgdino.com":
  2743. case "overpic.net":
  2744. case "imagesocket.com":
  2745. case "hostpic.org":
  2746. case "zapodaj.net":
  2747. case "jpegshare.net":
  2748. case "screenshot.ru":
  2749. case "imagefile.org":
  2750. case "zapisz.net":
  2751. case "addyourpics.com":
  2752. case "imgbank.cz":
  2753. case "showmyimage.com":
  2754. case "upload.supreme-elite.fr":
  2755. case "myimg.me":
  2756. case "heberg-hush.org":
  2757. case "oltaciyukle.com":
  2758. case "pichost.name":
  2759. case "imagend.com":
  2760. case "imagerocket.com":
  2761. case "hyyathost.com":
  2762. case "images.reptilescanada.com":
  2763. case "wepic.ru":
  2764. case "upload-image.fr":
  2765. case "images.baconbits.org":
  2766. case "upanh.ovo.vn":
  2767. case "wrzucaj.net":
  2768. case "heberge-images.com":
  2769. case "image.kg":
  2770. case "savemyimage.com":
  2771. case "img.dramacafe.tv":
  2772. case "fapping.empornium.sx":
  2773. case "beeimg.com":
  2774. case "youpicture.org":
  2775. case "vavvi.com":
  2776. case "imgzap.com":
  2777. case "crazyimg.com":
  2778. case "extraimago.com":
  2779. case "ftop.ru":
  2780. case "porncomix.info":
  2781. case "luxpic.ru":
  2782. case "passpix.com":
  2783. case "trumbhost.com":
  2784. //Chevereto 2.x
  2785. i = q('img[src*="' + iurl + '/images/"]');
  2786. break;
  2787. case "shareimages.com":
  2788. case "imagesmax.de":
  2789. case "bilder.nixhelp.de":
  2790. i = q('img[src*="' + iurl + '/images"]');
  2791. break;
  2792. case "imgfantasy.com":
  2793. case "imageporn.eu":
  2794. case "imgsmile.com":
  2795. case "imgsay.com":
  2796. case "0img.net":
  2797. case "imagedisco.net":
  2798. //IMGReserve
  2799. j = true;
  2800. dp=true;
  2801. i = q('input[value="YES"]');
  2802. if(i){i.onclick();break;}
  2803. case "pic-upload.de":
  2804. case "shrani.najdi.si":
  2805. case "imageab.com":
  2806. case "turboimagehost.com":
  2807. i = q('img[onclick*="(this"]');
  2808. break;
  2809. case "joblo.com":
  2810. i = q('img');
  2811. if(i)
  2812. {
  2813. i.src = "http://www.joblo.com/moviehotties/images/profile-gallery/orig" + window.location.href.substr(window.location.href.lastIndexOf("/"));
  2814. }
  2815. break;
  2816. case "img.folluo.me":
  2817. case "sizzlingclicks.com":
  2818. case "imgsha.com":
  2819. i = q('img[data-load="full"]');
  2820. break;
  2821. case "yapx.ru":
  2822. j = true;
  2823. if(q("footer"))
  2824. {
  2825. f = document.body.querySelectorAll("[data-gallery-index]");
  2826. if(f.length === 1)
  2827. {
  2828. //i = f[0];
  2829. i = document.head.querySelector('meta[property="og:image:secure_url"]');
  2830. if(i)
  2831. {
  2832. i.src = i.content;
  2833. }
  2834. }
  2835. else
  2836. {
  2837. is_gallery = true;
  2838. }
  2839. }
  2840. break;
  2841. case "vfl.ru":
  2842. i = q('img[src*="/ii/"]');
  2843. break;
  2844. case "suckmypic.net":
  2845. i = q('#theImage');
  2846. break;
  2847. case "piccy.info":
  2848. i = q('a[href*="/orig/"]');
  2849. if(i){i.click();return;}
  2850. else{i = q('img#mainim');}
  2851. break;
  2852. case "t.me":
  2853. case "telegram.me":
  2854. j = true;
  2855. if(document.querySelector("body.body_widget_post"))
  2856. {
  2857. f = document.querySelectorAll('.tgme_widget_message_photo_wrap[style*="/file/"]');
  2858. if(f.length === 1)
  2859. {
  2860. i = f[0];
  2861. i.src = i.style.backgroundImage.slice(4, -1).replace(/"/g, "");
  2862. if(window.self !== window.top)
  2863. {
  2864. window.top.location.href = window.self.location.href;
  2865. }
  2866. }
  2867. }
  2868. break;
  2869. case "comment-cdn.9gag.com":
  2870. i = q('img');
  2871. if(i) {i.src = window.location.hash.substring(1,window.location.hash.length);}
  2872. break;
  2873. case "xhamster.com":
  2874. case "xhamster.desi":
  2875. case "xhamster3.com":
  2876. case "xhamster4.com":
  2877. case "xhamster11.com":
  2878. case "xhamster19.com":
  2879. j = true;
  2880. i = q('div.fotorama__active>img.fotorama__img');
  2881. break;
  2882. case "imgtorrnt.in":
  2883. window.location.replace("https://i.imgur.com/" + window.location.href.substr(window.location.href.lastIndexOf('=') + 1));
  2884. case "trans.firm.in":
  2885. if(window.location.href.search(/\.(?:jpe?g|png|gif|webp)\.html$/i) != -1)//check whether it's a valid image url
  2886. {
  2887. i = { src : window.location.href.replace(".html", "") };
  2888. }
  2889. case "vipr.im":
  2890. j = true;
  2891. i = q("a.ddownloader[download]");
  2892. if(i)
  2893. {
  2894. i.src = i.href;
  2895. break;
  2896. }
  2897. break;
  2898. default: // dynamic subdomain
  2899. switch(host.substr(host.indexOf(".")+1))
  2900. {
  2901. case "xhamster.com":
  2902. case "xhamster.desi":
  2903. case "xhamster3.com":
  2904. case "xhamster4.com":
  2905. case "xhamster11.com":
  2906. case "xhamster19.com":
  2907. j = true;
  2908. i = q('div.fotorama__active>img.fotorama__img');
  2909. break;
  2910. case "tumblr.com":
  2911. case "media.tumblr.com":
  2912. f = document.head.querySelectorAll('meta[property="og:image"]');
  2913. if(f.length === 1)
  2914. {
  2915. i = document.head.querySelector('meta[property="og:video"]');
  2916. if(!i)
  2917. {
  2918. i = f[0];
  2919. i.src = f[0].content;
  2920. }
  2921. else
  2922. {
  2923. i.src = i.content;
  2924. }
  2925. }
  2926. else if(f.length > 1)
  2927. {
  2928. is_gallery = true;
  2929. }
  2930. else
  2931. {
  2932. i = document.querySelector('div#base-container > div > div > div > div > img');
  2933. }
  2934. break;
  2935. case "wikipedia.org":
  2936. case "wikimedia.org":
  2937. i = q('a[href*="/upload"]');
  2938. if(i){i.src = i.href;}
  2939. break;
  2940. case "imgcredit.xyz":
  2941. i = q('img[src*="/upload/"]');
  2942. break;
  2943. case "photobucket.com":
  2944. find_text_in_scripts('originalUrl":"', '"');
  2945. break;
  2946. case "lostpic.net":
  2947. //chevereto 3.x
  2948. i = document.head.querySelector('link[rel="image_src"]');
  2949. if(i)
  2950. {
  2951. i.src = i.href;
  2952. }
  2953. break;
  2954. case "freeamateurteens.net":
  2955. i = q('img[src*="images/"]');
  2956. break;
  2957. case "otofotki.pl":
  2958. i = q('img[src*="/obrazki/"]');
  2959. break;
  2960. case "tinypic.com":
  2961. i = q('img#imgElement');
  2962. break;
  2963. case "imagilive.com":
  2964. i = q('a.button');
  2965. if(i)
  2966. {
  2967. dp=true;
  2968. i.click();
  2969. break;
  2970. }
  2971. i = q('img[src*="' + iurl + '"]');
  2972. break;
  2973. default: // for user-added sites
  2974. j = true;
  2975. console.warn("HJI is running on a custom website");
  2976.  
  2977. if(document.readyState !== "loading") // DOM loaded
  2978. {
  2979. f = document.querySelectorAll("img");
  2980. if(f.length !== 0)
  2981. {
  2982. let b = 0;
  2983. for(let n = 0; n < f.length; n++)
  2984. {
  2985. if(f[n].naturalWidth == 0 && !f[n].complete) // not yet loaded
  2986. {
  2987. if(timeout < 4000)
  2988. {
  2989. console.warn("waiting for this image to start loading to see its size and compare with others: ", f[n]);
  2990. b = -1;
  2991. break;
  2992. }
  2993. else // waited for 3+ sec, that's enough
  2994. {
  2995. console.warn("skipping broken images");
  2996. continue; // skip the broken image
  2997. }
  2998. }
  2999. else if(f[n].naturalWidth * f[n].naturalHeight >= f[b].naturalWidth * f[b].naturalHeight)
  3000. {
  3001. b = n;
  3002. }
  3003. }
  3004. if(b !== -1){i = f[b]; console.warn("showing biggest image");}
  3005. }
  3006. }
  3007. break;
  3008. }
  3009. break;
  3010. }
  3011. //
  3012. //firefox handmade noscript
  3013. if(!j)
  3014. {
  3015. j = true;
  3016. window.addEventListener('beforescriptexecute', onscript, true); // useless, but let it be
  3017. bStopScripts = true; // actually better than the event above, blocks more stuff for some reason
  3018. }
  3019. //
  3020. if(tb){window.clearTimeout(tb);}
  3021. if(is_gallery)
  3022. {
  3023. console.log("Handy Image: userscript stopped itself INTENTIONALLY, - cuz it is not just a single image on the page to fullsize but a gallery");
  3024. observer.disconnect();
  3025. return;
  3026. }
  3027. if(i && i.src)
  3028. {
  3029. bStopScripts = true; // in case JS was allowed before
  3030. observer.disconnect();
  3031. function clr_pgn()
  3032. {
  3033. unsafeWindow.open = null;
  3034. unsafeWindow.onload = null;
  3035. unsafeWindow.onbeforeunload = null;
  3036. document.replaceChild(document.importNode(document.implementation.createHTMLDocument("").documentElement, true), document.documentElement);
  3037. unsafeWindow.document.createElement = unsafeWindow.console.debug;
  3038. document.head.innerHTML = '<meta name="referrer" content="'+referrer_policy+'">';
  3039. }
  3040. if (i.nodeName === "VIDEO" || ext_list_video.indexOf(i.src.split('.').pop().split('?')[0].toLowerCase()) >= 0)
  3041. {
  3042. console.log("Found a video");
  3043. is_video = true;
  3044. }
  3045. else if (ext_list_not_image.indexOf(i.src.split('.').pop().split('?')[0].toLowerCase()) >= 0)
  3046. {
  3047. console.warn("What we found is not an image or a video");
  3048. i = null;
  3049. return false;
  3050. }
  3051. ws();
  3052. sanitize();
  3053. clr_pgn();
  3054. window.removeEventListener('beforescriptexecute', onscript, true);
  3055. makeimage();
  3056. }
  3057. else // try again
  3058. {
  3059. //console.warn("Didnt find image, trying again in " + timeout + " ms");
  3060. 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);
  3061. }
  3062. }
  3063.  
  3064. var grab_fav_tags = []; // set in Custom JS
  3065. function use_booru_tags_in_dl_filename()
  3066. {
  3067. 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");
  3068. for(let n = 0; n < artist.length; n++)
  3069. {
  3070. if(artist[n].text == "?") continue;
  3071. filename = "by " + artist[n].text.replaceAll(" ", "_") + " " + filename;
  3072. }
  3073.  
  3074. let character = document.querySelectorAll(".tag-type-character a:not([href*='/books?'])[href*='tags='], .character-tag > a, .character-tag-list a.search-tag, a.character");
  3075. for(let n = 0; n < character.length; n++)
  3076. {
  3077. if(character[n].text == "?") continue;
  3078. filename = character[n].text.replaceAll(" ", "_") + " " + filename;
  3079. }
  3080.  
  3081. /*if(character.length === 0)
  3082. {
  3083. let franchise = document.querySelectorAll(".tag-type-copyright > a, .copyright-tag > a, .copyright-tag-list a.search-tag");
  3084. for(let n = 0; n < franchise.length; n++)
  3085. {
  3086. if(franchise[n].text == "?") continue;
  3087. filename = franchise[n].text.replaceAll(" ", "_") + " " + filename;
  3088. break; // just one cuz else it'd get long
  3089. }
  3090. }*/
  3091. 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");
  3092.  
  3093. function do_grab_fav_tags()
  3094. {
  3095. if(typeof cfg_js !== "string")
  3096. {
  3097. console.log("waiting for async setting loading of cfg_js: " + (typeof cfg_js));
  3098. tg = window.setTimeout(do_grab_fav_tags, 2);
  3099. return;
  3100. }
  3101. if(cfg_js && cfg_js.indexOf("grab_fav_tags") != -1) {grab_fav_tags = cfg_js.substring(cfg_js.indexOf("[")+1,cfg_js.indexOf("]")).replaceAll(" ", "").replaceAll("_", " ").replaceAll(/\n/g, '').replaceAll("'", "").replaceAll('"','').toLowerCase().split(",");} // load custom tags // also bypass CSP
  3102. console.debug("your favorite tags: "+ grab_fav_tags);
  3103. if(grab_fav_tags.length)
  3104. {
  3105. for(let n = 0; n < general_tags.length; n++)
  3106. {
  3107. if(general_tags[n].text == "?") continue;
  3108. if(grab_fav_tags.indexOf(general_tags[n].text.toLowerCase().replaceAll("_", " ")) != -1)
  3109. {
  3110. filename = general_tags[n].text.replaceAll(" ", "_") + " " +filename;
  3111. }
  3112. }
  3113. }
  3114. filename = filename.replaceAll("_(", " ("); // but not the space before franchise
  3115. }
  3116. do_grab_fav_tags();
  3117. }
  3118.  
  3119. function onvolumechange()
  3120. {
  3121. GM.setValue("vid_volume", (i.muted? "0" : i.volume));
  3122. }
  3123.  
  3124. function changeCursor()
  3125. {
  3126. /*if(i.scrollHeight > iViewHeight) // image pushing out-of-screen browser fix
  3127. {
  3128. i.style.margin = "0px auto";
  3129. }
  3130. else
  3131. {
  3132. i.style.margin = "auto";
  3133. }*/
  3134.  
  3135. if(is_video) return;
  3136.  
  3137. if(rescaled === 0) // original
  3138. {
  3139. if((orgImgWidth == viewWidth && orgImgHeight <= viewHeight) || (orgImgWidth <= viewWidth && orgImgHeight == viewHeight)) // perfect fit on one side, can't resize
  3140. { // 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
  3141. i.style.cursor = "";
  3142. }
  3143. else if (orgImgWidth > viewWidth || orgImgHeight > viewHeight)
  3144. {
  3145. i.style.cursor = "zoom-out";
  3146. }
  3147. else
  3148. {
  3149. i.style.cursor = "zoom-in";
  3150. }
  3151. }
  3152. else if(rescaled === 2) // fill
  3153. {
  3154. if(orgImgWidth == viewWidth && orgImgHeight == viewHeight) // perfect fit, can't resize
  3155. {
  3156. i.style.cursor = "";
  3157. }
  3158. else if (orgImgWidth > i.scrollWidth)
  3159. {
  3160. i.style.cursor = "zoom-in";
  3161. }
  3162. else
  3163. {
  3164. i.style.cursor = "zoom-out";
  3165. }
  3166. }
  3167. else // if(rescaled === 1) // fit
  3168. {
  3169. if((orgImgWidth == viewWidth && orgImgHeight <= viewHeight) || (orgImgWidth <= viewWidth && orgImgHeight == viewHeight)) // perfect fit on one side, can't resize
  3170. {
  3171. i.style.cursor = "";
  3172. }
  3173. else if (orgImgWidth > i.scrollWidth)
  3174. {
  3175. i.style.cursor = "zoom-in";
  3176. }
  3177. else
  3178. {
  3179. i.style.cursor = "zoom-out";
  3180. }
  3181. }
  3182. }
  3183.  
  3184. function mousedown(event) // chrome scroll-wheel
  3185. {
  3186. if(event.which === 2) // middle mouse
  3187. {
  3188. event.preventDefault();
  3189. event.stopImmediatePropagation();
  3190. return;
  3191. }
  3192. }
  3193.  
  3194. let viewHeight;
  3195. let viewWidth;
  3196.  
  3197. function onWindowResize()
  3198. {
  3199. viewHeight = window.innerHeight; //Math.round(window.visualViewport.height);
  3200. viewWidth = window.innerWidth; //Math.round(window.visualViewport.width);
  3201. //console.debug("not including scrollbar: iViewHeight: " + window.visualViewport.height + ", iViewWidth:" +window.visualViewport.width );
  3202. //console.debug("including scrollbar: iViewHeight: " + window.innerHeight + ", iViewWidth:" +window.innerWidth );
  3203. }
  3204.  
  3205. let bZoomCenterOnCursor = true; // setting to change in custom JS
  3206.  
  3207. function rescale(oEvent, isFilling)
  3208. {
  3209. let click_X, click_Y;
  3210. if(oEvent) // mouse click
  3211. {
  3212. if(oEvent.which === 3) // right mouse
  3213. {
  3214. return;
  3215. }
  3216. else if(oEvent.which === 2) // middle mouse
  3217. {
  3218. isFilling = true;
  3219. oEvent.preventDefault(); // drag scroll
  3220. oEvent.stopImmediatePropagation();
  3221. }
  3222. click_X = oEvent.clientX - i.offsetLeft;
  3223. click_Y = oEvent.clientY - i.offsetTop;
  3224. }
  3225. //let unFilling = false;
  3226. //document.body.style.overflowX = '';
  3227. //document.body.style.overflowY = '';
  3228. //let iScrollMax_V = document.documentElement.scrollHeight - iViewHeight; // FireFox (only) has window.scrollMaxY
  3229. //let iScrollMax_H = document.documentElement.scrollWidth - iViewWidth;
  3230.  
  3231. let imgPrevWidth = i.scrollWidth;
  3232. let imgPrevHeight = i.scrollHeight;
  3233. let prevScroll_Y = Math.round(window.visualViewport.pageTop);
  3234. let prevScroll_X = Math.round(window.visualViewport.pageLeft);
  3235.  
  3236. let bSidesCMP;
  3237. if(isFilling)
  3238. {
  3239. if(rescaled === 2) // to original
  3240. {
  3241. rescaled = 0;
  3242. i.style.width = orgImgWidth + "px";
  3243. i.style.height = orgImgHeight + "px";
  3244. }
  3245. else // fill
  3246. {
  3247. bSidesCMP = (orgImgWidth / orgImgHeight) < (viewWidth / viewHeight);
  3248. rescaled = 2;
  3249. }
  3250. }
  3251. else
  3252. {
  3253. if(rescaled != 0) // to original
  3254. {
  3255. //if(rescaled === 2) {unFilling = true;}
  3256. rescaled = 0;
  3257. i.style.width = orgImgWidth + "px";
  3258. i.style.height = orgImgHeight + "px";
  3259. }
  3260. else // fit
  3261. {
  3262. bSidesCMP = (orgImgWidth / orgImgHeight) > (viewWidth / viewHeight);
  3263. rescaled = 1;
  3264. }
  3265. }
  3266.  
  3267. if(rescaled != 0)
  3268. {
  3269. if(bSidesCMP)
  3270. {
  3271. i.style.width = "100%";
  3272. i.style.height = "auto";
  3273. //document.body.style.overflowX = 'hidden'; // we don't need unscrollable scrollbars if they appear
  3274. }
  3275. else
  3276. {
  3277. i.style.height = "100%";
  3278. i.style.width = "auto";
  3279. //document.body.style.overflowY = 'hidden'; // we don't need unscrollable scrollbars if they appear
  3280. }
  3281. }
  3282.  
  3283. changeCursor();
  3284. let newToOldImgScale_X = i.scrollWidth / imgPrevWidth;
  3285. let newToOldImgScale_Y = i.scrollHeight / imgPrevHeight;
  3286. click_X *= newToOldImgScale_X;
  3287. click_Y *= newToOldImgScale_Y;
  3288. prevScroll_X *= newToOldImgScale_X;
  3289. prevScroll_Y *= newToOldImgScale_Y;
  3290.  
  3291. if(oEvent)
  3292. {
  3293. if(bZoomCenterOnCursor)
  3294. { // 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)
  3295. window.scrollTo(click_X + prevScroll_X - oEvent.clientX, click_Y + prevScroll_Y - oEvent.clientY);
  3296. }
  3297. else
  3298. { // 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)
  3299. window.scrollTo(click_X + prevScroll_X - viewWidth / 2, click_Y + prevScroll_Y - viewHeight / 2);
  3300. }
  3301. }
  3302. else // keep percentage scroll progress for KB hotkeys
  3303. { // 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
  3304. window.scrollTo(prevScroll_X, prevScroll_Y);
  3305. }
  3306. }
  3307.  
  3308. var ARC = 0;
  3309. function autoresize()
  3310. {
  3311. if((!is_video && i.naturalHeight) || i.videoHeight)
  3312. {
  3313. orgImgWidth = Math.round((is_video ? i.videoWidth : i.naturalWidth) / window.devicePixelRatio);
  3314. orgImgHeight = Math.round((is_video ? i.videoHeight : i.naturalHeight) / window.devicePixelRatio);
  3315. i.style.width = orgImgWidth + "px";
  3316. i.style.height = orgImgHeight + "px";
  3317. let title = i.src.substr(i.src.lastIndexOf("/")+1);
  3318. if(title.indexOf("?") != -1)
  3319. {
  3320. title = title.substr(0, title.indexOf("?"));
  3321. }
  3322. title = decodeURIComponent(title);
  3323. if(is_video)
  3324. {
  3325. document.title = title + " (" + i.videoWidth + "x" + i.videoHeight + ")";
  3326. }
  3327. else
  3328. {
  3329. document.title = title + " (" + i.naturalWidth + "x" + i.naturalHeight + ")";
  3330. }
  3331. if(filename && filename.lastIndexOf(" ") != filename.length-1) {filename += " ";}
  3332. if(filename_ext) {filename_ext = "." + filename_ext;}
  3333. filename = filename + title + filename_ext;
  3334. /*let link = protected_createElement('link');
  3335. link.rel = 'icon';
  3336. link.href = i.src;
  3337. document.head.appendChild(link);*/ // big lag in general from this feature
  3338. let InitRescale = false;
  3339. if(cfg_fitWH && orgImgHeight > viewHeight && orgImgWidth > viewWidth) // both scrollbars
  3340. {
  3341. InitRescale = true;
  3342. }
  3343. else if(cfg_fitB && (orgImgHeight > viewHeight || orgImgWidth > viewWidth)) // one scrollbar
  3344. {
  3345. InitRescale = true;
  3346. }
  3347. else if(cfg_fitS && orgImgHeight <= viewHeight && orgImgWidth <= viewWidth) // no scrollbars
  3348. {
  3349. InitRescale = true;
  3350. }
  3351. if(InitRescale)
  3352. {
  3353. rescale(null, cfg_fitOS ? true : false);
  3354. }
  3355. else
  3356. {
  3357. changeCursor();
  3358. }
  3359. bStopScripts = false; // should be safe now, right?
  3360. if(cfg_js){eval(cfg_js);}
  3361. }
  3362. else // no onloadstart event for images, sadge
  3363. {
  3364. ARC++;
  3365. if(ARC < 1000)
  3366. {
  3367. if(ARC == 75 || ARC == 300 || ARC == 999) // about 1sec, 5sec, 15sec
  3368. {
  3369. i.src = i.src; // lol fix
  3370. console.warn("HJI: Trying to reload the image, " + ARC);
  3371. }
  3372. window.setTimeout(autoresize, 10);
  3373. }
  3374. else
  3375. {
  3376. console.warn("HJI: Gave up trying to reload the image, it is broken");
  3377. i.onload = autoresize; // not really gave up
  3378. }
  3379. }
  3380. }
  3381.  
  3382. var observer = new MutationObserver((mutations) => {
  3383.  
  3384. makeworld();
  3385.  
  3386. if(bStopScripts) // Chrome handmade NoScript
  3387. {
  3388. for (const m of mutations)
  3389. {
  3390. for (const n of m.addedNodes)
  3391. {
  3392. if(n.tagName === "SCRIPT")
  3393. {
  3394. //console.debug("HJI: Script was stopped from loading: ", n);
  3395. console.debug( "HJI: stopped 1 script from loading ");
  3396. n.textContent = "";
  3397. n.remove();
  3398. }
  3399. }
  3400. }
  3401. }
  3402. });
  3403. observer.observe(document, {subtree: true, childList: true});
  3404.  
  3405. // hotkeys
  3406. if (typeof KeyEvent === "undefined") // only defined in FireFox
  3407. {
  3408. window.KeyEvent = {
  3409. DOM_VK_SPACE: 32,
  3410. DOM_VK_LEFT: 37,
  3411. DOM_VK_UP: 38,
  3412. DOM_VK_RIGHT: 39,
  3413. DOM_VK_DOWN: 40,
  3414. DOM_VK_A: 65,
  3415. DOM_VK_D: 68,
  3416. DOM_VK_P: 80,
  3417. DOM_VK_Q: 81,
  3418. DOM_VK_R: 82,
  3419. DOM_VK_S: 83,
  3420. DOM_VK_W: 87,
  3421. DOM_VK_M: 77,
  3422. DOM_VK_F: 70,
  3423. DOM_VK_NUMPAD2: 98,
  3424. DOM_VK_NUMPAD4: 100,
  3425. DOM_VK_NUMPAD5: 101,
  3426. DOM_VK_NUMPAD6: 102,
  3427. DOM_VK_NUMPAD8: 104,
  3428. DOM_VK_F5: 116,
  3429. DOM_VK_TAB: 9,
  3430. DOM_VK_ENTER: 13
  3431. };
  3432. }
  3433.  
  3434. function cancelEvent(a)
  3435. {
  3436. a = a ? a : window.event;
  3437. if (a.stopPropagation)
  3438. {
  3439. a.stopPropagation();
  3440. }
  3441. if (a.stopImmediatePropagation)
  3442. {
  3443. a.stopImmediatePropagation();
  3444. }
  3445. if (a.preventDefault)
  3446. {
  3447. a.preventDefault();
  3448. }
  3449. a.cancelBubble = true;
  3450. a.cancel = true;
  3451. a.returnValue = false;
  3452. return false;
  3453. }
  3454.  
  3455. function scroll_space(a, b)
  3456. {
  3457. let by = Math.round((b ? viewHeight : viewWidth) * 0.50 * (a ? -1 : 1));
  3458. if(!b)
  3459. {
  3460. window.scrollBy(0, by);
  3461. }
  3462. else
  3463. {
  3464. window.scrollBy(by, 0);
  3465. }
  3466. }
  3467.  
  3468. function download_image()
  3469. {
  3470. if(i && i.src)
  3471. {
  3472. filename = filename.replace(/[/\\?%*:|"<>]/g, '_'); // characters you can't use in filenames
  3473. let details = { url: i.src,
  3474. headers: referrer_policy !== "no-referrer" ? {'Referer': window.location.href} : {}, // doesn't fully follow the page's referer policy but ok
  3475. name: bUseCustomFilename !== false ? filename : null,
  3476. saveAs: true };
  3477. console.log('downloading: ' + filename + " from: " + i.src);
  3478. details.onload = () => { console.log('download complete'); };
  3479. details.ontimeout = () => { console.error('download timeout'); };
  3480. details.onerror = (error, errorDetails) => { console.error('download failed', error, errorDetails); };
  3481. GM_download(details);
  3482. }
  3483. }
  3484.  
  3485. function onkeydown (b)
  3486. {
  3487. let a = (window.event) ? b.keyCode : b.which;
  3488.  
  3489. if(b.ctrlKey && a == KeyEvent.DOM_VK_S)
  3490. {
  3491. cancelEvent(b);
  3492. download_image();
  3493. return;
  3494. }
  3495. if (b.altKey || b.metaKey || (b.ctrlKey && a != KeyEvent.DOM_VK_SPACE && a != KeyEvent.DOM_VK_F5 && a != KeyEvent.DOM_VK_R))
  3496. {
  3497. return;
  3498. }
  3499.  
  3500. let by = Math.round(viewHeight * 0.10);
  3501.  
  3502. switch (a)
  3503. {
  3504. case KeyEvent.DOM_VK_RIGHT:
  3505. case KeyEvent.DOM_VK_D:
  3506. case KeyEvent.DOM_VK_NUMPAD6:
  3507. if(!is_video)
  3508. {
  3509. window.scrollBy(by, 0);
  3510. cancelEvent(b);
  3511. }
  3512. else
  3513. {
  3514. i.currentTime += skip_by;
  3515. }
  3516. break;
  3517. case KeyEvent.DOM_VK_LEFT:
  3518. case KeyEvent.DOM_VK_A:
  3519. case KeyEvent.DOM_VK_NUMPAD4:
  3520. if(!is_video)
  3521. {
  3522. window.scrollBy(by * -1, 0);
  3523. cancelEvent(b);
  3524. }
  3525. else
  3526. {
  3527. i.currentTime -= skip_by;
  3528. }
  3529. break;
  3530. case KeyEvent.DOM_VK_W:
  3531. case KeyEvent.DOM_VK_NUMPAD8:
  3532. window.scrollBy(0, by * -1);
  3533. cancelEvent(b);
  3534. break;
  3535. case KeyEvent.DOM_VK_S:
  3536. case KeyEvent.DOM_VK_NUMPAD2:
  3537. window.scrollBy(0, by);
  3538. cancelEvent(b);
  3539. break;
  3540. case KeyEvent.DOM_VK_SPACE:
  3541. if(!is_video)
  3542. {
  3543. scroll_space(b.shiftKey, b.ctrlKey);
  3544. }
  3545. else if(i.paused || i.ended)
  3546. {
  3547. i.play();
  3548. }
  3549. else
  3550. {
  3551. i.pause();
  3552. }
  3553. cancelEvent(b);
  3554. break;
  3555. case KeyEvent.DOM_VK_M:
  3556. i.muted = !i.muted;
  3557. cancelEvent(b);
  3558. break;
  3559. case KeyEvent.DOM_VK_F:
  3560. i.requestFullscreen();
  3561. cancelEvent(b);
  3562. break;
  3563. case KeyEvent.DOM_VK_TAB:
  3564. case KeyEvent.DOM_VK_ENTER:
  3565. rescale(null, true);
  3566. cancelEvent(b);
  3567. break;
  3568. case KeyEvent.DOM_VK_Q:
  3569. case KeyEvent.DOM_VK_NUMPAD5:
  3570. rescale(null, false);
  3571. cancelEvent(b);
  3572. break;
  3573. case KeyEvent.DOM_VK_P:
  3574. cfg();
  3575. cancelEvent(b);
  3576. break;
  3577. case KeyEvent.DOM_VK_R:
  3578. if(!b.ctrlKey)
  3579. {
  3580. sessionStorage.hji = window.location.href;
  3581. window.location.reload();
  3582. cancelEvent(b);
  3583. }
  3584. else
  3585. {
  3586. window.removeEventListener("beforeunload", onbeforeunload, true);
  3587. }
  3588. break;
  3589. case KeyEvent.DOM_VK_F5:
  3590. window.removeEventListener("beforeunload", onbeforeunload, true);
  3591. break;
  3592. }
  3593. }
  3594.  
  3595. function cfg()
  3596. {
  3597. if (typeof GM.setValue !== "undefined")
  3598. {
  3599. function saveCfg()
  3600. {
  3601. GM.setValue("directImage", q("#hji_cfg_1_direct").checked);
  3602. GM.setValue("bgColor", q("#hji_cfg_2_bgclr").value);
  3603. GM.setValue("fitWH", q("#hji_cfg_3_fitWH").checked);
  3604. GM.setValue("fitB", q("#hji_cfg_4_fitB").checked);
  3605. GM.setValue("fitS", q("#hji_cfg_5_fitS").checked);
  3606. GM.setValue("fitOS", q("#hji_cfg_7_fitOS").checked);
  3607. GM.setValue("js", q("#hji_cfg_6_js").value);
  3608. alert("Configuration Saved");
  3609. if(q("#hji_cfg_2_bgclr").value){document.body.style.backgroundColor = q("#hji_cfg_2_bgclr").value;}else{document.body.style.backgroundColor = "";}
  3610. }
  3611. if(i && i.src)
  3612. {
  3613. i.removeEventListener("click", rescale, true);
  3614. i.removeEventListener("auxclick", rescale, true);
  3615. i.removeEventListener("mousedown", mousedown, true);
  3616. }
  3617. window.removeEventListener("keydown", onkeydown, true);
  3618. document.head.innerHTML = "";
  3619. document.body.innerHTML = "";
  3620. ws();
  3621. let div = protected_createElement("div");
  3622. 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
  3623. div.innerHTML = "<b><center>Configuration</center></b><br><input id='hji_cfg_1_direct' type='checkbox'> Open images directly with browser (disables Handy)"
  3624. + "<br><br><input id='hji_cfg_2_bgclr' style='color: inherit; background: inherit;' type='text' size='6'> Background color (empty = default)"
  3625. + "<br><br>Fit to window images:" + " ( Fill to window instead <input id='hji_cfg_7_fitOS' type='checkbox'> )"
  3626. + "<br><br><input id='hji_cfg_3_fitWH' type='checkbox'> Larger than window both vertically and horizontally"
  3627. + "<br><br><input id='hji_cfg_4_fitB' type='checkbox'> Larger than window either vertically or horizontally"
  3628. + "<br><br><input id='hji_cfg_5_fitS' type='checkbox'> Smaller than window"
  3629. + "<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>"
  3630. + "<br><input id='hji_cfg_save' style='color: inherit; background: inherit;' type='button' value='Save configuration'></center>";
  3631. document.body.appendChild(div);
  3632. q("#hji_cfg_1_direct").checked = cfg_direct;
  3633. q("#hji_cfg_2_bgclr").value = cfg_bgclr;
  3634. q("#hji_cfg_3_fitWH").checked = cfg_fitWH;
  3635. q("#hji_cfg_4_fitB").checked = cfg_fitB;
  3636. q("#hji_cfg_5_fitS").checked = cfg_fitS;
  3637. q("#hji_cfg_7_fitOS").checked = cfg_fitOS;
  3638. q("#hji_cfg_6_js").value = cfg_js;
  3639. q("#hji_cfg_save").addEventListener("click", saveCfg, true);
  3640. }
  3641. else
  3642. {
  3643. 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)");
  3644. }
  3645. }
  3646.  
  3647. var loadCfg;
  3648. if (typeof GM === 'undefined') // GM3 or native
  3649. {
  3650. if (typeof GM_getValue !== "undefined")
  3651. {
  3652. console.warn("using synchronous GM setting loading");
  3653. window.GM = {};
  3654. GM.getValue = GM_getValue;
  3655. GM.setValue = GM_setValue;
  3656. loadCfg = function()
  3657. {
  3658. cfg_direct = GM.getValue("directImage", false);
  3659. cfg_bgclr = GM.getValue("bgColor", "grey");
  3660. cfg_fitWH = GM.getValue("fitWH", true);
  3661. cfg_fitB = GM.getValue("fitB", false);
  3662. cfg_fitS = GM.getValue("fitS", true);
  3663. cfg_fitOS = GM.getValue("fitOS", false);
  3664. cfg_js = GM.getValue("js", "");
  3665. cfg_vol = GM.getValue("vid_volume", "0.5");
  3666. }
  3667. loadCfg();
  3668. }
  3669. else
  3670. {
  3671. cfg_js = "";
  3672. console.warn("no script manager found - using default settings mode");
  3673. }
  3674. }
  3675. else
  3676. {
  3677. loadCfg = async function ()
  3678. {
  3679. cfg_direct = await GM.getValue("directImage", false);
  3680. cfg_bgclr = await GM.getValue("bgColor", "grey");
  3681. cfg_fitWH = await GM.getValue("fitWH", true);
  3682. cfg_fitB = await GM.getValue("fitB", false);
  3683. cfg_fitS = await GM.getValue("fitS", true);
  3684. cfg_fitOS = await GM.getValue("fitOS", false);
  3685. cfg_js = await GM.getValue("js", "");
  3686. cfg_vol = await GM.getValue("vid_volume", "0.5");
  3687. }
  3688. loadCfg();
  3689. }