Browser Script Monitoring Module for API Call Tracking
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Web browsers have limited ability to track the initiating script for API calls, especially for asynchronous actions, making it difficult to monitor and analyze script interactions effectively.
Innovation Solution
A script monitoring module is integrated into the browser to overwrite built-in APIs, allowing identification of initiating scripts for both synchronous and asynchronous API calls by using features like currentScript for JavaScript, and employing techniques such as closures and wrappers to track asynchronous actions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If built-in script monitoring functionality is used, then some script tracking is possible, but it is limited and not directly applicable to all situations
Solution Approach 1:
The patent introduces a script monitoring module as an intermediary layer between scripts and browser APIs. This module wraps built-in APIs to capture and track initiating script information that the original APIs would otherwise lose. The intermediary preserves script identification data through asynchronous operations by storing it in a monitoring structure before the script context is lost.
Solution Approach 2:
The patent performs preliminary action by capturing and storing initiating script information at the moment the API is called, before the asynchronous operation completes and the script context becomes unavailable. The monitoring module proactively saves script identifiers, call stacks, and other contextual information in advance, ensuring data is preserved even when the original script execution context is lost.
2Measurement precision
If comprehensive script monitoring is implemented, then full tracking of script interactions is achieved, but browser complexity increases
Solution Approach 1:
The patent segments the monitoring functionality into distinct modular components: a script monitoring module that wraps APIs, a data structure for storing monitoring information, and specific handlers for different API types. This segmentation allows comprehensive monitoring to be implemented as composable, independent modules rather than a monolithic complex system, making the increased complexity manageable and maintainable.
3Productivity
If asynchronous API calls are monitored, then complete script action tracking is possible, but tracking accuracy decreases due to script context loss
Solution Approach 1:
The patent performs preliminary action by capturing and storing initiating script information at the moment the API is called, before the asynchronous operation completes and the script context becomes unavailable. The monitoring module proactively saves script identifiers, call stacks, and other contextual information in advance, ensuring data is preserved even when the original script execution context is lost.
Solution Approach 2:
The patent introduces a script monitoring module as an intermediary layer between scripts and browser APIs. This module wraps built-in APIs to capture and track initiating script information that the original APIs would otherwise lose. The intermediary preserves script identification data through asynchronous operations by storing it in a monitoring structure before the script context is lost.
Data Source
AI summary
A browser can include a script monitoring module to monitor executing scripts and log the initiating scripts for API calls or other monitored actions. In some embodiments, the script monitoring module overwrites built-in or web APIs in the browser with versions of the APIs that allow the script monitoring module to identify the scripts calling the APIs. Using the script monitoring module, the script initiating an action (such as an API call) can be identified using features of the browser. In some embodiments, all actions may be monitored in this way, permitting the tracking and analysis of scripts and full analysis of interaction between such scripts on the webpage and with the browser.


