[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!

Hi Jaoa,

I tried using your solution but could not get it to work.
could your provide an example of the solution?

Regards,

Teun

Hello Teun,

Attached is the OML with the change.
You need make the change on the "ViewerScreen" page > Script Expression.

And replace this code:

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

with the new one.


Regards

João Réquio

pdfJSViewer.oml

Hello João,

This helped me out alot.
Thanks for your help!

Regards,
Teun

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

Hello Eduardo,

Any update on this issue?
if not, is there a workaround?

Regards,
Teun

Hi everyone,

I talked with Jorge Martins who is part of the team and published a version (0.2.4) that is under development that might have fixed this issue.

The changes that I made was to include the suggestion from @João Réquio - thank you for that.

Please let us know if it works so we can make it stable.


PS: Given that is a version under development you'll have to install it manually by downloading the version in the versions listing and then uploading the OAP in the environment.

Hi Cristiana,
Is there an estimated date of when we will have a new stable version of the component?

Regards.

I was waiting for feedback from the people experiencing this issue. Since I didn't get none, I guess I'll move it to stable.


Out of curiosity: why are you asking for a date on a stable version?

In my cloud it works with the development version.

But my client only allows us to install stable components on their infrastructure.
So I needed a date to know whether to wait or try another solution.

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