IP Library Granted Patent US 11,783,004
Granted Patent B2
US 11,783,004 · App. 17/002,700 · Granted Oct 10, 2023

Identifying a script that originates synchronous and asynchronous actions

Inventors: Gal Weizman (Tel Aviv, IL); Itai Sadan (Tel Aviv, IL)
Assignee: PERIMETERX, INC.
G06F16/9577G06F9/3871G06F9/541G06F16/958
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,783,004
App. No.
17/002,700
Granted
Oct 10, 2023
Kind
B2
Abstract

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.

Claims (57)

1. A method comprising:

loading, by a browser on a client device, a webpage comprising a set of scripts for execution by the browser;

executing, by the browser as part of executing a first script of the set of scripts, a call to a first asynchronous API comprising a set of arguments and a first callback function that is to be executed upon a trigger condition, the execution of the call to the first asynchronous API comprising:

calling an overwritten first asynchronous API using the set of arguments and the first callback function;

generating, by the overwritten first asynchronous API, a wrapped callback function comprising an identification of the first script and a call to the first callback function; and

calling, by the overwritten first asynchronous API, the first asynchronous API using the set of arguments and the wrapped callback function;

detecting, by the first asynchronous API, that the trigger condition is met; and

upon the detection of the trigger condition, executing by the first asynchronous API, the wrapped callback function comprising:

setting, by the wrapped callback function, a current script variable back to the first script based on the identification of the first script; and

executing the first callback function.

2. The method of claim 1 , further comprising restoring the current script variable to a previous value.

3. The method of claim 1 , wherein executing the first callback function comprises:

calling a first synchronous API;

referencing the current script variable to determine a current script; and

storing an association between the first script and the first synchronous API.

4. The method of claim 1 , wherein executing, by the first asynchronous API, the wrapped callback function occurs after execution of the first script has finished.

5. The method of claim 1 , wherein generating, by the overwritten first asynchronous API, a wrapped callback function comprising the identification of the first script and a call to the first callback function comprises using a closure to store a reference to the first script.

6. The method of claim 1 , wherein generating, by the overwritten first asynchronous API, a wrapped callback function comprising the identification of the first script and a call to the first callback function comprises using a bind to store a reference to the first script.

7. A non-transitory computer-readable storage medium comprising instructions which, when executed by a processor, cause the processor to perform the steps of:

loading, by a browser on a client device, a webpage comprising a set of scripts for execution by the browser;

executing, by the browser as part of executing a first script of the set of scripts, a call to a first asynchronous API comprising a set of arguments and a first callback function that is to be executed upon a trigger condition, the execution of the call to the first asynchronous API comprising:

calling an overwritten first asynchronous API using the set of arguments and the first callback function;

generating, by the overwritten first asynchronous API, a wrapped callback function comprising an identification of the first script and a call to the first callback function; and

calling, by the overwritten first asynchronous API, the first asynchronous API using the set of arguments and the wrapped callback function;

detecting, by the first asynchronous API, that the trigger condition is met; and

upon the detection of the trigger condition, executing, by the first asynchronous API, the wrapped callback function comprising:

setting, by the wrapped callback function, a current script variable back to the first script based on the identification of the first script; and

executing the first callback function.

8. The non-transitory computer-readable storage medium of claim 7 , wherein the steps further comprise the step of restoring the current script variable to a previous value.

9. The non-transitory computer-readable storage medium of claim 7 , wherein executing the first callback function comprises:

calling a first synchronous API;

referencing the current script variable to determine a current script; and

storing an association between the first script and the first synchronous API.

10. The non-transitory computer-readable storage medium of claim 7 , wherein executing, by the first asynchronous API, the wrapped callback function occurs after execution of the first script has finished.

11. The non-transitory computer-readable storage medium of claim 7 , wherein generating, by the overwritten first asynchronous API, a wrapped callback function comprising the identification of the first script and a call to the first callback function comprises using a closure to store a reference to the first script.

12. The non-transitory computer-readable storage medium of claim 7 , wherein generating, by the overwritten first asynchronous API, a wrapped callback function comprising the identification of the first script and a call to the first callback function comprises using a bind to store a reference to the first script.

13. A system comprising:

a processor; and

a non-transitory computer-readable storage medium comprising instructions which, when executed by the processor, cause the processor to perform the steps of:

loading, by a browser on a client device, a webpage comprising a set of scripts for execution by the browser;

executing, by the browser as part of executing a first script of the set of scripts, a call to a first asynchronous API comprising a set of arguments and a first callback function that is to be executed upon a trigger condition, the execution of the call to the first asynchronous API comprising:

calling an overwritten first asynchronous API using the set of arguments and the first callback function;

generating, by the overwritten first asynchronous API, a wrapped callback function comprising an identification of the first script and a call to the first callback function; and

calling, by the overwritten first asynchronous API, the first asynchronous API using the set of arguments and the wrapped callback function;

detecting, by the first asynchronous API, that the trigger condition is met; and

upon the detection of the trigger condition, executing by the first asynchronous API, the wrapped callback function comprising:

setting, by the wrapped callback function, a current script variable back to the first script based on the identification of the first script; and

executing the first callback function.

14. The system of claim 13 , wherein the steps further comprise the step of restoring the current script variable to a previous value.

15. The system of claim 13 , wherein executing the first callback function comprises:

calling a first synchronous API;

referencing the current script variable to determine a current script; and

storing an association between the first script and the first synchronous API.

16. The system of claim 13 , wherein executing, by the first asynchronous API, the wrapped callback function occurs after execution of the first script has finished.

17. The system of claim 13 , wherein generating, by the overwritten first asynchronous API, a wrapped callback function comprising the identification of the first script and a call to the first callback function comprises using a closure to store a reference to the first script.

18. The method of claim 1 , wherein the identification of the first script comprises a reference to the first script.

19. The method of claim 1 , wherein, after the call to the first asynchronous API, execution of the first asynchronous API occurs independently of and asynchronously with execution of the first script.

Assignments (6)
RELEASE OF SECURITY INTEREST Recorded Aug 5, 2025
From: SILICON VALLEY BANK, A DIVISION OF FIRST-CITIZENS BANK & TRUST COMPANY
To: HUMAN SECURITY, INC.; SINGULARITY BUYER LLC; PERIMETERX, INC.
Reel/Frame 071935/0486 →
RELEASE OF SECURITY INTEREST Recorded Aug 5, 2025
From: ALTER DOMUS (US) LLC
To: PERIMETERX, INC.
Reel/Frame 071935/0535 →
INTELLECTUAL PROPERTY SECURITY AGREEMENT Recorded Jul 25, 2025
From: PERIMETERX, INC.
To: WILMINGTON TRUST, NATIONAL ASSOCIATION, AS COLLATERAL AGENT
Reel/Frame 072253/0245 →
SECURITY INTEREST Recorded Aug 9, 2022
From: PERIMETERX, INC.
To: ALTER DOMUS (US) LLC, AS COLLATERAL AGENT
Reel/Frame 060761/0797 →
INTELLECTUAL PROPERTY SECURITY AGREEMENT Recorded Jul 29, 2022
From: HUMAN SECURITY, INC.; SINGULARITY BUYER LLC; PERIMETERX, INC.
To: SILICON VALLEY BANK
Reel/Frame 061006/0055 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 23, 2021
From: WEIZMAN, GAL; SADAN, ITAI
To: PERIMETERX, INC.
Reel/Frame 058200/0203 →
Continuity (2)
Provisional Application 62891532 · Aug 26, 2019
Related Publication 20210064685A1 · Mar 4, 2021