Night Mode Webpage Processing via CSS Injection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile terminals with closed operating systems, such as iOS, restrict third-party browsers from directly modifying webpage settings and rendering, limiting the effectiveness of night mode to only reduce overall brightness, which compromises display quality and user experience in low-light environments.
Innovation Solution
A method where the browser injects night mode CSS styles and corresponding JavaScript into the webpage's main file through the terminal's network request processing interface, prioritizing these styles to enhance display effects like white characters on a black background while maintaining the original layout.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If the luminance of the entire browser interface is uniformly reduced, then the night mode is implemented, but the display quality and legibility of webpage content are compromised
Solution Approach 1:
The patent applies different luminance reduction strategies to different elements of the webpage. Specifically, it reduces the luminance of the webpage content area while maintaining or adjusting the luminance of the browser interface elements. This localized approach allows the night mode to be implemented without uniformly degrading display quality across the entire interface, thereby resolving the contradiction between ease of night mode implementation and display quality preservation.
2Ease of manufacture
If a night skin is applied to the browser while replacing background color and reducing image brightness, then night mode is achieved, but the original webpage layout is altered
Solution Approach 1:
The patent segments the webpage into different regions: the browser interface elements and the webpage content area. It applies night mode styling selectively to the webpage content area while preserving the original layout structure of the webpage itself. This segmentation allows the night mode to be implemented without altering the fundamental layout of the webpage, resolving the contradiction between ease of implementation and layout preservation.
3Reliability
If third-party browser cannot access its own kernel, then closed operating system constraint is satisfied, but the browser cannot directly modify webpage settings and rendering
Solution Approach 1:
The patent introduces an intermediary mechanism that allows the third-party browser to indirectly modify webpage rendering. Instead of directly accessing the browser kernel (which is restricted), the browser uses the operating system's network request processing interface to inject night mode CSS styles and JavaScript into the webpage main file. This intermediary approach satisfies the operating system constraint while enabling the browser to achieve night mode functionality, resolving the contradiction between reliability and ease of operation.
Data Source
AI summary
Methods, devices, and mobile terminals for webpage processing in a night mode are provided. A method may comprise the browser injecting the CSS style of night mode and the corresponding JavaScript into the main file of said webpage via the interface of network request processing as provided by the terminal operating system when the browser is loading a webpage, and the browser parsing said main file, executing said JavaScript and applying said CSS style in a night mode to the webpage elements of said webpage for display. This can effect night mode and improve a user's browsing experience while maintaining the original webpage layout.


