tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9fd3239965a5283dff3c0b6fa8d76b519f5b107e
parent 4c94fd990e9fe0b2205b0216abba8153b3e0c4fe
Author: Mark Banner <standard8@mozilla.com>
Date:   Tue, 30 Sep 2025 15:10:53 +0000

Bug 1991124 - Fix ESLint require-jsdoc issues in ipprotection code. r=ip-protection-reviewers,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D266630

Diffstat:
Mbrowser/components/ipprotection/GuardianClient.sys.mjs | 1+
Mbrowser/components/ipprotection/IPPChannelFilter.sys.mjs | 2++
Mbrowser/components/ipprotection/IPProtectionServerlist.sys.mjs | 6++++++
Mbrowser/components/ipprotection/content/ipprotection-content.mjs | 3+++
Mbrowser/components/ipprotection/content/ipprotection-flag.mjs | 3+++
Mbrowser/components/ipprotection/content/ipprotection-header.mjs | 3+++
Mbrowser/components/ipprotection/content/ipprotection-message-bar.mjs | 3+++
Mbrowser/components/ipprotection/content/ipprotection-signedout.mjs | 3+++
Mbrowser/components/ipprotection/content/ipprotection-timer.mjs | 7+++++++
Mbrowser/components/ipprotection/tests/xpcshell/test_IPProtectionPanel.js | 3+++
Mbrowser/components/ipprotection/tests/xpcshell/test_IPProtectionUsage.js | 3+++
Meslint-rollouts.config.mjs | 11-----------
12 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/browser/components/ipprotection/GuardianClient.sys.mjs b/browser/components/ipprotection/GuardianClient.sys.mjs @@ -31,6 +31,7 @@ if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) { */ export class GuardianClient { /** + * @param {typeof gConfig} [config] */ constructor(config = gConfig) { this.guardianEndpoint = config.guardianEndpoint; diff --git a/browser/components/ipprotection/IPPChannelFilter.sys.mjs b/browser/components/ipprotection/IPPChannelFilter.sys.mjs @@ -204,6 +204,8 @@ export class IPPChannelFilter { * to measure usage, or catch proxy errors. * * @returns {AsyncGenerator<nsIChannel>} An async generator that yields proxied channels. + * @yields {object} + * Proxied channels. */ async *proxiedChannels() { const stop = Promise.withResolvers(); diff --git a/browser/components/ipprotection/IPProtectionServerlist.sys.mjs b/browser/components/ipprotection/IPProtectionServerlist.sys.mjs @@ -75,6 +75,9 @@ export class Server { quarantined = false; } +/** + * Class representing a city. + */ export class City { /** * Fallback name for the city if not available @@ -97,6 +100,9 @@ export class City { servers = []; } +/** + * Class representing a country. + */ export class Country { /** * Fallback name for the country if not available diff --git a/browser/components/ipprotection/content/ipprotection-content.mjs b/browser/components/ipprotection/content/ipprotection-content.mjs @@ -29,6 +29,9 @@ import "chrome://browser/content/ipprotection/ipprotection-signedout.mjs"; // eslint-disable-next-line import/no-unassigned-import import "chrome://global/content/elements/moz-toggle.mjs"; +/** + * Custom element that implements a message bar and status card for IP protection. + */ export default class IPProtectionContentElement extends MozLitElement { static queries = { headerEl: "ipprotection-header", diff --git a/browser/components/ipprotection/content/ipprotection-flag.mjs b/browser/components/ipprotection/content/ipprotection-flag.mjs @@ -6,6 +6,9 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { html } from "chrome://global/content/vendor/lit.all.mjs"; import { FLAGS } from "chrome://browser/content/ipprotection/ipprotection-constants.mjs"; +/** + * A custom element that handles the display of flag icons. + */ export default class IPProtectionFlagElement extends MozLitElement { static properties = { location: { type: Object }, diff --git a/browser/components/ipprotection/content/ipprotection-header.mjs b/browser/components/ipprotection/content/ipprotection-header.mjs @@ -10,6 +10,9 @@ import "chrome://global/content/elements/moz-badge.mjs"; // eslint-disable-next-line import/no-unassigned-import import "chrome://global/content/elements/moz-button.mjs"; +/** + * A custom elements that implements display of the IP Protection header. + */ export default class IPProtectionHeaderElement extends MozLitElement { static queries = { experimentBadgeEl: "#ipprotection-experiment-badge", diff --git a/browser/components/ipprotection/content/ipprotection-message-bar.mjs b/browser/components/ipprotection/content/ipprotection-message-bar.mjs @@ -8,6 +8,9 @@ import { html } from "chrome://global/content/vendor/lit.all.mjs"; // eslint-disable-next-line import/no-unassigned-import import "chrome://global/content/elements/moz-message-bar.mjs"; +/** + * A custom element that handles the message bar for IP Protection. + */ export default class IPProtectionMessageBarElement extends MozLitElement { #MESSAGE_TYPE_MAP = new Map([ ["generic-error", () => this.genericErrorTemplate()], diff --git a/browser/components/ipprotection/content/ipprotection-signedout.mjs b/browser/components/ipprotection/content/ipprotection-signedout.mjs @@ -6,6 +6,9 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { html } from "chrome://global/content/vendor/lit.all.mjs"; import { LINKS } from "chrome://browser/content/ipprotection/ipprotection-constants.mjs"; +/** + * A custom element that handles the signed out status of IP Protection. + */ export default class IPProtectionSignedOutContentElement extends MozLitElement { static queries = { learnMoreLinkEl: "#learn-more-vpn-signed-out", diff --git a/browser/components/ipprotection/content/ipprotection-timer.mjs b/browser/components/ipprotection/content/ipprotection-timer.mjs @@ -17,6 +17,10 @@ const hasYielded = async asyncReplaceDirective => { return asyncReplaceDirective; }; +/** + * A directive that produces a live updating l10n args object with the duration + * since the given timestamp in milliseconds. + */ class TimerDirective extends AsyncDirective { render(timeConnectedSince) { return until( @@ -28,7 +32,10 @@ class TimerDirective extends AsyncDirective { * Returns a generator that yields a l10n args object with the current connection time * every second. * + * @param {number} timeConnectedSince + * The time in milliseconds * @returns {AsyncGenerator<string>} + * @yields {string} */ async *currentTime(timeConnectedSince) { while (true) { diff --git a/browser/components/ipprotection/tests/xpcshell/test_IPProtectionPanel.js b/browser/components/ipprotection/tests/xpcshell/test_IPProtectionPanel.js @@ -13,6 +13,9 @@ const { IPProtectionService, IPProtectionStates } = ChromeUtils.importESModule( "resource:///modules/ipprotection/IPProtectionService.sys.mjs" ); +/** + * A class that mocks the IP Protection panel. + */ class FakeIPProtectionPanelElement { constructor() { this.state = { diff --git a/browser/components/ipprotection/tests/xpcshell/test_IPProtectionUsage.js b/browser/components/ipprotection/tests/xpcshell/test_IPProtectionUsage.js @@ -77,6 +77,9 @@ function promiseChannelDone(chan) { }); } +/** + * Mocks a channel listener. + */ class ChannelListener { constructor(resolve, reject) { this.resolve = resolve; diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -493,17 +493,6 @@ export default [ "browser/components/genai/content/page-assist.mjs", "browser/components/genai/content/smart-assist.mjs", "browser/components/genai/tests/browser/browser_page_assist_actors.js", - "browser/components/ipprotection/GuardianClient.sys.mjs", - "browser/components/ipprotection/IPPChannelFilter.sys.mjs", - "browser/components/ipprotection/IPProtectionServerlist.sys.mjs", - "browser/components/ipprotection/content/ipprotection-content.mjs", - "browser/components/ipprotection/content/ipprotection-flag.mjs", - "browser/components/ipprotection/content/ipprotection-header.mjs", - "browser/components/ipprotection/content/ipprotection-message-bar.mjs", - "browser/components/ipprotection/content/ipprotection-signedout.mjs", - "browser/components/ipprotection/content/ipprotection-timer.mjs", - "browser/components/ipprotection/tests/xpcshell/test_IPProtectionPanel.js", - "browser/components/ipprotection/tests/xpcshell/test_IPProtectionUsage.js", "browser/components/mozcachedohttp/MozCachedOHTTPProtocolHandler.sys.mjs", "browser/components/profiles/ProfilesChild.sys.mjs", "browser/components/profiles/ProfilesParent.sys.mjs",