Image preview fixes
This commit is contained in:
		
							parent
							
								
									e1d2f9ff3e
								
							
						
					
					
						commit
						cdff8db311
					
				@ -1,8 +1,8 @@
 | 
			
		||||
# Changelog
 | 
			
		||||
 | 
			
		||||
## Canary
 | 
			
		||||
* Fix caching issue that causes cache misses on charater page metadata
 | 
			
		||||
 | 
			
		||||
*   Fix caching issue that causes cache misses on charater page metadata
 | 
			
		||||
*   URL preview fixes for Redgifs, Gelbooru, Tumblr, and Gifmixxx 
 | 
			
		||||
 | 
			
		||||
## 1.0.1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -105,6 +105,8 @@ This repository contains a heavily customized version of the mainline F-Chat 3.0
 | 
			
		||||
*   Bug? Usually submissive vs usually submissive shows up as 'maybe'
 | 
			
		||||
*   Bug? YOU have 'loves humans'; THEY have 'no furry characters, just humans' -- THEIR ad shows green, not red -- your side of comparison is fully green, they just have 'no furry pairings' in red
 | 
			
		||||
*   Bug? [color] acts weird
 | 
			
		||||
*   Bug? inline images act weird on profiles
 | 
			
		||||
*   Better disconnect management / API tickets?
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# F-List Exported
 | 
			
		||||
 | 
			
		||||
@ -54,6 +54,11 @@ const previewInitiationTime = Date.now();
 | 
			
		||||
(() => {
 | 
			
		||||
    try {
 | 
			
		||||
        const clear = () => {
 | 
			
		||||
            if (window.location.href.match(/^https?:\/\/[a-zA-Z0-9-]+\.tumblr\.com/)) {
 | 
			
		||||
                // Because Tumblr sucks with their iframes
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            try {
 | 
			
		||||
                const frameCount = window.frames.length;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -73,7 +73,7 @@ class FListImagePreviewDomMutator {
 | 
			
		||||
 | 
			
		||||
        const img = selected.filter(el => (el !== body)).shift();
 | 
			
		||||
 | 
			
		||||
        this.debug('detectImage.found', img);
 | 
			
		||||
        this.debug('detectImage.found', !!img, img);
 | 
			
		||||
 | 
			
		||||
        return img;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -60,16 +60,23 @@ export class ImageDomMutator {
 | 
			
		||||
    getMutatorJsForSite(url: string, eventName: string): string | undefined {
 | 
			
		||||
        let mutator = this.matchMutator(url);
 | 
			
		||||
 | 
			
		||||
        if (!mutator)
 | 
			
		||||
        if (!mutator) {
 | 
			
		||||
            mutator = this.hostMutators['default'];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (mutator.eventName !== eventName)
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        // console.log(`Mutator match: ${mutator.match}`, (mutator === this.hostMutators['default']), url);
 | 
			
		||||
 | 
			
		||||
        return this.wrapJs(mutator.injectJs) + this.getReShowMutator();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    matchMutator(url: string): DomMutator | undefined {
 | 
			
		||||
        if (url === 'about:blank') {
 | 
			
		||||
            return this.hostMutators['about:blank'];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const urlDomain = extractDomain(url);
 | 
			
		||||
 | 
			
		||||
        if (!urlDomain)
 | 
			
		||||
@ -131,9 +138,10 @@ export class ImageDomMutator {
 | 
			
		||||
        await this.loadScripts();
 | 
			
		||||
 | 
			
		||||
        this.add('default', this.getBaseJsMutatorScript(['.content video', '.content img', '#video, video', '#image, img']));
 | 
			
		||||
        this.add('about:blank', '');
 | 
			
		||||
        this.add('e621.net', this.getBaseJsMutatorScript(['video', '#image']));
 | 
			
		||||
        this.add('e-hentai.org', this.getBaseJsMutatorScript(['video', '#img']));
 | 
			
		||||
        this.add('gelbooru.com', this.getBaseJsMutatorScript(['.post-view video', '#image']));
 | 
			
		||||
        this.add('gelbooru.com', this.getBaseJsMutatorScript(['.post-view video', '.contain-push video', '#image']));
 | 
			
		||||
        this.add('gyazo.com', this.getBaseJsMutatorScript(['.image-view video', '.image-view img']));
 | 
			
		||||
        this.add('chan.sankakucomplex.com', this.getBaseJsMutatorScript(['video', '#image']));
 | 
			
		||||
        this.add('danbooru.donmai.us', this.getBaseJsMutatorScript(['video', '#image']));
 | 
			
		||||
@ -144,7 +152,9 @@ export class ImageDomMutator {
 | 
			
		||||
        this.add('webmshare.com', this.getBaseJsMutatorScript(['video']));
 | 
			
		||||
        this.add('vimeo.com', this.getBaseJsMutatorScript(['#video, video', '#image, img']));
 | 
			
		||||
        this.add('sex.com', this.getBaseJsMutatorScript(['.image_frame video', '.image_frame img']));
 | 
			
		||||
        this.add('redirect.media.tumblr.com', this.getBaseJsMutatorScript(['picture video', 'picture img']));
 | 
			
		||||
        // this.add('redirect.media.tumblr.com', this.getBaseJsMutatorScript(['picture video', 'picture img']));
 | 
			
		||||
        this.add(/^[a-zA-Z0-9-]+\.media\.tumblr\.com$/, this.getBaseJsMutatorScript(['.photoset video', '.photoset img', '#base-container video', '#base-container img', 'picture video', 'picture img', 'video', 'img']));
 | 
			
		||||
        this.add(/^[a-zA-Z0-9-]+\.tumblr\.com$/, this.getBaseJsMutatorScript(['.photoset iframe', '.photoset video', '.photoset img', 'picture video', 'picture img', 'video', 'img']));
 | 
			
		||||
        this.add('postimg.cc', this.getBaseJsMutatorScript(['video', '#main-image']));
 | 
			
		||||
        this.add('gifsauce.com', this.getBaseJsMutatorScript(['video']));
 | 
			
		||||
        // this.add('motherless.com', this.getBaseJsMutatorScript(['.content video', '.content img']));
 | 
			
		||||
@ -157,13 +167,27 @@ export class ImageDomMutator {
 | 
			
		||||
        this.add('sexbot.gallery', this.getBaseJsMutatorScript(['video.hero', 'video']));
 | 
			
		||||
        this.add('imagefap.com', this.getBaseJsMutatorScript(['.image-wrapper img', 'video', 'img']));
 | 
			
		||||
        this.add('myhentaicomics.com', this.getBaseJsMutatorScript(['#entire_image img', 'video', 'img']));
 | 
			
		||||
        this.add('gifmixxx.com', this.getBaseJsMutatorScript(['.gif.fit', '.gif', 'video', 'img']));
 | 
			
		||||
        this.add('redgifs.com', this.getBaseJsMutatorScript(['video']));
 | 
			
		||||
 | 
			
		||||
        this.add(
 | 
			
		||||
            'pornhub.com',
 | 
			
		||||
            this.getBaseJsMutatorScript([/*'#__flistCore', '#player', */ '#photoImageSection img', 'video', 'img', '#player'], false)
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        this.add(
 | 
			
		||||
            'gifmixxx.com',
 | 
			
		||||
            `
 | 
			
		||||
                const bgImage = document.querySelector('.gif.fit');
 | 
			
		||||
                const bgImageStyle = bgImage.style.backgroundImage;
 | 
			
		||||
                ${this.getBaseJsMutatorScript(['.gif.fit', '.gif', 'video', 'img'])};
 | 
			
		||||
                bgImage.style.backgroundImage = bgImageStyle;
 | 
			
		||||
                bgImage.style.backgroundSize = 'contain';
 | 
			
		||||
                bgImage.style.backgroundRepeat = 'no-repeat';
 | 
			
		||||
                bgImage.style.color = 'transparent';
 | 
			
		||||
            `
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        this.add(
 | 
			
		||||
            'i.imgur.com',
 | 
			
		||||
            `
 | 
			
		||||
 | 
			
		||||
@ -46,6 +46,15 @@ export class ImageUrlMutator {
 | 
			
		||||
          }
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        this.add(
 | 
			
		||||
          /^https?:\/\/(www.)?redgifs.com\/watch\/([a-z0-9A-Z]+)/,
 | 
			
		||||
          async(_url: string, match: RegExpMatchArray): Promise<string> => {
 | 
			
		||||
            const redgifId = match[2];
 | 
			
		||||
 | 
			
		||||
            return `https://www.gifdeliverynetwork.com/ifr/${redgifId}?controls=0&hd=1`;
 | 
			
		||||
          }
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        this.add(
 | 
			
		||||
          /^https?:\/\/(www.)?gfycat.com\/([a-z0-9A-Z\-]+)\/?$/,
 | 
			
		||||
          async(_url: string, match: RegExpMatchArray): Promise<string> => {
 | 
			
		||||
 | 
			
		||||
@ -49,14 +49,12 @@
 | 
			
		||||
 | 
			
		||||
    [url=https://www.sex.com/pin/57537179-cock-slapping-hungry-tongue/]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=http://gfycatporn.com/deepthroat.php]Test[/url]
 | 
			
		||||
    [url=http://gfycatporn.com/deepthroat.php?img=56]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://www.youtube.com/watch?v=_52zdiltkRM]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://rule34.xxx/index.php?page=post&s=view&id=3213191]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://gelbooru.com/index.php?page=post&s=view&id=5210847&tags=tits]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://hypnohub.net/post/show/93283/3d-auxtasy-aware-brain_drain-d-va-dark_skin-female]Test[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://www.derpibooru.org/images/2234687?q=video]Derpibooru video[/url]
 | 
			
		||||
@ -79,14 +77,15 @@
 | 
			
		||||
 | 
			
		||||
    [url=https://gelbooru.com/index.php?page=post&s=view&id=4570202]Gelbooru[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://gelbooru.com/index.php?page=post&s=view&id=5210847&tags=tits]Gelbooru[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://gelbooru.com/index.php?page=post&s=view&id=4609485&tags=animated%203d%20anal]Gelbooru search[/url]
 | 
			
		||||
 | 
			
		||||
    [url=https://www.redgifs.com/watch/jampackedwaryafricanparadiseflycatcher-strap-on]Redgifs[/url]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Broken
 | 
			
		||||
https://giphy.com/gifs/arianagrande-ariana-grande-thank-u-next-you-uldtLAK6tSOKP5PWw3
 | 
			
		||||
 | 
			
		||||
https://redgifs.com/watch/grippingadvancedanteater
 | 
			
		||||
https://morphsbymig.tumblr.com/post/621869669856542720/morphsbymig-denise-milani-the-job-interview
 | 
			
		||||
https://66.media.tumblr.com/68d2754087907296dfc5f1c2567d6741/tumblr_pxf189SUrv1vu5oepo2_1280.jpg
 | 
			
		||||
https://www.redgifs.com/watch/jampackedwaryafricanparadiseflycatcher-strap-on
 | 
			
		||||
https://gelbooru.com/index.php?page=post&s=view&id=4609485&tags=animated%203d%20anal
 | 
			
		||||
https://vimeo.com/265884960
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user