5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 11:31:41 +00:00

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")