Closed Bug 1891502 Opened 2 years ago Closed 2 years ago

"undefined: undefined" error in console when content script does not exist

Categories

(WebExtensions :: General, defect)

defect

Tracking

(firefox127 fixed)

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

While looking into bug 1884298, I found that when a content script does not exist, that undefined: undefined is printed at https://searchfox.org/mozilla-central/rev/d23849dd6d83edbe681d3b4828700256ea34a654/toolkit/components/extensions/ExtensionContent.sys.mjs#626.

This happens because the error is unexpectedly a string instead of an object.

Although the issue could be solved (along with bug 1824896) by making sure that an error object is emitted from https://searchfox.org/mozilla-central/rev/d23849dd6d83edbe681d3b4828700256ea34a654/js/xpconnect/loader/ChromeScriptLoader.cpp#453,460, I'm going to fix this bug specifically by replacing the manual ${error.name}: ${error.message} serialization with error.toString(), since that would also address other cases where a string is encountered instead of an object.

Whiteboard: [addons-jira]
Assignee: nobody → rob
Status: NEW → ASSIGNED
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/7e8c4adc46e1 Log meaningful message instead of undefined:undefined r=willdurand
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: