I am using this library to detect mouse cursor position based on the current caret position in my Chrome extension that I am using to correct grammar and translate entered text, to display a progress animation next to the caret.
I noticed it's not working on YouTube comment input area.
It fails on this line 78:
div.textContent = element.value.substring(0, position);
throwing an error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substring')
When inspected, the debugger shows that element.value is undefined.
I am using this library to detect mouse cursor position based on the current caret position in my Chrome extension that I am using to correct grammar and translate entered text, to display a progress animation next to the caret.
I noticed it's not working on YouTube comment input area.
It fails on this line 78:
div.textContent = element.value.substring(0, position);throwing an error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'substring')
When inspected, the debugger shows that element.value is undefined.