alextrv / enhanced-h264ify

A Firefox/Chrome extension that blocks video and audio codecs you have chosen on YouTube
MIT License
256 stars 16 forks source link

Removed createElement; use HTMLVideoElement.prototype instead #22

Open cyfung1031 opened 1 year ago

cyfung1031 commented 1 year ago

@alextrv This script shall be maintained even in 2023. YouTube still wants my Macbook M1 Pro using WiFi plays 360p instead of 1080p.

According to Youtube's desktop_polymer.js, some coding shall be updated as the very old browsers are no longer supported.

For example, document.createElement('video').__proto__ shall change to HTMLVideoElement.prototype

This avoid unnecessary element creation (although not attached to the document), and also avoid .bind() which create another instance of function.