Open
Bug 826331
Opened 13 years ago
Updated 3 years ago
`hideChromeForLocation` is error prone for restartless add-on
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
NEW
People
(Reporter: zer0, Unassigned)
Details
The code suggested in bug 628863 and on MDN (https://developer.mozilla.org/en-US/docs/Hiding_browser_chrome) is error prone on restartless Add-on.
If a restartless add-on is chaining the `hideChromeForLocation` method as suggested in the MDN:
XULBrowserWindow.hideChromeForLocation = function(aLocation) {
return (/* your test goes here */) || prevFunc.apply(XULBrowserWindow, [aLocation]);
}
When is unistalled or disabled, it will probably set the `prevFunc` back to the `hideChromeForLocation` method. But let's say that add-on A and B are chaining both this method: if add-on B is disabled, then what's happened to the function chained previously by add-on A?
We should provide a safer approach to the add-on developer.
For example, `inContentWhitelist` could accept not only string, but regexp and function as well, and be more flexible. In this way, an add-on will just remove its function (or regexp) from the list during the cleanup; without affects any other add-on.
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•