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.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.45k stars 1.75k forks source link

RecordRTC overwrites the browser Storage interface #854

Open graemechapman opened 9 months ago

graemechapman commented 9 months ago

This library overwrites the browser's existing Storage interface (https://developer.mozilla.org/en-US/docs/Web/API/Storage) with an object which does not conform to this spec - see https://github.com/muaz-khan/RecordRTC/blob/7b1c360f27c7ae34047137bb2356e39b6f93374f/dev/Storage.js#L14

This can cause unexpected errors in other code present on the page which is working with local/session storage, e.g.

window.localStorage instanceof Storage

This should probably be renamed to something which does not conflict with browser built ins, and also scoped within a function to avoid polluting the global context.