Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser-blocking, cross-origin script warning on Google Chrome #85

Open
photomedia opened this issue Jan 10, 2017 · 1 comment
Open

parser-blocking, cross-origin script warning on Google Chrome #85

photomedia opened this issue Jan 10, 2017 · 1 comment

Comments

@photomedia
Copy link

Sometimes, abstract pages get stuck on load and/or we get the following errors on Chrome:

jsapi:22 A Parser-blocking, cross-origin script, https://www.google.com/uds/?file=visualization&v=1&packages=corechart%2Cgeochart, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details.
google.loader.f @ jsapi:22
jsapi:22 A Parser-blocking, cross-origin script, https://www.google.com/uds/api/visualization/1.0/f5ce4cf7ba7513f66e3f45efe3b22ee9/format+en,default+en,ui+en,geochart+en,corechart+en.I.js, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details.
google.loader.f @ jsapi:22

It is related to this line:

<script TYPE="text/javascript"> google.load("visualization", "1", {packages:["corechart", "geochart"]}); </script>

Which is added dynamically here z_irstats2.pl:

Trigger to load the Google Charts library from the template(s)

$c->add_trigger( $EPrints::Plugin::Stats::EP_TRIGGER_DYNAMIC_TEMPLATE, sub
$head->appendChild( $repo->make_javascript( 'google.load("visualization", "1", {packages:["corechart", "geochart"]});' ) );

Is that a necessary line? Why is Chrome blocking it?

@graingert
Copy link

eprints should avoid inline JavaScript or document.write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants