ShadowRoot.getSelection Polyfill
Provides missing ShadowRoot.getSelection
implementation in Firefox.
The fix was sparked by an attempt to solve an issue with prosemirror in Shadow Dom and was inspired by changes made to support Shadow DOM in quilljs.
Safari hasn't moved on this for 2 years, and the GoogleChromeLabs polyfill doesn't actually address the problem.
The polyfill is likely not to work on Safari, but the patch will still be applied if the method is called.
Installation
npm install shadow-root-get-selection-polyfill
or
yarn add shadow-root-get-selection-polyfill
Usage
import { patch } from 'shadow-root-get-selection-polyfill';
patch();