A recent Hacker News post about WebKit has caused a lot of discussion and attention. The content of the post is mainly to mention that the WebKit core contains code that is “specially customized” for YouTube.

The code is located in the following directory: https://github.com/WebKit/WebKit/blob/main/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp

WebKit is an open source web browser engine.It is used in Apple’s Safari browser, and its fork Blink isDepend on Google open source leading developmentBrowser rendering engine. Blink is part of the browser kernel Chromium.

The developers pointed out that when the first iPhone was released, YouTube was still using Flash technology — not HTML5. In this case, Safari uses special code to play the video using the built-in player instead of showing a blank square. This code is responsible for that logic.

However, it was discovered that this code was written in 2014, well after the release of the first generation iPhone, and this year there were attempts to delete this code without the consent of the development team, because some websites now rely on this kind of code. hack means.

In the comments, there are other similar cases from developers, such as the “flash_embed_rewrite.cc” code included in Chromium hoping to replace the long tail they embed in the wild before Flash is removed; Windows 95 includes specific code to see if SimCity is running, and if running, allocates memory differently. Some developers even put Jobs’ commencement speech into Webkit test cases.

What other interesting hacks do you know of, please share them in the comments.

#WebKit #YouTubespecific #processing #code #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *