Lost translation of extension name in permissions request doorhanger
Categories
(WebExtensions :: General, defect, P2)
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)
5.36 KB,
image/png
|
Details |
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."
}}
- Open add-on debug tab and load it as a temporary extension.
- Click on the browser action button (to see that extension name is correct), decline request.
- Open add-on settings in a new tab and switch to permissions pane for the extension
- Switch to add-on debug tab and reload the extension
- Switch to extension settings tab, grant the permission and revoke it again
- 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.
Comment 2•3 years ago
|
||
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.
Comment 3•3 years ago
|
||
Comment 4•3 years ago
|
||
Hey Alex, can you please check if this is a regression?
Comment 5•3 years ago
•
|
||
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
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•8 months ago
|
Description
•