browser.tabs.sendMessage currently raises an exception when the passed tabId doesn't exists in the tab manager because it tries to use an "undefined" tab. I was going to raise an Error with a more descriptive message but I noticed that on Chrome it doesn't currently raise any error, it simply becames a no-op.
Created attachment 8672863 [details] [diff] [review] fix-and-testcase.patch The attached patch contains a small change (tabs.sendMessage turned into a no-op if there is no tab with the defined tabId) and a related testcase.
Created attachment 8674816 [details] [diff] [review] fix-and-testcase.patch I've checked that this patch applies cleanly on a recent mozilla-central and I've updated the commit message.
Hi Luca, is this ready for checkin? Also, you can set the r+ flag on your own patch if I've reviewed a previous version and it hasn't changed significantly.
yes, it is I was waiting for the "try build" to be completed: https://treeherder.mozilla.org/#/jobs?repo=try&revision=63ac198f56f8 and the failures are unrelated to this change. I'm going to add the r+ and the checkin-needed.