commit
8d2541fb69
14
apply.js
14
apply.js
|
@ -134,8 +134,18 @@ function applyStyles(styleHash) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(g_styleElements).length) {
|
if (Object.keys(g_styleElements).length) {
|
||||||
document.addEventListener("DOMContentLoaded", addDocumentStylesToAllIFrames);
|
// when site response is application/xml Chrome displays our style elements
|
||||||
iframeObserver.start();
|
// under document.documentElement as plain text so we need to move them into HEAD
|
||||||
|
// (which already is autogenerated at this moment for the xml response)
|
||||||
|
if (document.head && document.head.firstChild && document.head.firstChild.id == "xml-viewer-style") {
|
||||||
|
for (var id in g_styleElements) {
|
||||||
|
document.head.appendChild(document.getElementById(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
addDocumentStylesToAllIFrames();
|
||||||
|
iframeObserver.start();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retiredStyleIds.length) {
|
if (retiredStyleIds.length) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user