How to programmatically change a Views page's html  separately to its on-page title? Similar to Views: how to programmatically change Views title?, I want to update the title of a Views page using logic/data only possible in PHP. 

However, I want this to update only the appropriate 
 part of the &lt;title&gt; of the HTML &lt;head&gt; without  mirroring the change in the displayed title in the &lt;body&gt;'s &lt;h1 class="page-header"&gt;.

To illustrate, imagine a view with some exposed filters that are used for navigating a product catalogue. Currently, every filtering of this page has the same titles:

&lt;title&gt;Products | My site name&lt;/title&gt;
...
&lt;h1 class="page-header"&gt;Products&lt;/h1&gt;


I've written some code requiring access to $view-&gt;exposed_input that generates an appropriate string based on exposed filter choices (for example, "red, low cost, good condition"), similar to Using exposed filters as part of the rendered page's title. I want these in the html head title, so each navigable URL has a unique title with appropriate keywords for the content. I don't want them in the &lt;h1&gt;, however, because they're already clearly visible in the exposed filter page UI and I don't want to duplicate the information. I want it to look like this:

&lt;title&gt;Products: red, low cost, good condition | My site name&lt;/title&gt;
...
&lt;h1 class="page-header"&gt;Products&lt;/h1&gt;


Things I've tried:


Everything on that linked question applies to both the head and body titles


&lt;title&gt;Products: red, low cost, good condition | My site name&lt;/title&gt;
... 
&lt;h1 class="page-header"&gt;Products: red, low cost, good condition&lt;/h1&gt;


drupal_set_title() doesn't work at all from any of the Views hooks I've tried, presumably because the view overrides this further down the line. I've tried:


hook_preprocess_views_view
hook_views_pre_render
hook_views_post_render

Setting $vars['head_title'] in hook_preprocess_views_view also doesn't work, presumably for the same reason: Views overrides this.


Someone commenting on the hook_views_post_render API page with the exact same problem as me 3 years ago reports that it still doesn't work if you pass the variable to through to hook_preprocess_html and apply it to $vars['head_title'] from there
I think what you're looking for is hook_preprocess_HOOK where HOOK is either html, page or both.