Apply styles to application/xml autogenerated pages
This commit is contained in:
parent
31a378b243
commit
3cf32048ed
8
apply.js
8
apply.js
|
@ -134,6 +134,14 @@ function applyStyles(styleHash) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(g_styleElements).length) {
|
if (Object.keys(g_styleElements).length) {
|
||||||
|
// when site response is application/xml Chrome displays our style elements
|
||||||
|
// 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", addDocumentStylesToAllIFrames);
|
document.addEventListener("DOMContentLoaded", addDocumentStylesToAllIFrames);
|
||||||
iframeObserver.start();
|
iframeObserver.start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user