ILST >= 25.3 does not return evalScript values if iframe is present anywhere in HTML
I'm in the process of needing to migrate various products to CEP 11. I've noticed that; even in following the proposed solutions with parent.postMessage and sending evalScript content to the parent of an iframe to eval, await the results, then postMessage back to the child; whenever an iframe is even present, evalScript no longer returns values from JSX even if evalScript is not being used from within the iframe. I notice a lot of strange behavior in this barebones repo which demonstrates the same behavior but doesn't replicate the complexity of my target repos.
In the sample repo:
- I can invoke
evalScriptfrom within an iframe even when allegedly not being allowed to - The iframe
evalScriptdoes invoke and properly show alert dialogs, but will never return a value explicitly (like a string or JSON.stringified object)
In my target repo:
- I am not invoking
evalScriptfrom within an iframe. I'm usingpostMessageto send string contents to the parent, receive the message thenevalScriptat the parent, await the results, and post the results back to the child iframe. Evalscript is not being run within the iframe but shows the exact same behavior as if it is. The script will invoke but no return value is ever given, which is critical for my client's product. - No combination of suggested flags for dealing with the CORS issue (isolation trials, cookies, etc) affects this
- Photoshop and InDesign work as expected with the same code and event messaging system
I'm at a loss here. Is it my CSXS version? My older CSInterface file? My webpack configuration via vue.config.js? If this is an application-side error and not my own, the least that could happen is for a console error to appear rather than silent failure as this appears to be.
hi @Inventsable Thanks for sharing the sample extension, Tring to summarize the problem to understand it more clearly, please reply back in case of misapprehension.
Here you have tried 2 methods -
-
With Index.html: Files built by vue.app is injected into the index.html, and app is not serve at any localhost (in-built auto-injection) - here everything works fine
-
with index-dev.html : Trying to inject your localhost:8080 hosted vue.app files into an IFRAME (makes it a cross-site iframe injection), From vue.app you are not able to execute the evalscript - not working fine
Comparing the 2 cases (index and index-dev scenario) and to mimic the working case, In index-dev case: you can add a post-message from vue.app to main-Iframe(inside index-dev.html) to listen for call and execute evalscript from main-frame and pass the subsequent message to your vue app(cross-site Iframe).
As mention in an earlier comment, you already have tried that but I don't see the postMessage implementation in your Aap.vue or index-dev.html.