summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/ExtensionDNR.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/extensions/ExtensionDNR.sys.mjs')
-rw-r--r--toolkit/components/extensions/ExtensionDNR.sys.mjs14
1 files changed, 10 insertions, 4 deletions
diff --git a/toolkit/components/extensions/ExtensionDNR.sys.mjs b/toolkit/components/extensions/ExtensionDNR.sys.mjs
index d18856a2b8..afc7d30751 100644
--- a/toolkit/components/extensions/ExtensionDNR.sys.mjs
+++ b/toolkit/components/extensions/ExtensionDNR.sys.mjs
@@ -71,6 +71,7 @@ const gRuleManagers = [];
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
+/** @type {Lazy} */
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
@@ -182,6 +183,8 @@ export class Rule {
class Ruleset {
/**
+ * @typedef {number} integer
+ *
* @param {string} rulesetId - extension-defined ruleset ID.
* @param {integer} rulesetPrecedence
* @param {Rule[]} rules - extension-defined rules
@@ -1316,7 +1319,7 @@ class RequestDetails {
* @param {string} options.type - ResourceType (MozContentPolicyType).
* @param {string} [options.method] - HTTP method
* @param {integer} [options.tabId]
- * @param {BrowsingContext} [options.browsingContext] - The BrowsingContext
+ * @param {CanonicalBrowsingContext} [options.browsingContext] - The CBC
* associated with the request. Typically the bc for which the subresource
* request is initiated, if any. For document requests, this is the parent
* (i.e. the parent frame for sub_frame, null for main_frame).
@@ -1975,7 +1978,10 @@ const NetworkIntegration = {
/**
* Applies the actions of the DNR rules.
*
- * @param {ChannelWrapper} channel
+ * @typedef {ChannelWrapper & { _dnrMatchedRules?: MatchedRule[] }}
+ * ChannelWrapperViaDNR
+ *
+ * @param {ChannelWrapperViaDNR} channel
* @returns {boolean} Whether to ignore any responses from the webRequest API.
*/
onBeforeRequest(channel) {
@@ -1993,7 +1999,7 @@ const NetworkIntegration = {
this.applyRedirect(channel, finalMatch);
return true;
case "upgradeScheme":
- this.applyUpgradeScheme(channel, finalMatch);
+ this.applyUpgradeScheme(channel);
return true;
}
// If there are multiple rules, then it may be a combination of allow,
@@ -2294,7 +2300,7 @@ function beforeWebRequestEvent(channel, kind) {
/**
* Applies matching DNR rules, some of which may potentially cancel the request.
*
- * @param {ChannelWrapper} channel
+ * @param {ChannelWrapperViaDNR} channel
* @param {string} kind - The name of the webRequest event.
* @returns {boolean} Whether to ignore any responses from the webRequest API.
*/