openzim / youtube

Create a ZIM file from a Youtube channel/username/playlist
GNU General Public License v3.0
43 stars 26 forks source link

Remove inline javascript to comply with some CSP #154

Closed mossroy closed 2 years ago

mossroy commented 2 years ago

Tested with dirtybiology_fr_all_2021-10.zim, dirtybiology_fr_all_2015-11.zim, and litterature-audiobooks-poetry_fr_2020-01.zim

Every page has the following inline script, that could be moved to a javascript file:

<script>$(document).ready(function() { trigger_webp_polyfill(); });</script>

And the drop-down list of the home page does not work because of its onchange attribute, that could be replaced by attaching an event handler on it (in a javascript file):

<select class="chosen-select" name="list" onchange="genplaylist()">...</select>

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

rgaudin commented 2 years ago

Fixed via 5d468e3. Tested OK with Kiwix JS 3.4.0 extension in Chrome; which failed without the fix.

mossroy commented 2 years ago

Thanks! Could you give us a link to a newly-generated ZIM file (when one is available)?

rgaudin commented 2 years ago

A new biologie-tout-compris_fr_all is scheduled but in the mean time, here's the test one I created test_yt5_2022-07.zim (16MB)

rgaudin commented 2 years ago

Here's a real one: https://mirror.download.kiwix.org/zim/videos/hygiene-mentale_fr_all_2022-08.zim

mossroy commented 2 years ago

It seems to work fine, thanks!