PDF.JS – Message: file origin does not match viewer’s with WordPress

Recently I received the error while working on a WordPress Site.

Message: file origin does not match viewer's

Solution. Both the website and the PDF have to be served over the same protocol, in my case, SSL.

I upgraded the website to use SSL. The PDF.JS plugin and the file must be served from the https URL. I updated the page with the embedded plugin and served the file over SSL to match the application.

Leave a Reply