return g_strdup_printf (
"window.addEventListener ('DOMContentLoaded',"
"function () {"
- " var styles = document.getElementsByTagName('style');"
- " for (i=0; i<styles.length; i++) {"
- " if (styles[i].getAttribute('title') == 'madblock')"
- " return;"
- " }"
+ " if (document.getElementById('madblock'))"
+ " return;"
" var URL = location.href;"
" var sites = new Array(); %s;"
" var public = '%s';"
" public += ' {display: none !important;}';"
" var mystyle = document.createElement('style');"
" mystyle.setAttribute('type', 'text/css');"
- " mystyle.setAttribute('title', 'madblock');"
+ " mystyle.setAttribute('id', 'madblock');"
" mystyle.appendChild(document.createTextNode(public));"
" var head = document.getElementsByTagName('head')[0];"
" if (head) head.appendChild(mystyle);"
"%s"
"window.addEventListener ('DOMContentLoaded',"
"function () {"
+ " if (document.getElementById('formhistory'))"
+ " return;"
" initSuggestions ();"
" var mystyle = document.createElement('style');"
" mystyle.setAttribute('type', 'text/css');"
+ " mystyle.setAttribute('id', 'formhistory');"
" mystyle.appendChild(document.createTextNode('%s'));"
" var head = document.getElementsByTagName('head')[0];"
" if (head) head.appendChild(mystyle);"