mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out changeset f786dcb23eca (bug 1092156)
This commit is contained in:
parent
5b6c60725b
commit
45d236bfbb
@ -2266,12 +2266,7 @@ CreateNativeGlobalForInner(JSContext* aCx,
|
||||
top = aNewInner->GetTop();
|
||||
}
|
||||
JS::CompartmentOptions options;
|
||||
|
||||
// Sometimes add-ons load their own XUL windows, either as separate top-level
|
||||
// windows or inside a browser element. In such cases we want to tag the
|
||||
// window's compartment with the add-on ID. See bug 1092156.
|
||||
options.setAddonId(MapURIToAddonID(aURI));
|
||||
|
||||
if (top) {
|
||||
if (top->GetGlobalJSObject()) {
|
||||
options.setSameZoneAs(top->GetGlobalJSObject());
|
||||
|
@ -346,13 +346,8 @@ XPCWrappedNativeScope::EnsureAddonScope(JSContext *cx, JSAddonId *addonId)
|
||||
MOZ_ASSERT(addonId);
|
||||
MOZ_ASSERT(nsContentUtils::IsSystemPrincipal(GetPrincipal()));
|
||||
|
||||
// In bug 1092156, we found that add-on scopes don't work correctly when the
|
||||
// window navigates. The add-on global's prototype is an outer window, so,
|
||||
// after the navigation, looking up window properties in the add-on scope
|
||||
// will fail. However, in most cases where the window can be navigated, the
|
||||
// entire window is part of the add-on. To solve the problem, we avoid
|
||||
// returning an add-on scope for a window that is already tagged with the
|
||||
// add-on ID.
|
||||
// If the global is already part of the add-on then there's no reason to
|
||||
// create a new one.
|
||||
if (AddonIdOfObject(global) == addonId)
|
||||
return global;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user