From 8b57a310386bc00a4e3a0af2bbe00935ad183059 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Sun, 5 Apr 2020 14:10:59 -0500 Subject: [PATCH] ImageFap preview --- chat/preview/image-dom-mutator.ts | 3 +- chat/preview/test-urls.txt | 1 + electron/main.ts | 52 ++++++++++++++++--------------- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/chat/preview/image-dom-mutator.ts b/chat/preview/image-dom-mutator.ts index 378612f..cc9763f 100644 --- a/chat/preview/image-dom-mutator.ts +++ b/chat/preview/image-dom-mutator.ts @@ -43,7 +43,7 @@ export class ImageDomMutator { } setDebug(debug: boolean): void { - this.debug = debug || true; + this.debug = debug; } @@ -154,6 +154,7 @@ export class ImageDomMutator { this.add('hypnohub.net', this.getBaseJsMutatorScript(['video', '#image', 'img'])); this.add('derpibooru.org', this.getBaseJsMutatorScript(['video', '#image-display', 'img'])); this.add('sexbot.gallery', this.getBaseJsMutatorScript(['video.hero', 'video'])); + this.add('imagefap.com', this.getBaseJsMutatorScript(['.image-wrapper img', 'video', 'img'])); this.add( 'pornhub.com', diff --git a/chat/preview/test-urls.txt b/chat/preview/test-urls.txt index 6ad3789..6f3ca73 100644 --- a/chat/preview/test-urls.txt +++ b/chat/preview/test-urls.txt @@ -67,6 +67,7 @@ [url=https://cl.phncdn.com/pics/gifs/017/408/111/17408111a.webm]URL attempts to force a download[/url] + [url=https://www.imagefap.com/photo/786507225/?pgid=&gid=6802322&page=0&idx=11]ImageFap[/url] Broken diff --git a/electron/main.ts b/electron/main.ts index d4f6112..7470d99 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -190,45 +190,47 @@ function createWindow(): Electron.BrowserWindow | undefined { [ 'https://easylist.to/easylist/easylist.txt', 'https://easylist.to/easylist/easyprivacy.txt', // EasyPrivacy + 'https://easylist-downloads.adblockplus.org/easylist-cookie.txt', // Easy Cookies 'https://easylist.to/easylist/fanboy-social.txt', // Fanboy Social 'https://easylist.to/easylist/fanboy-annoyance.txt', // Fanboy Annoyances 'https://filters.adtidy.org/extension/chromium/filters/2.txt', // AdGuard Base 'https://filters.adtidy.org/extension/chromium/filters/11.txt', // AdGuard Mobile Ads 'https://filters.adtidy.org/extension/chromium/filters/4.txt', // AdGuard Social Media 'https://filters.adtidy.org/extension/chromium/filters/14.txt', // AdGuard Annoyances + 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/annoyances.txt', // uBlock Origin Annoyances 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt', // uBlock Origin Filters 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt', // uBlock Origin Privacy - 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt' // uBlock Origin Resource Abuse + 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt', // uBlock Origin Badware + 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt', // uBlock Origin Resource Abuse + 'https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt' // uBlock Origin Unbreak ] ).then( (blocker) => { blocker.enableBlockingInSession(electron.session.defaultSession); - // // console.log('Got this far!!!!'); + // blocker.on('request-blocked', (request: Request) => { + // console.log('blocked', request.url); + // }); // - blocker.on('request-blocked', (request: Request) => { - console.log('blocked', request.url); - }); - - blocker.on('request-redirected', (request: Request) => { - console.log('redirected', request.url); - }); - - blocker.on('request-whitelisted', (request: Request) => { - console.log('whitelisted', request.url); - }); - - blocker.on('csp-injected', (request: Request) => { - console.log('csp', request.url); - }); - - blocker.on('script-injected', (script: string, url: string) => { - console.log('script', script.length, url); - }); - - blocker.on('style-injected', (style: string, url: string) => { - console.log('style', style.length, url); - }); + // blocker.on('request-redirected', (request: Request) => { + // console.log('redirected', request.url); + // }); + // + // blocker.on('request-whitelisted', (request: Request) => { + // console.log('whitelisted', request.url); + // }); + // + // blocker.on('csp-injected', (request: Request) => { + // console.log('csp', request.url); + // }); + // + // blocker.on('script-injected', (script: string, url: string) => { + // console.log('script', script.length, url); + // }); + // + // blocker.on('style-injected', (style: string, url: string) => { + // console.log('style', style.length, url); + // }); } );