You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +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:
@@ -182,7 +182,20 @@ module.exports = {
|
|||||||
|
|
||||||
var fixups = [];
|
var fixups = [];
|
||||||
for (var i = 0; i < svgs.length; i++) {
|
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;
|
if (!svgDoc) continue;
|
||||||
var tags = svgDoc.getElementsByTagName("*");
|
var tags = svgDoc.getElementsByTagName("*");
|
||||||
for (var j = 0; j < tags.length; j++) {
|
for (var j = 0; j < tags.length; j++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user