Why hook_preprocess_html() isn't working?
Try the general preprocess hook, like:

/**
 * Implements hook_preprocess().
 */
function my_module_preprocess(&amp;$variables, $hook) {
  if ($hook == 'html') {}
}