Jump to content

Topic on Project:Village Pump

Add Chart.js as a hidden gadget

9
Sophivorus (talkcontribs)

Hi! I'd like to add the (minified) code of https://www.chartjs.org as a hidden, disabled gadget here at MediaWiki.org, in order to be able to load it and use it for generating charts with other gadgets (first use case would be wikiprojects in the Spanish Wikipedia and then Wikiversity:Wikidebate).

PerfektesChaos (talkcontribs)

I think there is a CDN on the toolforge repositories, avoiding that everybody touching the JS will submit fingerprint and IP address and context to an external website.

Basically there is no need to make an official MediaWiki.org gadget. You can establish a user script and load it wherever you want. Other people can load on their own risk your JS if they trust in you by .js preferences.

Sophivorus (talkcontribs)

Ah yes, I found it, I didn't know about that! Just to clarify, I wasn't asking to load ChartJS from their CDN, but rather copy-pasting the ChartJS code into a new gadget. But anyway, loading from the toolforge CDN seems even better, so I think I'll go with that, thanks!

Jdforrester (WMF) (talkcontribs)

Note that hot-loading from the Toolforge CDN on a production Wikimedia site without user opt-in consent is a privacy policy violation, as the Toolforge privacy policy is different.

Sophivorus (talkcontribs)

Hmm, then how about copy-pasting the ChartJS code to a MediaWiki.org gadget (hidden and disabled by default) so I can load it from there?

This post was hidden by Sophivorus (history)
Tacsipacsi (talkcontribs)

Couldn’t cdnjs.toolforge.org have an own privacy policy, which is as strong as the production wiki one? Since its very goal is to be a privacy-friendly CDN, it would be a straightforward decision, allowing gadgets to use it. Or does the Toolforge infrastructure itself (i.e. bits that are out of the cdnjs tool’s control) do things that aren’t allowed on production wikis?

Sophivorus (talkcontribs)

I just found out about the plans to enable Extension:Chart which would use Apache eCharts. Thus, I modified my code to use the eCharts library rather than ChartJS. When the extension is enabled, I'll be able to use the eCharts resource bundled with it. But in the meantime, I'd still like to copy-paste the eCharts minified code to a hidden, disabled gadget here at MediaWiki.org. Any concerns or objections?

Regarding Tacsipacsi's suggestion, allowing to use resources from the Toolforge CDN would be a huge lvl up for gadget developers!

PerfektesChaos (talkcontribs)

On gadget: You could provide such external library (if license would permit, which would be required for official MediaWiki.org gadget as well) as your own user page.

On privacy issues: The CDN at our toolforge is avoiding that any external sysop could track IP address and browser fingerprint on every usage (accessing, verifying and loading the code).

  • Inside such libraries there might be callbacks to the external origin. In the huge amount of CDN libraries nobody at WMF can check this for all frequent updates.
  • If someone is using deliberately a toolforge tool it is taken into account that cookies for external might be created, and externals are contacted.
  • However, toolforge developers should make it obvious if they know that non-WMF communication might happen, and no tool should be offered by the way on any WMF site if external access is known.
Reply to "Add Chart.js as a hidden gadget"