muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.

Home Page:https://www.webrtc-experiment.com/RecordRTC/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not Ideal for Chrome Extension v3 - Causing issues in Chrome Extension Manifest v3

Adnan-Saleem-93 opened this issue · comments

I'm building a chrome extension in Manifest v3. I submitted my extension on the Chrome Web Store for publishing and it got rejected because it states that my extension is using remotely-hosted code (scripts, CDNs and anything that is not present in the extension build). Google updated their privacy policy that doesn't allow remotely-hosted code to be published on the Chrome Web Store.

I checked and found out that RecordRTC is using a <script> tag to remotely access some GifRecorder code from a remote url

Can you download it and bundle it in your build?

Can you download it and bundle it in your build?

I've tried that. That most definitely works, as I can only use the code I need for my use case and ignore the rest, and the extension might get accepted on the web store (not sure yet). However, it still doesn't solve the issue mentioned in #860 (comment)

Hey @Adnan-Saleem-93, I also use RecordRTC for the Chrome extension, but I don't have the <script> tag with the GIF recorder. Maybe I used a minified source without these dependencies. I only used:

import { RecordRTCPromisesHandler } from 'recordrtc';

Also, if I build the source in the dev mode, it present:

script.src = 'https://www.webrtc-experiment.com/gif-recorder.js';

Hey @Adnan-Saleem-93, I also use RecordRTC for the Chrome extension, but I don't have the <script> tag with the GIF recorder. Maybe I used a minified source without these dependencies. I only used:

import { RecordRTCPromisesHandler } from 'recordrtc';

Also, if I build the source in the dev mode, it present:

script.src = 'https://www.webrtc-experiment.com/gif-recorder.js';

Are you using manifest v3?

Yes, I'm using Manifest v3.
I'm using:
import {RecordRTC} from "recordrtc"

I haven't tried using other classes from it. Maybe that'll remove the gif-recorder script.

@Adnan-Saleem-93 we got reject when we submitted an update using manifest v3.
Screenshot 2023-12-13 at 15 51 04

the way I fixed was to:

  1. Forked RecordRTC
  2. Changed in package.json to use our fork
  3. Removed GifRecorder from our fork (we don't use it for anything, we only use audio)

After changing the code remember to run grunt as well as webpack to move the files to dist.
the contributing file needs to be updated it doesn't mention webpack just grunt

@Adnan-Saleem-93 if you need the gifRecorder you can just download the file from the webrtc-experiment.com and add that inside the code itself and change the src in the script to use it instead of pointing to the external url

@Adnan-Saleem-93 @augustnmonteiro. I decided to use MediaRecorderAPI directly. To prevent reject and it works: )

@muaz-khan When do you plan to publish v5.6.3 with this fix to NPM? The latest version I see there is still 5.6.2 (https://www.npmjs.com/package/recordrtc?activeTab=versions).