You may be right: I hadn't checked this for execution order, but here's a possible solution....
There is also this helper function inside comprofiler.html.php. Maybe it's there just to handle the core output for XHTML compliance (set in the component's configuration), but it might also affect plugins. I don't remember it being mentioned in the API, anyway...
[code:1]
function addCbHeadTag($ui,$text) {
global $mainframe, $ueConfig;
if ($ui==1 && method_exists($mainframe,"addCustomHeadTag"«») && isset($ueConfig) && $ueConfig) {
$mainframe->addCustomHeadTag($text);
} else {
echo $text;
}
}[/code:1]