CSS Style Injection for Advertisement Filtering
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing advertisement filtering methods using Cascading Style Sheets (CSS) are ineffective against countermeasures that reset the display attribute of hidden advertisements, allowing them to reappear on webpages.
Innovation Solution
An advertisement filtering method and device that injects a CSS style with the highest cascading priority, specifically designed to hide advertisement elements by setting their display attribute to 'none' through a CSS style injection module, cascading priority setting module, and CSS style enabling module, ensuring the advertisement element remains hidden during webpage rendering.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If CSS hiding method is used to filter advertisements, then the advertisement element is hidden by setting display attribute to none, but the advertisement can reappear when the author resets the display attribute through countermeasures
Solution Approach 1:
The patent applies preliminary anti-action by preemptively setting the display attribute of advertisement elements to 'none' through injected CSS styles with highest cascading priority. This preliminary hiding action prevents the advertisement from being displayed in the first place, countering the author's potential reset actions before they can take effect. The system proactively establishes the hidden state and maintains it through priority-based CSS cascading.
Solution Approach 2:
The patent changes the cascading priority parameter of CSS styles to resolve the contradiction. By assigning the highest cascading priority to advertisement filtering CSS styles, the system ensures that these styles override any author-defined styles that might attempt to reset the display attribute. This parameter change (priority level) transforms the reliability of advertisement filtering without adding complex device structures.
2Reliability
If author resets display attribute of hidden advertisement, then the advertisement reappears on the webpage, but this countermeasure increases the difficulty of maintaining effective filtration
Solution Approach 1:
The system applies preliminary anti-action by pre-establishing CSS styles with the highest cascading priority that set the display attribute to 'none'. This preliminary action creates a protective layer that prevents author countermeasures from taking effect. The high-priority CSS styles are injected before the webpage rendering process, ensuring that any subsequent attempts by the author to reset display attributes are overridden by the higher-priority filtering styles.
Solution Approach 2:
The patent introduces an intermediary mechanism - the CSS style injection module with priority setting functionality - that mediates between the advertisement filtering requirement and the author's style definitions. This intermediary system processes and prioritizes CSS styles, ensuring that filtering styles take precedence over author-defined styles, thereby neutralizing the harmful effect of countermeasures without requiring direct conflict.
3Reliability
If CSS style with highest cascading priority is injected, then the advertisement element remains hidden despite countermeasures, but the complexity of CSS style management increases
Solution Approach 1:
The patent extracts the CSS style injection and priority management functionality into a separate, dedicated module. By taking out this specific function from the general browser rendering process, the system can manage advertisement filtering CSS styles independently with highest priority without complicating the overall browser architecture. The extraction allows focused implementation of priority-based filtering while keeping the rest of the CSS management system unchanged.
Solution Approach 2:
The CSS style injection module is designed with multi-functionality, serving both advertisement filtering and potential other styling needs. By creating a universal mechanism that handles CSS injection with priority management, the system achieves reliable advertisement filtering while the same mechanism could potentially serve other purposes, thereby justifying the added complexity through multiple uses rather than a single dedicated function.
Data Source
AI summary
An advertisement filtering method and device. The method comprises: access a web page by using a browser, acquire a selector of an advertisement element according to a domain name of the web page, and add a rule statement for hiding the advertisement element after the selector to generate a CSS style of a specific category (S10); inject the CSS style of the specific category into the browser (S11); set a cascading priority of the CSS style of the specific category to a highest cascading priority (S12); and the browser performs cascading on the CSS styles according to an order of the cascading priority of the CSS style to enable the CSS style of the specific category to take effect (S13). In this way, in a case in which an author uses a counter advertisement filtering method, an advertisement from the author can still be effectively filtered.


