• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

4Chan allows .webm format, world rejoices

Status
Not open for further replies.

alr1ght

bish gets all the credit :)
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.
 

riotous

Banned
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.
 

whitehawk

Banned
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.
 

dekline

Member
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.
 

Haly

One day I realized that sadness is just another word for not enough coffee.
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!
 

Somnid

Member
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.
 

Shiggie

Member
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.
 

whitehawk

Banned
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
 

greycolumbus

The success of others absolutely infuriates me.
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
 

Ryaaan14

Banned
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.
 

Dennis

Banned
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?
 

Amagon

Member
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.
 

jwk94

Member
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!
 

Reversed

Member
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?
 

JordanN

Banned
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