Identifying Equivalent JavaScript Events via Static Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current web crawlers face challenges in determining equivalent JavaScript events on web pages, which complicates the scanning process, especially when websites change their content, leading to inefficiencies and incomplete scans.
Innovation Solution
A computer-implemented process that analyzes source code to identify equivalent JavaScript events by extracting HTML elements, determining their type, attribute count, and function call similarity, allowing for the identification of equivalent events without executing them.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If a web crawler executes all JavaScript events on a page to determine equivalence, then the accuracy of event equivalence determination is improved, but the time consumption and processing resources increase significantly
Solution Approach 1:
The patent extracts and analyzes static attributes of HTML elements containing JavaScript events (such as element type, attributes, and event handlers) without executing the JavaScript code. This extraction approach allows the crawler to determine event equivalence by comparing structural properties rather than executing and comparing full DOM states, significantly reducing time consumption while maintaining determination accuracy.
Solution Approach 2:
The patent performs preliminary analysis of JavaScript events by examining their static characteristics (HTML element properties, event handlers, and associated attributes) before execution. By pre-evaluating these structural properties, the system can identify equivalent events without needing to execute them, thereby saving crawling time while preserving the ability to accurately determine equivalence.
2Adaptability or versatility
If a web crawler executes JavaScript actions to modify search criteria, then the ability to explore dynamic content is improved, but the crawler cannot identify previously visited pages because content changes
Solution Approach 1:
The patent segments the page identification problem into two parts: (1) identifying the container page structure that remains relatively stable, and (2) recognizing that JavaScript events within belong to equivalence classes. By focusing on the stable container structure and event equivalence patterns rather than dynamic content, the crawler can reliably identify previously visited pages even when content changes.
Solution Approach 2:
The patent creates a simplified representation or copy of the page structure that captures the essential container elements and JavaScript event patterns without including dynamic content. This structural copy serves as a reliable fingerprint for identifying previously visited pages, allowing the crawler to recognize repeats even when the actual page content has changed due to JavaScript execution.
3Productivity
If a web crawler limits the number of JavaScript actions executed, then the crawling efficiency is improved, but the completeness of event equivalence analysis deteriorates
Solution Approach 1:
The patent replaces the mechanical execution of JavaScript code with a static analysis approach that examines HTML element properties, attributes, and event handlers. This substitution allows the crawler to analyze event equivalence without actually executing JavaScript actions, thereby maintaining high crawling efficiency while achieving complete event equivalence analysis through structural comparison rather than execution-based testing.
Data Source
AI summary
Identifying equivalent JavaScript events includes receiving source code containing two JavaScript events for equivalency analysis, extracting an HTML element containing an event from each JavaScript event and analyzing the extracted HTML elements. Responsive to a determination that the HTML elements are of a same type according to equivalency criteria B, and responsive to a determination that the HTML elements have a same number of attributes according to equivalency criteria C, a determination is made whether JavaScript function calls of each JavaScript event are similar according to equivalency criteria A. Responsive to a determination that the JavaScript function calls are similar according to equivalency criteria A, and responsive to a determination that the other attributes of the HTML elements satisfy equivalency criteria D, the JavaScript events are identified as equivalent.


