mozilla/addon-sdk — pull request #1564 by ZER0 (2014-07-25 17:34:27+00:00)
Title: Bug 1043648 Calling `window.stop` in page-worker's content script cause error in console

It seems that `window.stop` makes `pageshow` to be emitted, before the `contentWorker` is actually set.
Set the `contentWorker` before the listeners seems resolve the issue.

Notice that the unit test is on `test-page-worker` instead of `test-content-worker` because using directly the worker doesn't cause such issue – probably because some frame stuff related.