Ah! For <link>... of course! For <script>, yeah this does work, and is better than a MutationObserver. I'm tempted to feature request <script media> but that seems like a lot of potential complexity (conditions change over time) to make an ugly simple case (only care once on nav) prettier.