Bug 1079748 - Implement hierarchy manager

same comment about the aync + window.addEventListener