Hello John,
Please, take a look at the "app.setVar()" method help, which can establish "global reactive variables" and also told you about this "reactive" variables and the ability to use just "global variables" using the "window" one as the parent for it.
There is no variables "only for views", however, it's possible to establish it if we wanted and in two possible ways. Supose we are talking about the "Show" event of an app view, then, we can define a variable like the below one:
Declaring a variable like the above, means that that variable is available only for the app view Show event, and, not out of that event. But, taking the example of the "non reactive global variables" (as you can see in the above link), we can think in the declaration of variables like below:
Doing that, what you get is a variable placed in a specific container, to say like that, so, you can know that that variable refers to some specific app "myView" variables. So there is not something "out of the box", but, we have the freedom to establish variables in "containers" like the above, who can provide some context for that variables.
About the variables defined in the app and the variables defined in the context of a a Web Extension, we must remember that that contexts are completely separated, so, we can't define app variables to be accessed from the context of the Web Extension and viceversa. This applies also to the local storage: if I am not wrong, the local storage that we can use in the Web Extension context are not the same than the app local storage.
Fortunately we can pass messages from the Web Extension context and the app context and viceversa, so, it's possible to send a message to the app which inform to the app that must save some value in certain app local storage using the "app.setOption" method, for example. So what we must take in consideration is that the contexts are different, and we can't directly accesss the contexts in a "direct way", but, using the communication / messages mechanism.
Please, go ahead and post here if you have some doubts or any further questions around these points.