Merge pull request #452 from humphd/ie-access-denied-exception

Deal with IE throwing 'Access Denied' error (-2147024891) when accessing stylesheet properties
This commit is contained in:
David Humphrey 2015-09-01 16:09:50 -04:00
Родитель 456967cceb 6e8575e959
Коммит 76e3e4d903
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -68,10 +68,11 @@
// Deal with Firefox's SecurityError when accessing sheets
// from other domains. Chrome will safely return `undefined`.
// IE gives an "Access Denied" error (-2147024891), which we also need to catch.
try {
cssRules = sheet.cssRules;
} catch (e) {
if (e.name !== "SecurityError") {
if (!(e.name === "SecurityError" || e.number === -2147024891)) {
throw e;
}
}