Skip to content

Commit 27ecbe8

Browse files
committed
Bug 1885421 - Fix migration wizard links not opening in new tabs. r=mconley,migration-reviewers
The support-text links should open a new tab instead of interrupting the migration process. Differential Revision: https://phabricator.services.mozilla.com/D204693
1 parent d11b64b commit 27ecbe8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

browser/components/migration/content/migration-wizard.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ export class MigrationWizard extends HTMLElement {
772772
MigrationWizardConstants.DISPLAYED_RESOURCE_TYPES.EXTENSIONS
773773
) {
774774
messageText.textContent = "";
775+
this.#extensionsSuccessLink.target = "_blank";
775776
this.#extensionsSuccessLink.textContent =
776777
state.progress[resourceType].message;
777778
}
@@ -787,6 +788,7 @@ export class MigrationWizard extends HTMLElement {
787788
messageText.textContent = state.progress[resourceType].message;
788789
supportLink.textContent = state.progress[resourceType].linkText;
789790
supportLink.href = state.progress[resourceType].linkURL;
791+
supportLink.target = "_blank";
790792
remainingProgressGroups--;
791793
totalWarnings++;
792794
break;
@@ -800,11 +802,13 @@ export class MigrationWizard extends HTMLElement {
800802
messageText.textContent = state.progress[resourceType].message;
801803
supportLink.textContent = state.progress[resourceType].linkText;
802804
supportLink.href = state.progress[resourceType].linkURL;
805+
supportLink.target = "_blank";
803806
if (
804807
resourceType ==
805808
MigrationWizardConstants.DISPLAYED_RESOURCE_TYPES.EXTENSIONS
806809
) {
807810
messageText.textContent = "";
811+
this.#extensionsSuccessLink.target = "_blank";
808812
this.#extensionsSuccessLink.textContent =
809813
state.progress[resourceType].message;
810814
}

browser/components/migration/tests/chrome/test_migration_wizard.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@
724724
extensionsGroup.querySelector("a.message-text").href,
725725
EXTENSIONS_INFO_HREF
726726
);
727+
is(
728+
extensionsGroup.querySelector("a.message-text").target,
729+
"_blank"
730+
);
727731
is(
728732
extensionsGroup.querySelector(".support-text").textContent,
729733
EXTENSIONS_SUPPORT_STRING
@@ -732,6 +736,10 @@
732736
extensionsGroup.querySelector(".support-text").href,
733737
EXTENSIONS_SUPPORT_HREF
734738
);
739+
is(
740+
extensionsGroup.querySelector(".support-text").target,
741+
"_blank"
742+
);
735743

736744
// With progress being complete, the header should be using the completed
737745
// migration string.
@@ -792,6 +800,10 @@
792800
extensionsGroup.querySelector(".support-text").href,
793801
EXTENSIONS_SUPPORT_HREF
794802
);
803+
is(
804+
extensionsGroup.querySelector(".support-text").target,
805+
"_blank"
806+
);
795807

796808
// With progress being complete, the header should be using the completed
797809
// migration string.

0 commit comments

Comments
 (0)