lingua-libre / SignIt

🌻 Lingua Libre SignIt web-browser extension translates selected word in French Sign Language via an elegant pop up so you learn sign language while reading online.
https://addons.mozilla.org/en-US/firefox/addon/lingua-libre-signit/
MIT License
15 stars 15 forks source link

Test blob video in SignItVideosGallery.js #102

Closed hugolpz closed 4 months ago

hugolpz commented 4 months ago

But maybe SignItVideosGallery.js is not yet content script ?

Code

<!DOCTYPE html>
<html>

<body>

<video id='signit-video' width="320" height="240" controls>
  Your browser does not support the video tag.
</video>

</body>
</html>

<script type="text/javascript">
  fetch('https://upload.wikimedia.org/wikipedia/commons/8/8e/LL-Q33302_%28fsl%29-Yug-merci.webm')
  .then(res => res.blob()) // Gets the response and returns it as a blob
  .then(blob => {
    console.log(blob)
    document.querySelector('#signit-video').src = URL.createObjectURL(blob);
});
</script>

Sites

image image

kabir-afk commented 4 months ago

While the above approach is solid and works on most of the sites that have strict CSP, it fails to work on github. When embed inside iframe , videos work on all the sites , including github hence we'll proceed with this approach for time being.

hugolpz commented 4 months ago

Error log :

VM526:1 Refused to connect to 'https://upload.wikimedia.org/wikipedia/commons/8/8e/LL-Q33302_%28fsl%29-Yug-merci.webm' because it violates the following Content Security Policy directive: "connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com api.githubcopilot.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com/v1/engines/github-completion/completions proxy.enterprise.githubcopilot.com/v1/engines/github-completion/completions .actions.githubusercontent.com wss://.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com github.githubassets.com edge.fullstory.com rs.fullstory.com". (anonymous) @ VM526:1 VM526:1 Refused to connect to 'https://upload.wikimedia.org/wikipedia/commons/8/8e/LL-Q33302_%28fsl%29-Yug-merci.webm' because it violates the document's Content Security Policy. (anonymous) @ VM526:1