ffmpegwasm / ffmpegwasm/ffmpeg.wasm

Help needed solving -> DOMException: Failed to construct 'Worker': Script at 'https://reddit.com/814.ffmpeg.js' cannot be accessed from origin 'https://reddit.com.'

Open
#750 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C
Stars
17.8k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Wondering if someone might be able to kindly lend some advice re. an exception I can't seem to solve:

I have written a google chrome extension using local ffmpegwasm files (no need to run a server or download any ffmpegwasm files), which allows users to click an injected 'download' button under Reddit videos (via content_scripts). This was working great on ffmpegwasm v11, but since migrating to v12 (latest version) I have been unable to solve the following exception which is triggered during ffmpeg.load(): as seen in chrome's console log:

`DOMException: Failed to construct 'Worker': Script at 'https://www.redditstatic.com/814.ffmpeg.js' cannot be accessed from origin 'https://reddit.com'. At i.load (chrome-extension://ljejfmmefhnpbpdhkhbbajpihfhnbdnm/lib/ffmpeg/umd/ffmpeg.js:1:2918)`

I'm a programming beginner and I've been stuck trying to fix this for many, many hours. This exception does not happen and the video downloads if I instead use a feature of my extension which allows entering a Reddit video URL directly into a field in the extensions popup or options window. Also, I have no idea why the `814.ffmpeg.js` file is being referenced along with `redditstatic.com` (from exception to exception, this url seems to randomly change to other reddit url's too), though I imagine this is part of the problem?

I have seen there are a couple of mentions of this error on this github repository, with some fixes involving using the `worker814URL` and/or `classWorkerURL` params within `ffmpeg.load()` and pointing them to the `814.ffmpeg.js` file, which I have tried without any success (although I did notice that using `classWorkerURL` changed `https://www.redditstatic.com/814.ffmpeg.js` to `chrome-extension://ljejfmmefhnpbpdhkhbbajpihfhnbdnm/lib/ffmpeg/umd/814.ffmpeg.js`). Though, It seems that previous discussions around this error might not be too helpful for me as those appear geared towards ffmpegwasm running with a server, as apposed to entirely locally within a chrome extension.

Any help would be super appreciated - many thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.