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

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: Use self 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..99c504b6dca27094aa2af1b3b7bd2a646a766012 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', {
+ get: function() {
+ // TODO(fsamuel): This is a workaround to enable
+ // contentWindow.postMessage until http://crbug.com/152006 is fixed.
+ return objectNode.contentWindow.self;
+ },
+ // 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