Bug 1186843 - Always cache delayed scripts in message manager

This commit is contained in:
Kan-Ru Chen 2015-09-16 16:06:30 +08:00
parent 420a083cd5
commit 21cb002f63

View File

@ -518,16 +518,9 @@ nsFrameMessageManager::LoadScript(const nsAString& aURL,
bool aRunInGlobalScope)
{
if (aAllowDelayedLoad) {
if (IsGlobal() || IsBroadcaster()) {
// Cache for future windows or frames
mPendingScripts.AppendElement(aURL);
mPendingScriptsGlobalStates.AppendElement(aRunInGlobalScope);
} else if (!mCallback) {
// We're frame message manager, which isn't connected yet.
mPendingScripts.AppendElement(aURL);
mPendingScriptsGlobalStates.AppendElement(aRunInGlobalScope);
return NS_OK;
}
// Cache for future windows or frames
mPendingScripts.AppendElement(aURL);
mPendingScriptsGlobalStates.AppendElement(aRunInGlobalScope);
}
if (mCallback) {