Among other things including DOM scripting, yes... but there was never any historical intent to consider HTML pages which used javascript at all as being something fundamentally separate to pages which didn't, or something other than documents.
But the distinction wouldn't have even made sense at the time, and for most of the web, it still doesn't make sense. It may only make sense in the future, when WASM matures more, though.
All of the privacy violations and dark patterns that javascript gets employed for are the result of choices made by developers and corporations... they're not fundamental and innate features of javascript or of having scripting in the web to begin with, so they're not problems that would be solved by quarantining the language to some kind of "app" space.
It's not like all of the problems on the web are caused by technology. Adding a <script> tag to your HTML doesn't automatically make your page weigh 10MB and snoop on its users. All those problems are caused by business decisions. When you decide to add an analytics script, or put an ad on the page, or hire a designer to make it look appealing to customers - that's where things go wrong.
In other words: even if we had a page/app split on the web from the beginning, businesses would still fuck it all up, and we'd have the same problems with bloat, ads, dark patterns and surveillance capitalism as we have today.