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

Remove inline javascript to comply with some CSP #128

Closed
mossroy opened this issue Jan 5, 2022 · 3 comments
Closed

Remove inline javascript to comply with some CSP #128

mossroy opened this issue Jan 5, 2022 · 3 comments
Assignees
Milestone

Comments

@mossroy
Copy link

mossroy commented Jan 5, 2022

All pages seems to have some webp related inline javascript :

<script>
    $(document).ready(function() {
      webpHero.detectWebpSupport().then(function (support_webp){
          if (!support_webp) {
              console.log("no WebP support, polyfilling.");
              let webpMachine = new webpHero.WebpMachine();
              webpMachine.polyfillDocument();
          }
      });
  });
  </script>

or

<script>
                $(document).ready(function() {
                    webpHero.detectWebpSupport().then(function (support_webp){
                        if (!support_webp) {
                            console.log("no WebP support, polyfilling.");
                            // un-hide ogvjs-poster so the polyfill can transform it
                            $(".ogvjs-poster").css("visibility", "");
                            // hide video-js poster (which uses background-image)
                            $(".vjs-poster").css("display", "none");

                            let webpMachine = new webpHero.WebpMachine();
                            webpMachine.polyfillDocument();
                        }
                    });
                });
            </script>
@mossroy
Copy link
Author

mossroy commented Aug 3, 2022

Could you give us a link to a ZIM file we could test with?

@rgaudin
Copy link
Member

rgaudin commented Aug 5, 2022

Here's a single playlist ZIM I created. test_t1_2022-08.zim Full TED ZIMs needs another issue to be fixed to pass (data format has changed upstream).

@mossroy
Copy link
Author

mossroy commented Aug 5, 2022

Your test file looks OK regarding inline javascript. Thanks!

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