firefox-client icon indicating copy to clipboard operation
firefox-client copied to clipboard

"type":"tabListChanged" message is wrongly treated as a response for a request

Open piroor opened this issue 7 years ago • 0 comments

Description

I'm using this as a part of web-ext. When I try to start Firefox 57 with a session including large number of tabs via the tool, I got "Unexpected packet from actor ..." and Firefox cannot be started. After I researched, I thought that firefox-client seems to handle "type":"tabListChanged" messages from the server as a response for a "type":"installTemporaryAddon" request. I think the message should be treated as a unsolicited event and ignored as a response for "type":"installTemporaryAddon" request.

My environment is: Node.js 8.9.1 on Windows 10 Creators Update

Steps to reproduce

  1. Install web-ext, like npm install -g web-ext.
  2. Start Firefox 57, set to restore all tabs and windows on the next startup, and shutdown.
  3. Copy the Firefox's profile to another location.
  4. Activate logging of .../node_modules/.../firefox-client/lib/client.js by modifying the log method to output all logs. (Sorry I don't know how to that without such patching...)
  5. Start Firefox 57 via web-ext, like: web-ext run --firefox="C:\path\to\firefox" --keep-profile-changes --firefox-profile=C:\path\to\profile\with\large-number-tabs\copied\at\step3 --source-dir=C:\path\to\addon\repository

Expected result

Firefox starts and the specified addon is loaded as a temporary addon.

Actual result

Firefox starts but suddenly shutdown. In the console, an error is reported:

...
response: [33m{"addon":{"id":"[email protected]","actor":false},"from":"server1.conn0.addonsActor141"}[39m
Installed C:\Users\piro\codes\treestyletab\webextensions as a temporary add-on
request: [32m{"to":"root","type":"listTabs"}[39m
response: [33m{"from":"root","type":"tabListChanged"}[39m

WebExtError: Temporary add-on installation is not supported in this version of Firefox (you need Firefox 49 or higher). For older Firefox versions, use --pre-install
    at FirefoxDesktopExtensionRunner._callee6$ (C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\extension-runners\firefox-desktop.js:288:19)
    at tryCatch (C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\node_modules\regenerator-runtime\runtime.js:65:40)
    at Generator.invoke [as _invoke] (C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\node_modules\regenerator-runtime\runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as throw] (C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\node_modules\regenerator-runtime\runtime.js:117:21)
    at step (C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:1)
    at C:\Users\piro\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\node_modules\babel-runtime\helpers\asyncToGenerator.js:30:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

piroor avatar Nov 15 '17 15:11 piroor