[Privacy Sandbox] Add PSExtensionsAPI message for deprecation issue

This CL ads the deprecation message and milestone to be shown when the
PrivacyExtensionsAPI shows up on the Issues DevTools Panel.
See http://go/cl-c/4166933 and http://go/cl-c/4171292 for context.

Bug: 1378703, b/254414152
Change-Id: Ifd4502a895a7fbfff04a1025054922b08b9295ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4171293
Commit-Queue: Filipa Senra <fsenra@google.com>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
This commit is contained in:
Filipa Senra
2023-01-26 18:32:46 +00:00
committed by Devtools-frontend LUCI CQ
parent f0bf0ece4a
commit 226d2bf4d7
4 changed files with 73 additions and 0 deletions
@@ -396,6 +396,18 @@ const UIStrings = {
*/
overflowVisibleOnReplacedElement:
'Specifying `overflow: visible` on img, video and canvas tags may cause them to produce visual content outside of the element bounds. See https://github.com/WICG/shared-element-transitions/blob/main/debugging_overflow_on_images.md.',
/**
* @description Warning displayed to developers that the API
* `chrome.privacy.websites.privacySandboxEnabled` is being deprecated in
* favour of three new more granular APIs: topicsEnabled, FledgeEnabled and
* adMeasurementEnabled. The `privacySandboxEnabled` API allowed extensions to
* control the homologous Chrome Setting. The existing Chrome Setting for
* Privacy Sandbox is also going away in favor of more granular settings that
* are matched by the new extensions APIs- topicsEnabled, FledgeEnabled and
* adMeasurementEnabled.
*/
privacySandboxExtensionsAPI:
'We’re deprecating the API `chrome.privacy.websites.privacySandboxEnabled`, though it will remain active for backward compatibility until release M113. Instead, please use `chrome.privacy.websites.topicsEnabled`, `chrome.privacy.websites.fledgeEnabled` and `chrome.privacy.websites.adMeasurementEnabled`. See https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled.',
};
// clang-format on
const str_ = i18n.i18n.registerUIStrings('models/issues_manager/DeprecationIssue.ts', UIStrings);
@@ -599,6 +611,10 @@ export class DeprecationIssue extends Issue {
UIStrings.deprecatedWithReplacement,
{PH1: 'HTMLVideoElement.webkitSupportsFullscreen', PH2: 'Document.fullscreenEnabled'});
break;
case Protocol.Audits.DeprecationIssueType.PrivacySandboxExtensionsAPI:
messageFunction = i18nLazyString(UIStrings.privacySandboxExtensionsAPI);
milestone = 113;
break;
case Protocol.Audits.DeprecationIssueType.RangeExpand:
messageFunction =
i18nLazyString(UIStrings.deprecatedWithReplacement, {PH1: 'Range.expand()', PH2: 'Selection.modify()'});
@@ -45,6 +45,10 @@ export const markdownLinks = new Map<string, string>([
'https://github.com/WICG/shared-element-transitions/blob/main/debugging_overflow_on_images.md',
'https://github.com/WICG/shared-element-transitions/blob/main/debugging_overflow_on_images.md',
],
[
'https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled',
'https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled',
],
]);
export const getMarkdownLink = (key: string): string => {
+1
View File
@@ -25,6 +25,7 @@ node_ts_library("issues") {
"issue-view-reparent_test.ts",
"low-text-contrast-issues_test.ts",
"navigator-user-agent-issues_test.ts",
"privacy-sandbox-extensions-api_test.ts",
"quirks-mode-issues_test.ts",
"quota-issues_test.ts",
"report-only_test.ts",
@@ -0,0 +1,52 @@
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {assertNotNullOrUndefined, getBrowserAndPages, goToResource} from '../../shared/helper.js';
import {describe, it} from '../../shared/mocha-extensions.js';
import {
ensureResourceSectionIsExpanded,
expandIssue,
getIssueByTitle,
getResourcesElement,
navigateToIssuesTab,
waitForTableFromResourceSectionContents,
} from '../helpers/issues-helpers.js';
describe('Privacy Sandbox Extensions API', async () => {
beforeEach(async () => {
await goToResource('empty.html');
});
it('should report privacy sandbox extensions api deprecation issues', async () => {
await navigateToIssuesTab();
const {frontend} = getBrowserAndPages();
frontend.evaluate(() => {
const issue = {
code: 'DeprecationIssue',
details: {
deprecationIssueDetails: {
sourceCodeLocation: {
url: 'empty.html',
lineNumber: 1,
columnNumber: 1,
},
type: 'PrivacySandboxExtensionsAPI',
},
},
};
// @ts-ignore
window.addIssueForTest(issue);
});
await expandIssue();
const issueElement = await getIssueByTitle('Deprecated Feature Used');
assertNotNullOrUndefined(issueElement);
const section = await getResourcesElement('1 source', issueElement, '.affected-resource-label');
await ensureResourceSectionIsExpanded(section);
const expectedTableRows = [
['empty.html:2'],
];
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
});
});