Reviewers: ihab.awad,
Description:
Was causing the playground to fail on Firefox.
Please review this at https://codereview.appspot.com/9063043/
Affected files:
M src/com/google/caja/plugin/ses-frame-group.js
M tests/com/google/caja/plugin/browser-test-case.html
Index: tests/com/google/caja/plugin/browser-test-case.html
===================================================================
--- tests/com/google/caja/plugin/browser-test-case.html (revision 5386)
+++ tests/com/google/caja/plugin/browser-test-case.html (working copy)
@@ -63,6 +63,11 @@
--></div>
<div id="automatedTestingReadyIndicator" style="display: none;"></div>
+ <!-- cause code which fails due to cross-origin frame access policies
+ to fail in testing. URL doesn't matter but it must be
other-origin -->
+ <iframe src="http://caja-cross-frame-test.invalid"
+ style="display: none;"></iframe>
+
<!-- in es53 mode, testImageElement() is reliably fired
before the browser has loaded the image, because js runs
continuously without yielding: html-emitter sets the img
Index: src/com/google/caja/plugin/ses-frame-group.js
===================================================================
--- src/com/google/caja/plugin/ses-frame-group.js (revision 5386)
+++ src/com/google/caja/plugin/ses-frame-group.js (working copy)
@@ -146,7 +146,14 @@
if (!directCtor) { return void 0; }
if (directCtor === feralWin.Object) { return BASE_OBJECT_CONSTRUCTOR; }
Array.prototype.slice.call(feralWin.frames).forEach(function(w) {
- if (directCtor === w.Object) {
+ var O;
+ try {
+ O = w.Object;
+ } catch (e) {
+ // met a different-origin frame, probably
+ return;
+ }
+ if (directCtor === O) {
directCtor = BASE_OBJECT_CONSTRUCTOR;
}
});
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.