oracle-samples / xfc

A javascript library for Cross Frame Communication
Apache License 2.0
17 stars 24 forks source link

Unable to access frame in orion-mpage-component #13

Closed prateekgta closed 6 years ago

prateekgta commented 6 years ago

Please fill out the below template as best you can.

I have to send bedrock configuration to content provider, so I am  adding this.trigger(‘message’, xxx) at authorized in orion-mpage-component-body.js. I can see in console that ‘this’ is the frame, but when I used it, its scope change to component and throws error.

Description of Issue

Unable to access frame inside xfcInit.

System Configuration

Project Version

Additional Details (optional)

Steps to Reproduce the Issue

  1. Step 1

Add this lines in "xfc.authorized"

var component = this.getProp("component"); this.trigger('message', component.getFilterMappingsObj());

  1. Step 2

Expected Outcomes

mhemesath commented 6 years ago

Can you create a reduced example of what you're trying to accomplish? The description of trying to access the iframe and expected outcomes of consistent styling don't align or make sense.

prateekgta commented 6 years ago

https://github.com/prateekgta/xfc/blob/master/example/cross_origin_communication/3_a_index.html, I am trying to send the Json through frame.

mhemesath commented 6 years ago

Because you are using an arrow function this will refer to the window object and not XFC. https://github.com/prateekgta/xfc/blob/master/example/cross_origin_communication/3_a_index.html#L94

prateekgta commented 6 years ago

Is there any way we can achieve what I am trying to do here, I have to send the message to content provider from here.