Handy Image

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

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

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