What is Google's jsapi used for in OJS?

For a journal website, we would like to replace all external dependencies with local copies, so that no external URLs resources are loaded. This is for privacy reasons, as loading external resources allows external tracking, at least up to a certain degree.

When checking on a clean fresh install of OJS, I see the following external HTTP calls:

If I am correct, those two can also be downloaded directly from Releases · jquery/jquery · GitHub and Releases · jquery/jquery-ui · GitHub, other than using Google’s CDN service.

For that one, I am not sure: Apparently, that code is not supposed to be downloaded ( Frequently Asked Questions  |  Charts  |  Google Developers ) as it is part of other Google services.
May I ask what jsapi is used for in OJS, and what functions could stop working when cutting off OJS access to Google’s servers?

This doesn’t answer your particular jsapi question, but regarding your general question, have you considered the enable_cdn option in config.inc.php?

Yes @ctgraham, we will use either that or try to configure a custom cdn, as this OJS will be integrated with other services through JavaScript. Thanks!

What I meant to ask is that jquery and jquery-ui are pieces of software that can be downloaded, while the call to jsapi returns an individual response that even contains geolocation data (google.loader.ClientLocation = {"latitude":xx.xx,"longitude":xx.xx,"address":{"city":xx...}} ).

Jsapi seems like a gateway to external services, and I’m only curious what it is used for.

I do not know for certain, but I suspect the jsapi call is simply used to load the jQuery libraries via Google’s CDN. If I turn off enable_cdn in my dev 2.4.7 install, I no longer see the jsapi call on the homepage.

I am not giving you any technical answer but as long as I am understanding your question you want to save these files to your server location and want to fetch them from your server.
If it is the case than take care of these two scenarios.

  1. please go through the licence “License | jQuery Foundation” is it allowing you to reside this file to your server, If yes than is it allowing you to keep the codes as it is or you can edit it. (In other words matter is related to copyright or not).
  2. Second is that I have read some where that fetching these files from their location (remote location) improves the speed of your page load instead of fetching them(ex. .min.js files) from your server. (Though the time difference may differ in micro or milli seconds but still they are countable. You too can check the difference on your browser’s “developer Tools” option )
    Technically it decreases latency, gives increased parallelism and better caching.

Hi, @ctgraham, I only have turn off enable_cdn in config.php.inc, but my system have run for two years, I am not sure this change whether affect it, what do you think of it?

The enable_cdn setting, when “On”, allows common javascript files to be served from their own sites, rather than from OJS. With enable_cdn “Off”, each of these javascript files is served from a local copy in OJS itself. OJS should function with either setting, unless your user’s internet provider is blocking certain CDNs.

Thanks for your reply, I think I get it.