Open Bug 1721393 Opened 3 years ago Updated 8 months ago

Lost translation of extension name in permissions request doorhanger

Categories

(WebExtensions :: General, defect, P2)

Firefox 90
defect

Tracking

(firefox-esr78 unaffected, firefox90 wontfix, firefox91 wontfix, firefox92 fix-optional)

Tracking Status
firefox-esr78 --- unaffected
firefox90 --- wontfix
firefox91 --- wontfix
firefox92 --- fix-optional

People

(Reporter: manikulin, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

Localization key is shown sometimes instead of i18n message in doorhanger for optional permissions.

Accordingly to https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization#internationalizing_manifest.json I tried to use extension name that may be translated to other languages. Accidentally I have notices that raw key may be shown instead of extension name.

Extension example:
file manifest.json

{
	"manifest_version": 2,
	"name": "__MSG_extName__",
	"version": "0.1",
	"default_locale": "en",
	"browser_action": { "default_title": "__MSG_extName__" },
	"background": { "scripts": [ "background.js" ] },
	"optional_permissions": [ "tabs" ]
}

file background.js

"use strict";
browser.browserAction.onClicked.addListener(function browserActionListener() {
	const permissions = browser.runtime.getManifest().optional_permissions;
	browser.permissions.request({permissions}).then(console.log, console.error);
});

file _locales/en/messages.json

{"extName": {
		"message": "LostTranslation - demo of a bug",
		"description": "Raw manifest value is shown in optional permission request doorhanger."
}}
  1. Open add-on debug tab and load it as a temporary extension.
  2. Click on the browser action button (to see that extension name is correct), decline request.
  3. Open add-on settings in a new tab and switch to permissions pane for the extension
  4. Switch to add-on debug tab and reload the extension
  5. Switch to extension settings tab, grant the permission and revoke it again
  6. Click on the browser action button

Actual results:

Doorhanger with the following text appears

MSG_extName requests additional permissions.

It wants to:

Access browser tabs

It seems, extension settings page uses stale context. I saw this bug in Firefox-89 and maybe even earlier.

Expected results:

Translated message should appear in the doorhanger

Sorry, underscores are lost due to markdown, actual doorhanger content:

__MSG_extName__ requests additional permissions.

Hello,

I reproduced the issue on the latest Nightly (92.0a1/20210721212617), Beta (91.0b5/20210720190304) and Release (90.0.1/20210716144314) under Windows 10 x64 and Ubuntu 16.04 LTS.

The content of the doorhanger which appears as a results of Step 2 is LostTranslation – demo of a bug requests additional permissions.. By Step 6, the content in the doorhanger is __MSG_extName__ requests additional permissions., confirming the issue. For further details, see the attached screenshot.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image 2021-07-22_10h10_12.png

Hey Alex, can you please check if this is a regression?

Flags: needinfo?(acornestean)

Hello,

Narrowed the regression window between 2020-10-19 when there was no possibility to grant/remove optional permissions from the permissions pane (when loading the test add-on the permissions pane states “This extension doesn’t require any permissions” and there is no permissions toggle button.) and 2020-10-20 when this option was added via https://bugzilla.mozilla.org/show_bug.cgi?id=1624513.

Regression results:

2021-07-27T11:25:49.481000: DEBUG : Found commit message:
Bug 1624513 (https://bugzilla.mozilla.org/show_bug.cgi?id=1624513) add optional permission controls to about:addons r=rpl,mstriemer,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D85801

Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=bc4a177b07e47769bc77b876ba38fb1a2f6dc85b&tochange=95404de0380e69ee400abc64de10e872f1918754

Has Regression Range: --- → yes
Flags: needinfo?(acornestean)
Regressed by: 1624513
Severity: -- → S3
Flags: needinfo?(mixedpuppy)
Priority: -- → P2
Flags: needinfo?(mixedpuppy)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: