Skip to content

Commit c744b36

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
Fix missing utm_source=devtools for several links.
The Sources panel "Learn more" links as well as the links in the What's new in DevTools panel were missing the `utm_source=devtools`. Fixed: 400655696 Change-Id: I450c19446f48afef5007ff835d9a330e9b202aec Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6339707 Commit-Queue: Alex Rudenko <[email protected]> Auto-Submit: Benedikt Meurer <[email protected]> Reviewed-by: Alex Rudenko <[email protected]>
1 parent 463128c commit c744b36

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

front_end/panels/sources/SourcesNavigator.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class FilesNavigatorView extends NavigatorView {
203203
const placeholder =
204204
new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noWorkspace), i18nString(UIStrings.explainWorkspace));
205205
this.setPlaceholder(placeholder);
206-
placeholder.appendLink('https://goo.gle/devtools-workspace' as Platform.DevToolsPath.UrlString);
206+
placeholder.appendLink('https://developer.chrome.com/docs/devtools/workspaces/' as Platform.DevToolsPath.UrlString);
207207

208208
const toolbar = document.createElement('devtools-toolbar');
209209
toolbar.classList.add('navigator-toolbar');
@@ -285,7 +285,7 @@ export class OverridesNavigatorView extends NavigatorView {
285285
const placeholder = new UI.EmptyWidget.EmptyWidget(
286286
i18nString(UIStrings.noLocalOverrides), i18nString(UIStrings.explainLocalOverrides));
287287
this.setPlaceholder(placeholder);
288-
placeholder.appendLink('https://goo.gle/devtools-overrides' as Platform.DevToolsPath.UrlString);
288+
placeholder.appendLink('https://developer.chrome.com/docs/devtools/overrides/' as Platform.DevToolsPath.UrlString);
289289

290290
this.toolbar = document.createElement('devtools-toolbar');
291291
this.toolbar.classList.add('navigator-toolbar');
@@ -392,7 +392,8 @@ export class SnippetsNavigatorView extends NavigatorView {
392392
super('navigator-snippets');
393393
const placeholder = new UI.EmptyWidget.EmptyWidget(UIStrings.noSnippets, UIStrings.explainSnippets);
394394
this.setPlaceholder(placeholder);
395-
placeholder.appendLink('https://goo.gle/devtools-snippets' as Platform.DevToolsPath.UrlString);
395+
placeholder.appendLink(
396+
'https://developer.chrome.com/docs/devtools/javascript/snippets/' as Platform.DevToolsPath.UrlString);
396397

397398
const toolbar = document.createElement('devtools-toolbar');
398399
toolbar.classList.add('navigator-toolbar');

front_end/panels/whats_new/ReleaseNoteView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class ReleaseNoteView extends UI.Widget.VBox {
7878
<devtools-button
7979
.variant=${Buttons.Button.Variant.PRIMARY}
8080
.jslogContext=${'learn-more'}
81-
@click=${() => input.openNewTab(releaseNote.link)}
81+
@click=${() => input.openNewTab(UI.UIUtils.addReferrerToURLIfNecessary(releaseNote.link as Platform.DevToolsPath.UrlString))}
8282
>${i18nString(UIStrings.seeFeatures)}</devtools-button>
8383
</div>
8484
@@ -87,7 +87,7 @@ export class ReleaseNoteView extends UI.Widget.VBox {
8787
${releaseNote.videoLinks.map((value: {description: string, link: Platform.DevToolsPath.UrlString, type?: VideoType}) => {
8888
return html`
8989
<x-link
90-
href=${value.link}
90+
href=${UI.UIUtils.addReferrerToURLIfNecessary(value.link)}
9191
jslog=${VisualLogging.link().track({click: true}).context('learn-more')}>
9292
<div class="video">
9393
<img class="thumbnail" src=${input.getThumbnailPath(value.type ?? VideoType.WHATS_NEW)}>

front_end/ui/legacy/EmptyWidget.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import type * as Platform from '../../core/platform/platform.js';
3333
import * as VisualLogging from '../visual_logging/visual_logging.js';
3434

3535
import emptyWidgetStyles from './emptyWidget.css.js';
36+
import {addReferrerToURLIfNecessary} from './UIUtils.js';
3637
import {VBox} from './Widget.js';
3738
import {XLink} from './XLink.js';
3839

@@ -62,7 +63,13 @@ export class EmptyWidget extends VBox {
6263
}
6364

6465
appendLink(link: Platform.DevToolsPath.UrlString): HTMLElement {
65-
const learnMoreLink = XLink.create(link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more');
66+
const learnMoreLink = XLink.create(
67+
addReferrerToURLIfNecessary(link),
68+
i18nString(UIStrings.learnMore),
69+
undefined,
70+
undefined,
71+
'learn-more',
72+
);
6673
this.#textElement.insertAdjacentElement('afterend', learnMoreLink);
6774
return learnMoreLink;
6875
}

0 commit comments

Comments
 (0)