Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Displaying Zhihu Web Emojis as Plain Text Using uBlock Origin

Tech May 9 59

Zhihu implements emojis using bracketed keyword markers that corespond to images, similar to WeChat's approach. Hovering over an emoji reveals its alt attribute containing the textual identifier.

To render these emojis as plain text, image loading must be blocked so that the alt text appears instead. Inspection via browser developer tools shows these emoji images originate from domains like pic[0-9].zhimg.com, typically in the format https://pic[0-9].zhimg.com/v2-xxxxx.jpg, distinguishing them from regular images which include a ?source= paraemter.

Using uBlock Origin, apply the following filter rule:

||pic*.zhimg.com/*.png

However, applying this alone hides the emojis without showing their alt text.

Further investigation shows that JavaScript event listeners manipulate the display of .sticker elements when images fail to load. These scripts come from https://unpkg.zhimg.com. Blocking this domain resolves the issue:

unpkg.zhimg.com

With both rules active, emojis now appear as thier corresponding text labels.

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.