From: Alexander Butenko Date: Thu, 17 Dec 2009 19:56:46 +0000 (+0100) Subject: Do not add the form history style more than once X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82697f0afb71741e4e4c5f860b5b409a66062a17;p=midori Do not add the form history style more than once --- diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 8e1a2cc4..b4ec3787 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -58,15 +58,20 @@ formhistory_prepare_js () jsforms = g_strdup_printf ( "%s" - "window.addEventListener (\"load\", function () { initSuggestions (); }, true);" + "window.addEventListener ('load', function () { initSuggestions (); }, true);" "window.addEventListener ('DOMContentLoaded'," "function () {" - "var mystyle = document.createElement(\"style\");" - "mystyle.setAttribute(\"type\", \"text/css\");" - "mystyle.appendChild(document.createTextNode(\"%s\"));" - "var head = document.getElementsByTagName(\"head\")[0];" - "if (head) head.appendChild(mystyle);" - "else document.documentElement.insertBefore(mystyle, document.documentElement.firstChild);" + " var styles = document.getElementsByTagName('style');" + " for (i=0; i