Closed
Bug 796917
Opened 12 years ago
Closed 12 years ago
wrong serialization in postMessage between iframe and content script
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: thomas, Assigned: evold)
Details
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1 Build ID: 2012090600 SDK 1.10 Communication between an iframe and the content script of the outer page has a problem with the serialization of messages when using window.postMessage I attached an example addon with the following two ways communication: iframe -> outer page content script send message: { first: "a string", second: ["an", "array"], third: {an: 'object'} } received message: { "first":"a string", "second": {"0":"an","1":"array"}, "third":{"an":"object"} } -> array is transformed into object outer page content script -> iframe (reply to first message with msg.source.postMessage()) send message: { first: "a string", second: ["an", "array"], third: {an: 'object'} } received message: "[object Object]" -> object is not serialized at all When changing: window.addEventListener (outer) parent.postMessage (iframe) to: document.defaultView.addEventListener (outer) parent.document.defaultView.postMessage (iframe) -> same results as above.
Alex, if you get a chance, could you take a look at this?
s/Alex/Erik/
Flags: needinfo?(evold)
Whiteboard: [triage:followup]
Reporter | ||
Comment 3•12 years ago
|
||
Above result also verified with: User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0 Build ID: 2012101000 SDK 1.11rc1
Assignee | ||
Comment 4•12 years ago
|
||
Thanks for the report! I've created a test out of the example, at https://github.com/erikvold/jetpack-sdk/compare/796917 This does appear to be an issue with the sdk.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(evold)
Assignee | ||
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → evold
Assignee | ||
Comment 5•12 years ago
|
||
It looks like this has been an issue at least since 2011-07-20, probably never worked.
Assignee | ||
Comment 6•12 years ago
|
||
Pointer to Github pull-request
Assignee | ||
Comment 7•12 years ago
|
||
Pointer to Github pull-request
Assignee | ||
Updated•12 years ago
|
Attachment #677668 -
Flags: review?(rFobic)
Attachment #666981 -
Attachment is obsolete: true
Comment on attachment 677669 [details] Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/647#attch-to-bugzilla Okay, that wasn't even close to the attachment I clicked on to mark as obsolete, Bugzilla...
Attachment #677669 -
Attachment is obsolete: true
Attachment #666981 -
Attachment is obsolete: false
Comment 9•12 years ago
|
||
Comment on attachment 677668 [details] Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/647 Comment about function was just a suggestion so I'll leave it up to you. Also I think conten-proxy.js has no access to modules so probably it's not worth it.
Attachment #677668 -
Flags: review?(rFobic) → review+
Comment 10•12 years ago
|
||
Commits pushed to master at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/aa2d116b1dc52464263b5c8fc2cb152614aec644 adding test for bug 796917 using postMessage to an iframe from a content script does not serialize data https://github.com/mozilla/addon-sdk/commit/2f4f95b8f0a6c504ce17f07694b63d56aa09a8b8 Merge pull request #647 from erikvold/796917 fix bug 796917 using postMessage to an iframe from a content script does not serialize data r=@gozala
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [triage:followup]
Comment 11•12 years ago
|
||
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk https://github.com/mozilla/addon-sdk/commit/1b7692037f8c3cc98438351aa351bf5d394eaadd adding test for bug 796917 using postMessage to an iframe from a content script does not serialize data (cherry picked from commit aa2d116b1dc52464263b5c8fc2cb152614aec644)
You need to log in
before you can comment on or make changes to this bug.
Description
•