Last Comment Bug 839271 - context-menu reuses the same worker when a page navigates to a new location
: context-menu reuses the same worker when a page navigates to a new location
Status: RESOLVED FIXED
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: P1 blocker (vote)
: ---
Assigned To: Dave Townsend [:mossop]
:
Mentors:
Depends on:
Blocks: 839322
  Show dependency treegraph
 
Reported: 2013-02-07 14:39 PST by Dave Townsend [:mossop]
Modified: 2013-02-08 19:25 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/774 (355 bytes, text/html)
2013-02-07 15:57 PST, Dave Townsend [:mossop]
evold: review+
Details

Description Dave Townsend [:mossop] 2013-02-07 14:39:57 PST
If you have a context or click event handler for your context menu item, use it on a webpage then load a new url in the same tab and try to use it again the handlers will still operate on the old page, mostly with exceptions as a result as the old page is no longer available.

This happens because we cache the worker to use using the window as a key, but that's the outer window that doesn't change. The code destroys the worker when the page is unloaded, but when navigating to a new url the page is merely hidden and only unloaded after history fills or the tab is closed.
Comment 1 Dave Townsend [:mossop] 2013-02-07 15:57:27 PST
Created attachment 711580 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/774

Pointer to Github pull-request
Comment 2 [github robot] 2013-02-08 14:26:03 PST
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/15196a13eeb8f4c7096fa33b62dc98b27710bb95
Bug 839271: Use the inner window ID to cache workers so we get a new one if the outer window doesn't change.

https://github.com/mozilla/addon-sdk/commit/f660caaf5759771189ee8787ec704e3766e3eff2
Bug 839271: Address review comments.

https://github.com/mozilla/addon-sdk/commit/ef756d4d0cf428d4359b845513a41e019ac88ea5
Merge pull request #774 from Mossop/bug839271

Bug 839271: Use the inner window ID to cache workers so we get a new one if the outer window doesn't change. r=erikvold
Comment 3 [github robot] 2013-02-08 19:25:49 PST
Commits pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/5bc5d859bd2b2986ceaefc0f5d70401cce3ba94d
Bug 839271: Use the inner window ID to cache workers so we get a new one if the outer window doesn't change.
(cherry picked from commit 15196a13eeb8f4c7096fa33b62dc98b27710bb95)

https://github.com/mozilla/addon-sdk/commit/9ff90a7f615769c1438b3dbbb0910c061519f346
Bug 839271: Address review comments.
(cherry picked from commit f660caaf5759771189ee8787ec704e3766e3eff2)

Note You need to log in before you can comment on or make changes to this bug.