Need help with - Failed to execute 'postMessage' on 'DOMWindow'

New Here ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

Using the Angular samples provided in the SDK kit I have been able to create a simple POC for my Mean stack app that runs locally on my localhost. I ended up using the PreviewFileUsingFilePromise method wherein I am providing my file as a blob (and not as the URL unlike the other method requires). This apporach works fine in some instances and not in others. Unfortunately the issue is sporadic and hard to understand. (fails 4 times out of 10).

 

Everytime the issue occurs, there is no pdf loaded in the iframe and my console keeps throwing this error - Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('<URL>') does not match the recipient window's origin ('<URL>'). 

 

Upon digging a little deeper, the error is caused in the following lines of the embedded javascript file (ViewSDKInterface.js):

e.isInstanceStillAlive() && e._iframeElement.contentWindow.postMessage(t, r)

 

A little research and googling has led me to the following:

https://stackoverflow.com/questions/27573017/failed-to-execute-postmessage-on-domwindow-https-www-yo...

 

Having said that, the questions that I have are

1. Could this be the very reason for my issues as well (http vs https)? If so, how can I get around it with localhost? Also, it does not explain why it works sometimes while not at other times. 

2. If not, then what could be causing it?

3. Somewhat unrealted, but I guess valid in my case. Since I am using the PreviewFileUsingFilePromise method and providing the file blob to process for pdf. Does Adobe use this blob or any file related content and store them on the Adobe server's? 

 

Thanks and any help would be much appreciated!

 

TOPICS
View SDK

Views

431

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 24, 2020 Jun 24, 2020

Copy link to clipboard

Copied

Thanks for using View SDK.

Would it be possible for you to share the code snippet so we can debug and try to find out what's causing the issue?

In response to your third question, Adobe DC View SDK doesn't store any user data and file related content on its servers.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

LATEST

Thanks so much for your response. 

 

So the issue was something to do with the way I was displaying different pdf's in my Angular app using the material tabs. I was able to get around it by clearing the old iframe element that still remains in the div when I tab off. Once the old iframe was cleared there was no conflict and the pdf renders fine.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines