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

Unified Diff: chrome/renderer/resources/extensions/web_view.js

Issue 11515016: <webview>: Workaround to enable webview.contentWindow.postMessage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index c923edce7fadd8668c2767fa426bfe419f1cf289..b25208479c677c56d5e0cf1865f656b25ae6204c 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -11,8 +11,6 @@ var watchForTag = require("tagWatcher").watchForTag;
var WEB_VIEW_ATTRIBUTES = ['src', 'partition'];
-var WEB_VIEW_READONLY_ATTRIBUTES = ['contentWindow'];
-
// All exposed api methods for <webview>, these are forwarded to the browser
// plugin.
var WEB_VIEW_API_METHODS = [
@@ -100,16 +98,15 @@ function WebView(node) {
// We cannot use {writable: true} property descriptor because we want dynamic
// getter value.
- WEB_VIEW_READONLY_ATTRIBUTES.forEach(function(attributeName) {
- Object.defineProperty(this.node_, attributeName, {
- get: function() {
- // Read these attributes from the plugin <object>.
- return objectNode[attributeName];
- },
- // No setter.
- enumerable: true
- })
- }, this);
+ Object.defineProperty(this.node_, 'contentWindow', {
lazyboy 2012/12/11 16:20:15 Hopefully this doesn't break other properties with
Charlie Reis 2012/12/11 21:30:12 I'm a bit nervous about this, but maybe it's the r
Fady Samuel 2012/12/11 21:46:01 My understanding of the WebKit bug is we're creati
+ get: function() {
+ // TODO(fsamuel): This is a workaround to enable
+ // contentWindow.postMessage until http://crbug.com/152006 is fixed.
+ return objectNode.contentWindow.frames;
sadrul 2012/12/11 01:48:56 Hm. I don't know enough about contentWindow to kno
+ },
+ // No setter.
+ enumerable: true
+ });
for (var eventName in WEB_VIEW_EVENTS) {
this.setupEvent_(eventName, WEB_VIEW_EVENTS[eventName]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698