Inter frame SOP - Chrome extension

In the Chrome extension, I'm trying to get gmail to compose the contents of the body.

The error is sporadic and does not prevent it from working.

This is executed as the contents of the script. I believe that permissions are not a problem here, because when there is no permission, the error is different and the operation is blocked from Chrome, definitely not.

An error appears on this line:

encodeURIComponent($canvas.find('iframe').contents().find('body').text());

Where

var $canvas = $('#canvas_frame').contents();

Any information on this error and possible translation? enter image description here

+5
source share
2 answers

You cannot read cross site content using javascript. Google Chorme's XSS Auditor will never allow this.

, http://en.wikipedia.org/wiki/Same_origin_policy

1 -

- window.postMessage() Chrome 2+. , https://developer.mozilla.org/en-US/docs/DOM/window.postMessage

+4

, :

  • , -, script script?
  • , manifest.json? .

, , : apis.google.com. apis.google.com. Chrome: http://developer.chrome.com/extensions/manifest.html#permissions

+2

All Articles