[pdfJS Viewer] Chrome 89 version problem
Forge component by Eduardo Jauch
Application Type
Traditional Web

Hello,

We are experiencing an error in last version (89) of Browser. 

Is anyone experiencing the same problem?

 (BTW version 88 or older / firefox or edge are OK).

Does anyone have a solution/ fix to overcome this problem?

Thanks

DefaultURL.JPG

mvp_badge
MVP

Hello Helena. 

I'll take a look as soon as possible to understand the problem. 

Cheers

I am getting the same error, even on Edge.

We may have to look at using a new component to view PDFs

I am getting the same error on these:

  • Chrome version 89.0.4389.82 (Official Build) (64-bit)
  • Edge version 89.0.774.48 (Official build) (64-bit) 

The pdfJS viewer is working fine on the following:

  • Firefox 86.0 (64-bit) 
  • IE 1909

Here is what I see in the console on both Chrome and Edge:

ChromeConsoleScreenshot.png

mvp_badge
MVP

I am checking to see what changed in the browsers that may lead to those errors. 

Hopefully there is a new version and update the code the component uses will be enough to solve this. 

I  will be able to look at it tomorrow. 

Hello,

We had the same problem, this is due to the DEFAULT_URL doesn't exists anymore.

So we did some changes to the plugin

Replacing

  if (!!DEFAULT_URL) x['defaultUrl'] = DEFAULT_URL;
  return x;

with

  var loca = getUrlParameter(window.location.href, 'URL');
  
  if (!!loca) x['defaultUrl'] = loca;
  return x;    
}
function getUrlParameter(location, name) {
    name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
    var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
    var results = regex.exec(location);
    return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};

With this change the Google Chrome, Firefox and IE are working.

mvp_badge
MVP

Hello João,

Thanks.

I will update the code with the most recent version from the Mozilla repository and I think it will solve the issue.

Cheers!

In new chrome update 89 onwards DEFAULT_URL is not readable but it is assigned in preparation.  

@Eduardo Jauch 

I see DEFAULT_URL assign here in this ViewerScreen -> Preparation 

why not directly in code before, this is working in all browsers.

var DEFAULT_URL = '" + EncodeJavaScript(URL) + "';"
if (!!DEFAULT_URL) x['defaultUrl'] = DEFAULT_URL;
  return x;

mvp_badge
MVP

Hello

Yes, I need to update the code, but will not be able to do that until next week.

This component uses an external (massive) JavaScript Library and it is not easy to keep it up to date.

Sorry.
As soon as I am able to update it, I'll let you know here.

Cheers

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.