Skip to content

Commit 054a40c

Browse files
committed
fix: extend permissions with BookmarksInfo and improve test coverage
1 parent 1dc2a2c commit 054a40c

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

src/cli/builders/manifest/utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,18 @@ describe("normalizeDataCollectionPermissions", () => {
483483
expect(result.optional).toEqual([DataCollectionPermission.SearchTerms]);
484484
});
485485

486-
it("should handle mixed string and enum permissions", () => {
486+
it("should handle mixed string and enum permissions including new BookmarksInfo", () => {
487487
const input = {
488488
required: ["websiteActivity" as any, DataCollectionPermission.SearchTerms],
489-
optional: ["searchTerms" as any, "locationInfo" as any],
489+
optional: ["searchTerms" as any, DataCollectionPermission.BookmarksInfo],
490490
};
491491

492492
// "searchTerms" is in both, so it should be removed from optional
493493
const result = normalizeDataCollectionPermissions(input);
494494

495495
expect(result.required).toContain("websiteActivity");
496496
expect(result.required).toContain(DataCollectionPermission.SearchTerms);
497-
expect(result.optional).toEqual(["locationInfo"]);
497+
expect(result.optional).toEqual([DataCollectionPermission.BookmarksInfo]);
498498
});
499499

500500
it("should filter out invalid permissions not present in the enum", () => {

src/types/browser.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,30 @@ export enum Browser {
1414
* @see https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings#data_collection_permissions
1515
*/
1616
export enum DataCollectionPermission {
17-
AuthenticationInfo = "authenticationInfo",
18-
BookmarksInfo = "bookmarksInfo",
19-
BrowsingActivity = "browsingActivity",
20-
FinancialAndPaymentInfo = "financialAndPaymentInfo",
17+
/** Contact and identifying information such as name, address, email, etc. */
18+
PersonallyIdentifyingInfo = "personallyIdentifyingInfo",
19+
/** Medical information, including medical history, diagnoses and treatments */
2120
HealthInfo = "healthInfo",
22-
LocationInfo = "locationInfo",
21+
/** Financial and payment data (cards, transactions, credit scores) */
22+
FinancialAndPaymentInfo = "financialAndPaymentInfo",
23+
/** Authentication data (usernames, passwords, PIN codes) */
24+
AuthenticationInfo = "authenticationInfo",
25+
/** Personal communications (emails, chats, social‑media messages) */
2326
PersonalCommunications = "personalCommunications",
24-
PersonallyIdentifyingInfo = "personallyIdentifyingInfo",
27+
/** Location data (region, GPS coordinates and similar) */
28+
LocationInfo = "locationInfo",
29+
/** Information about websites visited and pages viewed */
30+
BrowsingActivity = "browsingActivity",
31+
/** Content of web pages (text, images, video, links and embedded elements) */
32+
WebsiteContent = "websiteContent",
33+
/** User activity on websites (scrolling, clicks, typing, downloads) */
34+
WebsiteActivity = "websiteActivity",
35+
/** Search terms entered in search engines or the address bar */
2536
SearchTerms = "searchTerms",
37+
/** Firefox bookmark data: URLs, titles, folder names */
38+
BookmarksInfo = "bookmarksInfo",
39+
/** Technical and usage data (device/browser info, extension settings, crash reports) */
2640
TechnicalAndInteraction = "technicalAndInteraction",
27-
WebsiteActivity = "websiteActivity",
2841
}
2942

3043
export interface DataCollectionPermissions {

0 commit comments

Comments
 (0)