Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js

Issue 684143002: Invalidate the previous frame when the window object is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK_EQ(frame_, frame) -> DCHECK again Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js
diff --git a/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js b/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js
index aaec95845229d77a7539838551ea3d89c202f9dc..e6db6c5f0774d8ba3f30280f703d3c54bf0f9596 100644
--- a/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js
+++ b/chrome/test/data/extensions/api_test/content_scripts/about_blank_iframes/content_script.js
@@ -2,4 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.extension.sendRequest(window.parent === window ? "parent" : "child");
+// Use onload event to make sure that the messages are first dispatched in
+// frames, and then in the top-level frame. This requires document_start or
+// document_end.
+window.addEventListener('load', function() {
+ chrome.extension.sendRequest(window.parent === window ? 'parent' : 'child');
+});

Powered by Google App Engine
This is Rietveld 408576698