Closed Bug 1451699 Opened 6 years ago Closed 6 years ago

Adding a listener to an event defined in a bundled experiment breaks execution

Categories

(WebExtensions :: Experiments, defect)

61 Branch
defect
Not set
normal

Tracking

(firefox61 affected)

RESOLVED INVALID
Tracking Status
firefox61 --- affected

People

(Reporter: fwollsen, Unassigned)

References

Details

Adding a listener to an event defined in a bundled experiment breaks execution.

[Steps to reproduce]:
1. Follow instructions on https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/events.html to implement an event

[Expected result]:
- "Something happened" should be reported in the browser log
- The browser log should not display errors

[Actual result]:
- The following error is reported in the browser log:

ReferenceError: reference to undefined property "type" Schemas.jsm:2881:9
TypeError: type is undefined Schemas.jsm:2895:5 

[Code to reproduce]

git clone https://github.com/motin/webext-experiment-hello.git -b embedded-with-an-event-implemented embedded-with-an-event-implemented
cd embedded-with-an-event-implemented/extension && web-ext run --bc -f nightly

Direct link to the implementation diff: https://github.com/motin/webext-experiment-hello/commit/ac0f4f9d9aae23a706812d861cf5568a3c130a8b

[Notes]
I am uncertain as to if this is a bug in tree, docs or simply a misunderstanding of the docs from my side. If anything, the error message could be improved.
This is indeed only a documentation issue. As explained in https://github.com/motin/webext-experiment-hello/commit/ac0f4f9d9aae23a706812d861cf5568a3c130a8b#r28433339

> The events need to have a "type" property set to "function" (e.g. as the browserAction.onClicked API schema is doing here: https://searchfox.org/mozilla-central/rev/f860c2bf00576959b07e2d9619c7b5088b0005be/browser/components/extensions/schemas/browser_action.json#451

Thanks rpl for sorting this out! :)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
The issue in the docs has been fixed in Bug 1451767.
See Also: → 1451767
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.