Tumblr/Twitter fixes
This commit is contained in:
parent
50f8d1eb7f
commit
a09f2b126a
|
@ -56,6 +56,13 @@ const previewInitiationTime = Date.now();
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
if (window.location.href.match(/^https?:\/\/[a-zA-Z0-9-]+\.tumblr\.com/)) {
|
if (window.location.href.match(/^https?:\/\/[a-zA-Z0-9-]+\.tumblr\.com/)) {
|
||||||
// Because Tumblr sucks with their iframes
|
// Because Tumblr sucks with their iframes
|
||||||
|
const og = document.querySelectorAll('meta[property="og:image"]:not([content=""])');
|
||||||
|
|
||||||
|
if (og.length > 0) {
|
||||||
|
window.location.href = og[0].content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must return anyway because... Tumblr sucks with their iframes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,8 +153,8 @@ export class ImageDomMutator {
|
||||||
this.add('vimeo.com', this.getBaseJsMutatorScript(['#video, video', '#image, img']));
|
this.add('vimeo.com', this.getBaseJsMutatorScript(['#video, video', '#image, img']));
|
||||||
this.add('sex.com', this.getBaseJsMutatorScript(['.image_frame video', '.image_frame 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']), undefined, 'dom-ready');
|
this.add(/^[a-zA-Z0-9-]+\.media\.tumblr\.com$/, this.getBaseJsMutatorScript(['.photoset video', '.photoset img', 'img:not([role="img"]):not([alt="Avatar"])', '#base-container video', '#base-container img', 'picture video', 'picture img', 'video', 'img']), undefined, 'dom-ready');
|
||||||
this.add(/^[a-zA-Z0-9-]+\.tumblr\.com$/, this.getBaseJsMutatorScript(['.photoset iframe', '.photoset video', '.photoset img', 'picture video', 'picture img', 'video', 'img']), undefined, 'dom-ready');
|
this.add(/^[a-zA-Z0-9-]+\.tumblr\.com$/, this.getBaseJsMutatorScript(['.photoset iframe', '.photoset video', '.photoset img', 'img:not([role="img"]):not([alt="Avatar"])', 'picture video', 'picture img', 'video', 'img']), undefined, 'dom-ready');
|
||||||
this.add('postimg.cc', this.getBaseJsMutatorScript(['video', '#main-image']));
|
this.add('postimg.cc', this.getBaseJsMutatorScript(['video', '#main-image']));
|
||||||
this.add('gifsauce.com', this.getBaseJsMutatorScript(['video']));
|
this.add('gifsauce.com', this.getBaseJsMutatorScript(['video']));
|
||||||
// this.add('motherless.com', this.getBaseJsMutatorScript(['.content video', '.content img']));
|
// this.add('motherless.com', this.getBaseJsMutatorScript(['.content video', '.content img']));
|
||||||
|
|
|
@ -25,6 +25,11 @@ export class ImageUrlMutator {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected init(): void {
|
protected init(): void {
|
||||||
|
this.add(
|
||||||
|
/^https?:\/\/.*twitter.com/,
|
||||||
|
async(): Promise<string> => 'https://i.imgur.com/ScNLbsp.png'
|
||||||
|
);
|
||||||
|
|
||||||
this.add(
|
this.add(
|
||||||
/^https?:\/\/(www.)?pornhub.com\/view_video.php\?viewkey=([a-z0-9A-Z]+)/,
|
/^https?:\/\/(www.)?pornhub.com\/view_video.php\?viewkey=([a-z0-9A-Z]+)/,
|
||||||
async(_url: string, match: RegExpMatchArray): Promise<string> => {
|
async(_url: string, match: RegExpMatchArray): Promise<string> => {
|
||||||
|
|
Loading…
Reference in New Issue