Closed Bug 839271 Opened 11 years ago Closed 11 years ago

context-menu reuses the same worker when a page navigates to a new location

Categories

(Add-on SDK Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mossop, Assigned: mossop)

References

Details

Attachments

(1 file)

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.
Attachment #711580 - Flags: review?(poirot.alex)
Blocks: 839322
Assignee: nobody → dtownsend+bugmail
Attachment #711580 - Flags: review?(poirot.alex) → review?(evold)
Attachment #711580 - Flags: review?(evold) → review+
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
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
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)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: