Vi devas ensaluti aŭ registriĝi antaŭ ol daŭrigi.

Handy Image

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

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

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