Start using Cu.nukeSandbox

RESOLVED FIXED

Status

Add-on SDK
General
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: ochameau, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
Now that bug 769273 has now landed in m-c, we should start using Cu.nukeSandox in order to kill all leaks on addon disabling.

Here is a pull request to start using it on CommonJS modules:
  https://github.com/mozilla/addon-sdk/pull/479

We may want to use it for content script sandboxes too.
(Reporter)

Comment 1

5 years ago
Works perfectly!
Given pull request 479 and last try server build from gabor (bug 769273 comment 39)
And an awfull addons which desperatly want to leak by using such code:
  require("window-utils").activeBrowserWindow.foo = this;

We end up leaking only cuddlefish and loader sandboxes instead of all 41 module sandboxes! We are leaking these two because we don't call nukeSandbox on them.

Comment 2

5 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/220332b32b255d508de9f583d149216302c3adbe
Bug 775067: Start using Cu.nukeSandbox for CommonJS modules.

https://github.com/mozilla/addon-sdk/commit/13eb5e5cbfd6104e18cf76aadf276eabfc3f5265
Merge pull request #479 from ochameau/leak/use-nukeSandbox

Bug 775067: Prevent leaking sandboxes by using Cu.nukeSandbox. r=@gozala
(In reply to Alexandre Poirot (:ochameau) from comment #1)
> We end up leaking only cuddlefish and loader sandboxes instead of all 41
> module sandboxes! We are leaking these two because we don't call nukeSandbox
> on them.

Hopefully bug 771409 will take care of that!

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Priority: -- → P2
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.