What you're hitting here is an unfortunate terminology issue which I see all of the time and which I FULLY understand.
the onPageStartup
script fires one time when you open Perspective Page in a tab. It does NOT fire every time you perform page navigation. Watch the pageId during the life of your session; the pageId does not change as you navigate between pages because what's really going on is we're just swapping out the View on the back-end and applying any rules from the Page Configuration.