Created attachment 8775480 [details] executeScript-at-webRequest.onCompleted.zip When tabs.executeScript is called in the webRequest.onCompleted event, the script is not injected and the console shows an error. Steps to reproduce: 1. Start Firefox with e10s. 2. Load the attached addon. 3. Open the global JS console (Ctrl-Shift-J) 4. Visit example.com. 5. Look at the global console and/or the tab's console. Expected: "Script injected in http://example.com" to be logged. Actual: Unchecked lastError value: Error: No matching message handlerExtensionUtils.jsm:305 When I step through with a debugger I see that getHandlers in MessageChannel.jsm returns an empty list because the innerWindowID of the message manager (handler.messageFilterStrict) differs from the innerWindowID of |recipient|. E.g.: handler.messageFilterStrict.innerWindowID // = 2147483680 recipient.innerWindowID // = 2147483679 Firefox versions tested: - Firefox 47.0.1 (without e10s only = works fine) - Firefox Beta (48, 2016-07-25) - Firefox Nightly (50.0a1, 2016-07-23, with and without e10s)
I'd generally expect the inner window ID of the browser to be updated long before onCompleted gets called for the main document request. But it's probably not guaranteed if the request happens very quickly. I'm not sure if this is a bug, though, strictly speaking.