• Plugin Author Thomas McMahon

    (@twistermc)


    If you just updated to PDFjs 2.2, and it’s no longer working, there’s a good chance your host needs to add support for JavaScript modules (mjs) files.

    To do this, you can try one of the following.

    • Add AddType application/javascript .mjs to your .htaccess file if you’re on an Apache server.
    • If you’re on a nginx server, open your mime-types.conf.hbs file and update application/x-javascript js; to application/x-javascript js mjs;
    • Contact your hosting support and ask them to add a mime type support for mjs files.

    I’m sorry for the headaches this change is causing. Unfortunately, this plugin is just a wrapper for Mozilla’s PDFjs, and they started using mjs files, which means we have to too.

Viewing 15 replies - 31 through 45 (of 97 total)
  • Plugin Author Thomas McMahon

    (@twistermc)

    @ponzio-pilato There’s no fix on my end, it’s the way it has to work at this time. I contacted Mozilla about another solution but haven’t heard anything from them. It may change in the future, but right now, it’s out of my hands.

    Adding the following lines not to the .htaccess but to the hosting config file did the trick :


    <system.webServer>
    <staticContent>
    <mimeMap fileExtension=".mjs" mimeType="text/javascript" />
    </staticContent>
    </system.webServer>

    Regards

    Hey guys, thanks for posting the solution. It was fixed after I updated the .htaccess file from my end on my desktop browser, but NOT on my mobile. Tried to clear the cache with not luck.

    Anyone facing this issue or it’s only me?

    All good, please ignore, I had to clear browsing data to get this fixed. Caching problem client side.

    Thanks,

    Hello, your solution worked for us with Firefox browser but still have the problem with Chrome on a Samsung Pad (working on a PC-Win11 and Chrome)

    Have somebody any idea ?

    Plugin Author Thomas McMahon

    (@twistermc)

    Clear any WordPress cache and browser caches.

    Caches cleared (WordPress & Chrome) but no improvement : black area for PDF !

    Thank you for your efforts to repair the plugin. However, I cannot explain to all visitors the reason why they do not see PDF documents, they should not care.

    Contacting hosting technical support to solve a problem only for a single plugin, and then asking visitors to perform any manipulations with their browsers is not the best way out of the situation, I will simply lose users.

    Thank you

    Plugin Author Thomas McMahon

    (@twistermc)

    @gmspb I understand your concerns. Users shouldn’t have to do anything, but I understand that this update is not ideal. You can always use an older version of the plugin.

    Where can I get the previous version of the plugin please.

    UPDATE: Please ignore the above, I was able to extract the previous version from a backup.

    Actually my cPanel based site is already running nodejs16 (which appears to be an old version), could that be the issue?

    • This reply was modified 5 months, 2 weeks ago by infobizz.
    • This reply was modified 5 months, 2 weeks ago by infobizz.

    @adenby, could you please advise specifically what you did to resolve the issue in cPanel? Thanks.

    Plugin Author Thomas McMahon

    (@twistermc)

    nodejs is not an issue. If you want to install an old version of a plugin, follow this guide.

    https://managewp.com/blog/downgrading-wordpress-plugins

    I had to roll back to version 2.1.8.1 – is this an issue with your plugin specifically, or everything displaying PDFs on an Apache server? I have no idea how adding random lines to my .htaccess file will affect security, y’know?

    Plugin Author Thomas McMahon

    (@twistermc)

    This issue is a feature that Mozilla added to their PDFjs viewer. Since every browser supports mjs files, they didn’t see an issue. They assumed that people using it was putting on their own servers, so could make the htaccess or config file updates. Since we put it in a WordPress plugin, it gets rolled out to lots of people, all who need to update their servers to support mjs files. It shouldn’t effect security any more than allowing basic javascript to run on your site.

Viewing 15 replies - 31 through 45 (of 97 total)
  • You must be logged in to reply to this topic.