Browser Script Monitoring Module for API Call Tracking

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvescript tracking applicabilityVSAvoidinitiating script identification
Core Design Contradiction:
Adaptability or versatilityVSLoss of information

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If comprehensive script monitoring is implemented, then full tracking of script interactions is achieved, but browser complexity increases

Engineering Contradiction:
Improvescript interaction tracking accuracyVSAvoidbrowser architecture
Core Design Contradiction:
Measurement precisionVSDevice complexity

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.

Inventive Principle:
Principle #1Segmentation

3Productivity

If asynchronous API calls are monitored, then complete script action tracking is possible, but tracking accuracy decreases due to script context loss

Engineering Contradiction:
Improvescript monitoring coverageVSAvoidinitiating script identification accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11783004B2Identifying a script that originates synchronous and asynchronous actions
Publication Date: 2023.10.10 PERIMETERX INC
  • US11783004B2 patent drawing
  • US11783004B2 patent drawing
  • US11783004B2 patent drawing

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.