[Affected versions]: Firefox 55.0a1 (2017-05-29) [Affected platforms]: Windows 10 64-bit Ubuntu 16.04 32-bit [Steps to reproduce]: 1.Launch Firefox with a clean profile. 2.Install the following add-on: https://addons.mozilla.org/en-US/firefox/addon/screenshot-capture-annotate/ 3.Navigate to a new webpage (e.g. https://www.amazon.com/) 4.Click on the webextension icon from toolbar. 5.Select “Capture the entire page” or “Capture selected area”. [Expected Results]: The webextension options work without any issue. [Actual Results]: - The screenshot is not opened in webextension editing tab. - The following errors are thrown in Browser Console while selecting the affected capturing options: SyntaxError: expected expression, got ')' void();:1:5 Error: runtime.sendMessage's extensionId argument is invalid undefined - See attached screencast. [Regression Range]: Last good revision: 952c5438a347b382be5f6ac516365c9a299818bd First bad revision: 70db5f9c852d04d2d73e879f80385c2c484c2f17 Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=952c5438a347b382be5f6ac516365c9a299818bd&tochange=70db5f9c852d04d2d73e879f80385c2c484c2f17 Looks like the following bug has the changes which introduced the regression: https://bugzilla.mozilla.org/show_bug.cgi?id=1259944
2 years ago
Ugh, Awesome Screenshot is calling runtime.sendMessage(object, undefined) with the intention that object is the message and undefined is the callback. But based on  we treat those arguments as extensionId, message.  http://searchfox.org/mozilla-central/rev/b318c7dca7392bd16c0b11929f55b1be133f0b31/toolkit/components/extensions/ext-c-runtime.js#57-67
Summary: Two Awesome Screenshot capturing options are broken → runtime.sendMessage() argument parsing should consider an undefined callback
andy said you recently changed this area
Assignee: nobody → tomica
Status: NEW → ASSIGNED
Comment on attachment 8875478 [details] Bug 1368669 - Support explicit null callback for runtime.sendMessage https://reviewboard.mozilla.org/r/146916/#review151522 Thanks, I was overthinking this, thinking it would be more complicated but this looks good.
Attachment #8875478 - Flags: review?(aswan) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/c89f7b976dea Support explicit null callback for runtime.sendMessage r=aswan
Confirm that this issue is fixed on Firefox 55.0a1 (2017-06-11) under Windows 10 64-bit and Ubuntu 16.04 32-bit. The webextension options work as expected.
Updated (again!) -> https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/runtime/sendMessage#Parameters Let me know if this is accurate.
I have reparse this every time, but yeah, it looks good.
You need to log in before you can comment on or make changes to this bug.