Problem with Cros origin

Product: PDFTron WebViewer

Product Version: 7.3.3

Please give a brief summary of your issue:
I get an error message “Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions” when I run my app with viewer.

Please describe your issue and provide steps to reproduce it:
I get an error message “Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions” when I run my app with viewer.
I don’t know why this happens, because i’m using electron offline app, and initial document and viewer files are in the same project/folder.
I attach screenshots of Network page from dev tools, with info about my Home file and webviewer.js file so you can check and help me to slove this problem.

I also assume, that this problem cause another problem. I can’u use any of API functions (for example setTheme/disableElements) in my viewer.
If I tried to disable elements in WebViewer “part of code” (before .then), some buttons from header toolset are acctualy disabled. but when I call this method later, it doesn’t work. I think that this is because of the “cross domain” error.

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hi EruoCert
I follow the steps when I downloaded the electron sample and run it. It does not crash.
Can you provide more steps to tell us how to reproduce it.
What kind of sample are you using? And how do you set up your environment?

1 Like

Hi,

I downloaded files from there: https://www.pdftron.com/documentation/web/get-started/manually/

I use manual integation guide.
Electron guide doesn’t work for, so I used this.
What do you mean by “How do you set up your enviroment”?

1 Like

Hello,
Did you add some additional files to your environment? Did you try GitHub - PDFTron/webviewer-electron-sample: Sample to demonstrate integrating WebViewer into an Electron App? It’s just upgraded to WebView8.0. Let me know if this one work for you

1 Like

Hi!

I manage to fix this error.
Thank you for you help.

1 Like

@EuroCert How did you fix the problem? Can you give specifics please? We’re having the same issue.

1 Like