Need to change jsapi code OJS to https:

Need to change all pages that have the line http://www.google.com/jsapi to https://www.google.com/jsapi as we use a SSL cert. I manage to find some pages with this code in but still the pages aren’t using the https: google site. Anyone know what pages I need to edit so that it always goes to https://www.google.com/jsapi as I ain’t looking through every file.

Hi @norman152,

What version of OJS are you using? (Please include this in your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,

We are currently using Open Journal Systems 2.3.4.0.

Thanks.

Paul.

Hi @norman152,

OJS 2.3.4 is extremely old and I’d suggest upgrading – but you can search the codebase with a tool like grep (available by default on *NIX/MacOS systems, also available for pretty much anything else):

$ fgrep -l jsapi `find . -type f`
./lib/pkp/templates/common/header.tpl
./lib/pkp/templates/help/header.tpl
./templates/submission/comment/header.tpl
./templates/rt/header.tpl
./templates/article/header.tpl

Regards,
Alec Smecher
Public Knowledge Project Team

Cheers, have already cahgned all the above bu still saying http even after restart. Will investigate further.

Hola @asmecher, migramos todo el sitio a https:// y solo nos queda un error:
A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See Intervention: Blocking the load of cross-origin, parser-blocking scripts inserted via document.write for users on 2G - Chrome Platform Status for more details. jsapi:23
jsapi:23 A parser-blocking, cross site (i.e. different eTLD+1) script, https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message.

Tenes alguna idea de como resolverlo :slight_smile:

Saludos cordiales

Hi @Oscarrgomez,

What version of OJS are you using? (Please include this in your posts.)

Regards,
Alec Smecher
Public Knowledge Project Team

Estimado @asmecher, utilizamos el sólido y eficiente 2.4.3.8
que gracias a tus ayudas y demás miembros del equipo, tenemos funcionando al 100%, bueno con el inconveniente de google que bloquea sus propias aplicaciones al 99,9999990%
:wink:

Saludos cordiales,
Oscar

Hi @Oscarrgomez,

Are you sure that’s the right version? There was OJS 2.4.3, and OJS 2.4.8-3, but no OJS 2.4.3-8.

Regards,
Alec Smecher
Public Knowledge Project Team

perdón, es 2.4.8.3 :slight_smile:

Hi @Oscarrgomez,

You can search the codebase e.g. by using find:

find . -type f -exec fgrep -l jsapi "{}" ";"

This gives the following files that will need to be changed:

./lib/pkp/templates/common/header.tpl
./lib/pkp/templates/help/header.tpl
./templates/submission/comment/header.tpl
./templates/rt/header.tpl
./templates/article/header.tpl

I’d suggest using protocol-relative URLs. You can find the relevant commits here: [OJS] Javascripts blocked when OJS is served through HTTPS · Issue #449 · pkp/pkp-lib · GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Hola @asmecher, gracias por la rápida respuesta. Todo el sitio esta usando {$baseUrl} de modo que todas las llamadas se realizan desde https:, como te escribí, el sitio esta 100% optimizado para https.

Si observa en bloqueo es a https://ajax.googleapis.com/ajax/libs/ jquery / 1.4.4 / jquery.min.js , y no sé como resolverlo.

¿Qué pasaría si quito esos scripts de los archivos que me indicas? ¿sabes qué dejaría de funcionar?
Consulté a Google y no responden.

Es interesante que solo los bloquea Chrome. Firefox no lo hace. Con lo cual es un problema que debería solucionar Google pero no tengo forma de hacerles llegar el reclamo.

Pensamos sugerir a nuestros usuarios que utilicen Firefox.
Recuerdo que Alison Studans de Publons nos aconsejó no utilizar Chrome para ingresar a su sitio.
¿qué opinas al respecto?

Apreciando tu apoyo,
Oscar

Hi @Oscarrgomez,

The best solution would be to upgrade to a newer release of OJS (both the latest 2.x and 3.x releases have this issue already resolved). But if you’re not able, you can apply the patch at the URL linked above (pkp/pkp-lib#449 Fix loading scripts from https · Pull Request #464 · pkp/ojs · GitHub, more directly) to resolve it.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Gracias @asmecher Hechos todos esos pasos.
De todos modos sigue bloqueandose la carga aun con https.
¿Sabes que podemos perder si deshabilito el complemeto JQuery?