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

RESOLVED FIXED

Status

Add-on SDK
General
P1
blocker
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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.
(Assignee)

Comment 1

4 years ago
Created attachment 711580 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/774

Pointer to Github pull-request
(Assignee)

Updated

4 years ago
Attachment #711580 - Flags: review?(poirot.alex)
(Assignee)

Updated

4 years ago
Blocks: 839322
(Assignee)

Updated

4 years ago
Assignee: nobody → dtownsend+bugmail
(Assignee)

Updated

4 years ago
Attachment #711580 - Flags: review?(poirot.alex) → review?(evold)
Attachment #711580 - Flags: review?(evold) → review+

Comment 2

4 years ago
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
(Assignee)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Comment 3

4 years ago
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.