Bug 1964962 - Make sure HTML link is present when needed in the post add-on install prompt. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D248278
This commit is contained in:
committed by
wdurand@mozilla.com
parent
69483d31c0
commit
43e6a72132
@@ -748,7 +748,6 @@ customElements.define(
|
||||
) {
|
||||
connectedCallback() {
|
||||
this.descriptionEl = this.querySelector("#addon-install-description");
|
||||
this.settingsLinkEl = this.querySelector("#addon-install-settings-link");
|
||||
|
||||
this.addEventListener("click", this);
|
||||
}
|
||||
@@ -757,12 +756,16 @@ customElements.define(
|
||||
this.removeEventListener("click", this);
|
||||
}
|
||||
|
||||
get #settingsLinkId() {
|
||||
return "addon-install-settings-link";
|
||||
}
|
||||
|
||||
handleEvent(event) {
|
||||
const { target } = event;
|
||||
|
||||
switch (event.type) {
|
||||
case "click": {
|
||||
if (target.id === this.settingsLinkEl.id) {
|
||||
if (target.id === this.#settingsLinkId) {
|
||||
const { addonId } = this.notification.options.customElementOptions;
|
||||
|
||||
BrowserAddonUI.openAddonsMgr(
|
||||
@@ -791,14 +794,22 @@ customElements.define(
|
||||
}
|
||||
|
||||
render() {
|
||||
this.settingsLinkEl.hidden = true;
|
||||
|
||||
let fluentId = "appmenu-addon-post-install-message3";
|
||||
|
||||
this.ownerDocument.l10n.setAttributes(this.descriptionEl, null);
|
||||
this.querySelector(`#${this.#settingsLinkId}`)?.remove();
|
||||
|
||||
if (this.#dataCollectionPermissionsEnabled) {
|
||||
MozXULElement.insertFTLIfNeeded(
|
||||
"locales-preview/dataCollectionPermissions.ftl"
|
||||
);
|
||||
this.settingsLinkEl.hidden = false;
|
||||
|
||||
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
const link = document.createElementNS(HTML_NS, "a");
|
||||
link.setAttribute("id", this.#settingsLinkId);
|
||||
link.setAttribute("data-l10n-name", "settings-link");
|
||||
this.descriptionEl.append(link);
|
||||
|
||||
fluentId = "appmenu-addon-post-install-message-with-data-collection";
|
||||
}
|
||||
|
||||
|
||||
@@ -224,9 +224,7 @@
|
||||
buttonhighlight="true"
|
||||
hidden="true">
|
||||
<popupnotificationcontent class="addon-installed-notification-content" orient="vertical">
|
||||
<description id="addon-install-description">
|
||||
<html:a id="addon-install-settings-link" data-l10n-name="settings-link"></html:a>
|
||||
</description>
|
||||
<description id="addon-install-description"></description>
|
||||
</popupnotificationcontent>
|
||||
</popupnotification>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user