arreglar bug con shadow DOM de <audio>/<video>/<iframe>

This commit is contained in:
void 2020-11-05 19:20:05 -03:00
parent 0382be3351
commit d6141ddee6

View file

@ -352,7 +352,16 @@ function setupEditor (editorEl) {
const range = sel.getRangeAt(0)
for (const [name, type] of Object.entries(typesWithProperties)) {
const result = findRecursiveChild(type.checkFn, range.commonAncestorContainer)
let result
try {
result = findRecursiveChild(type.checkFn, range.commonAncestorContainer)
} catch (err) {
// Permission denied or something...
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied
console.log("Error raro", err)
break
}
if (result) {
type.updateInput(result, editorEl)
result.classList.add("selected")