Browser Extension Synchronous Web Request Evaluation via Asynchronous Caching
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing browser extensions face challenges in evaluating web requests synchronously due to the deprecation of synchronous XMLHttpRequest, leaving no viable options for querying asynchronous information from third-party services.
Innovation Solution
Implementing a machine learning-based asynchronous information module that intercepts web requests, determines if synchronous information is available, and redirects requests to a parking service to asynchronously obtain necessary information for evaluation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If synchronous XMLHttpRequest is used to query third-party information, then the event handler can obtain information synchronously for evaluation, but the event handler blocks until the HTTP request is fulfilled, degrading performance
Solution Approach 1:
The system performs preliminary actions by pre-fetching and caching third-party information (such as reputation scores, categorization data) before the web request evaluation is needed. This information is stored in a cache during idle periods or triggered by predictive algorithms, so when evaluation is needed, the information is already available synchronously without blocking the event handler.
Solution Approach 2:
An intermediary caching layer is introduced between the browser extension and third-party information services. This cache stores pre-fetched information locally, allowing the event handler to retrieve data synchronously without making real-time synchronous requests that would block execution. The intermediary resolves the contradiction by decoupling the synchronous evaluation requirement from the asynchronous nature of third-party services.
2Adaptability or versatility
If synchronous XMLHttpRequest is deprecated, then asynchronous information services become the only option, but browser extensions require synchronous evaluation to make blocking/allowing decisions
Solution Approach 1:
The system performs preliminary actions by pre-fetching and caching third-party information (such as reputation scores, categorization data) before the web request evaluation is needed. This information is stored in a cache during idle periods or triggered by predictive algorithms, so when evaluation is needed, the information is already available synchronously without blocking the event handler.
Solution Approach 2:
An intermediary caching layer is introduced between the browser extension and third-party information services. This cache stores pre-fetched information locally, allowing the event handler to retrieve data synchronously without making real-time synchronous requests that would block execution. The intermediary resolves the contradiction by decoupling the synchronous evaluation requirement from the asynchronous nature of third-party services.
3Measurement precision
If the event handler blocks to obtain third-party information synchronously, then accurate evaluation decisions can be made, but overall browser performance and user experience deteriorate
Solution Approach 1:
The system performs preliminary actions by pre-fetching and caching third-party information (such as reputation scores, categorization data) before the web request evaluation is needed. This information is stored in a cache during idle periods or triggered by predictive algorithms, so when evaluation is needed, the information is already available synchronously without blocking the event handler.
Solution Approach 2:
An intermediary caching layer is introduced between the browser extension and third-party information services. This cache stores pre-fetched information locally, allowing the event handler to retrieve data synchronously without making real-time synchronous requests that would block execution. The intermediary resolves the contradiction by decoupling the synchronous evaluation requirement from the asynchronous nature of third-party services.
Data Source
AI summary
Web requests are intercepted and it is determined whether information is synchronously available to evaluate the web request. Responsive to not having information for synchronous evaluation, the web request can be redirected to a parking service to asynchronously obtain information to evaluate the web request. A response from the redirected web request including information for evaluation is received and stored. Then, web requests are reissued for synchronously evaluation by the browser. A decision can be made to allow, redirect, or block, based on the retrieved information.


