aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorjez2010-12-28 18:17:26 +0800
committerjez2010-12-28 18:17:26 +0800
commitbb9387946cb573123a33541eb01b90fd8f9a744d (patch)
treee601740067905919062654d174ca674148eba81d /vimiumFrontend.js
parentd1885a7078589e875ae0c6801ec935309566dd10 (diff)
downloadvimium-bb9387946cb573123a33541eb01b90fd8f9a744d.tar.bz2
Create HEAD element if it is not present.
Allows us to inject CSS when viewing some non-HTML documents, e.g. images. Does not work on SVG documents though.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index e72764fe..e3c28371 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -799,8 +799,8 @@ Tween = {
function addCssToPage(css) {
var head = document.getElementsByTagName("head")[0];
if (!head) {
- console.log("Warning: unable to add CSS to the page.");
- return;
+ head = document.createElement("head");
+ document.documentElement.appendChild(head);
}
var style = document.createElement("style");
style.type = "text/css";