4Chan allows .webm format, world rejoices

Status
Not open for further replies.
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

oh yeah, i am now famous.
 
If you learn the basics of any of the script ad ons for FF you could practically just paste that code into the right place. GreaseMonkey could do it.

Just need to fix up that less than symbol escaping.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.
well, you had a good run firefox.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

I am literally in the future.
 
PSY&#12539;S;107209442 said:
It works but CPU usage is crazy high.

It's okay, I wasn't using my CPU for anything else anyway!
 
Weird they didn't support webP. It's basically the same general compression algorithms used in webM but for (animated) images.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

YOU ARE A GOD.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

Bless You.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.
oh my god it works so well
3AQmK.gif
3AQmK.gif
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

you're a good man
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

I'm cum.
 
Guys, guys......

What is going to happen if I post my 2 minute looping 2560 x 1600 webm?

Am I going fry thousands of CPUs around the world?
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

I wish there was some way I can hug you right now.
 
WebM for NeoGAF (Chrome extension)

Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
'use strict';

var videos = document.querySelectorAll('.post a'),
  link, video;

for (var i = 0; i < videos.length; i++) {
  link = videos[i].href;
  if (link.indexOf('.webm') === link.length - 5) {
    video = document.createElement('video');
    video.src = link;
    video.autoplay = true;
    video.loop = true;
    video.muted = true;
    video.width = '500';
    
    videos[i].parentNode.replaceChild(video, videos[i]);
  }
}

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

This is glorious. Thanks!
 
Making that stupid screenshot took most of the time, lol. If anyone wants to port it to Firefox or whatever the code ain't complex:

Code:
*snip*

There might even be a better way to do it, dunno. Spent about 10 minutes on this haha.

Works most of time. Nice job.

Any way to enforce the code all the time?
 
PSY&#12539;S;107209442 said:
It works but CPU usage is crazy high.
I'm only getting 12% usage and I have 3DS Max running in the background.
iu4AspAY7p88X.png

Edit: Or is it the autoplay? I can't test that.
 
Status
Not open for further replies.
Top Bottom