Calling a background script version of i18n.getMessage from a popup page causes an exception

Issue #12793975 • Assigned to Akshay P.

Details

Author
Oleksandr P.
Created
Jul 17, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

When passing the i18n object from the background page to the popup script i18n.getMessage is somehow different than if called directly. The minimal extension with reproduction of the problem is attached. See: popup.js for the error.

const backgroundPage = browser.extension.getBackgroundPage();
window.ext = Object.create(backgroundPage.ext);

let substValue = (0).toLocaleString();
// Exception on the line below.
// Uncommenting the next line fixes the issue. Also not having subsitutes
// fixes the issue
// ext.i18n = browser.i18n;
try
{
    let i18nmessage = ext.i18n.getMessage("i18nmessage", [substValue]);
    alert(i18nmessage);
}
catch(e)
{
    alert(e);
}

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “James M.”

    Changed Assigned To to “Akshay P.”

    Changed Assigned To from “Akshay P.” to “Mohit R.”

    Changed Status to “Confirmed”

    Changed Assigned To to “Akshay P.”

    Changed Status from “Confirmed”

You need to sign in to your Microsoft account to add a comment.

Sign in