Please report any other irregularities here.
Created attachment 8898191 [details] a webextensions demo User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20170802111520 Steps to reproduce: I use content script created a iframe and insert to page in my webextensions, then, The background script use broswer.tab.sendmessage send message, iframe script response it. I find it's no works when iframe listener return a promise, but ,if listener called the sendResponse function, it will works. you can install file description webextensions, click the broswerAction button, it will insert a iframe in page. clink the iframe inner button ,check console ,you will easy to understand what i say Actual results: content script created iframe and insert to page, iframe script broswer.message.onMessage listener return a promise will be invalid. Expected results: expected it can same as content script
Component: Untriaged → WebExtensions: Untriaged
Product: Firefox → Toolkit
Version: 57 Branch → Trunk
For what its worth, I simplified your script down and found that basically sending sendMessage with Promise based replies between a content script and background script seems to work just fine, that was my main concern. Zombie might know more.
Flags: needinfo?(amckay) → needinfo?(tomica)
Priority: -- → P5
This happens because of the way we handle content script API bindings in unprivileged extension frames. We create the bindings in a Sandbox rather than in the window global, but when we check whether a return value is a promise, we test against the Promise constructor in the sandbox.
Thanks Kris. Would you call this by design then, and we should close?
No, it's definitely a bug.
You need to log in before you can comment on or make changes to this bug.