Use hook_page_build() instead of hook_init() to add CSS or JS to every page. I think this works for your case as well. You don't need to show the message on ajax pages or cached pages. It might ever result in duplicate results.

Use hook_page_build() instead of hook_init()

Comments

ram4nd’s picture

Status: Active » Needs review
StatusFileSize
new532 bytes

Pass the following option to git commit to attribute authorship to this user:
--author="ram4nd <ram4nd@601534.no-reply.drupal.org>"

ram4nd’s picture

StatusFileSize
new538 bytes

Forgot the variable.

minnur’s picture

Status: Needs review » Closed (won't fix)