mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
try to trap SecurityError exceptions for linux FFs who don't like you calling .contentDocument on an SVG (assuming that's where the error comes from)
This commit is contained in:
parent
add8ef3c59
commit
001b9ad7cc
1 changed files with 14 additions and 1 deletions
|
@ -182,7 +182,20 @@ module.exports = {
|
|||
|
||||
var fixups = [];
|
||||
for (var i = 0; i < svgs.length; i++) {
|
||||
var svgDoc = svgs[i].contentDocument;
|
||||
var svgDoc;
|
||||
try {
|
||||
svgDoc = svgs[i].contentDocument;
|
||||
}
|
||||
catch(e) {
|
||||
var msg = 'Failed to get svg.contentDocument of ' + svgs[i].toString();
|
||||
if (e.message) {
|
||||
msg += e.message;
|
||||
}
|
||||
if (e.stack) {
|
||||
msg += ' | stack: ' + e.stack;
|
||||
}
|
||||
console.error(e);
|
||||
}
|
||||
if (!svgDoc) continue;
|
||||
var tags = svgDoc.getElementsByTagName("*");
|
||||
for (var j = 0; j < tags.length; j++) {
|
||||
|
|
Loading…
Reference in a new issue