Closed
Bug 1208761
Opened 9 years ago
Closed 9 years ago
chrome.i18n is undefined in content scripts
Categories
(WebExtensions :: Untriaged, defect, P1)
WebExtensions
Untriaged
Tracking
(firefox45 fixed)
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: callahad, Assigned: kmag)
References
Details
(Keywords: dev-doc-complete, DevAdvocacy, Whiteboard: [i18n])
Attachments
(1 file)
On https://wiki.mozilla.org/WebExtensions, we claim to support chrome.i18n.getMessage() with "@@extension_id" and "@@ui_locale" predefined messages. These appear to work in background scripts. The Chrome docs at https://developer.chrome.com/extensions/content_scripts state that the i18n API should be available to content_scripts. In Firefox, it is not. Steps to Reproduce: 1. In a content script, call console.log("@@extension_id is", chrome.i18n.getMessage("@@extension_id")); What should happen: - A uuid should get logged to the console What actually happens: - "chrome.i18n is undefined" shows up in the Browser Console This causes the Reddit Enhancement Suite to throw: https://github.com/honestbleeps/Reddit-Enhancement-Suite/blob/v4.5.4/Chrome/browsersupport-chrome.js#L116 Test case in the "i18n_content_script" folder of https://github.com/callahad/webextension-tests
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Comment 1•9 years ago
|
||
This no longer blocks 1208765, as RES has moved away from this API.
No longer blocks: webext-port-reddit-enhancement-suite
Keywords: dev-doc-needed
Updated•9 years ago
|
Whiteboard: [i18n]
Blocks: webext
Priority: -- → P1
Updated•9 years ago
|
Flags: blocking-webextensions+
Assignee | ||
Updated•9 years ago
|
Iteration: --- → 45.2 - Nov 30
Assignee | ||
Comment 2•9 years ago
|
||
Bug 1208761: [webext] Support l10n.getMessage in content scripts. r?billm
Attachment #8691163 -
Flags: review?(wmccloskey)
Comment on attachment 8691163 [details] MozReview Request: Bug 1208761: [webext] Support l10n.getMessage in content scripts. r?billm https://reviewboard.mozilla.org/r/26081/#review23459 ::: toolkit/components/extensions/test/mochitest/test_ext_i18n.html:83 (Diff revision 1) > + if (actual !== expected) { Can you just send a message to the extension that includes actual and expected? Then the extension could do assertEq. That way we get a message printed when the test succeeds. The downside is that actual and expected must support structured clone. But in this case I can't see how they wouldn't.
Attachment #8691163 -
Flags: review?(wmccloskey) → review+
Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/4dca10306d58d2e87cbed46a72472b62c17b0ec9 Bug 1208761: [webext] Support l10n.getMessage in content scripts. r=billm
Comment 5•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4dca10306d58
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Assignee | ||
Comment 6•9 years ago
|
||
Updated https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities
Keywords: dev-doc-needed → dev-doc-complete
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•