COMMUNICATION BETWEEN WINDOWS/TABS
The main WebProg3 Editor is surrounded by independent modules for carrying out specific tasks. The Rich Text Editor, Picture Uploader. Colour Chooser etc. are examples. In all cases, a separate window is opened and information for processing is sent to it (if necessary). The module does its stuff, and then sends the result(s) back to the Main Editor. While the module is doing it job, the Main Editor goes around in circles, waiting for the module to return its result(s). Communication of variables and their contents between windows (or tabs) is done via the localStorage memory.

It may be that you need to do something similar, so I'll show you how it is done in WebProg3 using a simple example.
We'll see the example first, and then I'll give you the explanation of it afterwards, OK?

In the example below, there is a box in which you can type a question. If you then click on the Send button, another window will be opened and the question will be displayed in it. After typing an answer in the box provided and clicking on this window's Send button, the message is sent back to this very window, and you will see it has appeared in the Answer box. So here it is:
Ask a question
Answer:
Send...
See the JQuery/Javascript coding for this "question" page and also for the "answer" page below.
"QUESTION" PAGE
As you can see, "answerText" is initially set to empty.








Then, the value of this variable is polled within a timer loop until such time as it is no longer empty.





As soon as answerText is found to have a value, the answer window is closed, the answerBox here is filled, and the timer loop is aborted.
This is not the "modern" way of doing it, which would use promises and other complicated stuff. I tried that, and I couldn't get it to work! This is the simpler way as I have done it throughout WebProg3.
"ANSWER" PAGE
The send button of the answer page just gets the answer from its answerBox and puts the data into the answerText variable in localStorage, which is being polled in the question page for a non-empty value.
First off, the answer page gets the question from localStorage and fills its questionBox with it.

The operator then types an answer in the box provided.
LOCAL SERVER
Please note that if you run this little demo in Firefox, the answer page will open in a new browser window.
But if you run it in Google Chrome, it will be opened in a new tab instead.

Here, we are running it online, so there is no problem. Nor is there any problem if you run it offline in Chrome. However, if you try to run it offline in Firefox, it won't work. Firefox refuses to use localStorage unless it is on a server. You can put it up on the Internet, or you can use a local server on your machine. Below, you will see an example of how this can be done easily, without installing anything.

If you would like to download the demo, use the icon on the left here.
Download
DEMO

communication_demo.zip,sametab

What follows is just one example of how a server can be used on your local machine.

If you are using Linux (as you ought to be 😁), such as LMDE ("Linux Mint Debian Edition"), you just need to type a command into your Terminal and then navigate to your page in the browser.

Open up the Terminal and type this, followed by ENTER:

python3 -m http.server
As you can see, service is provided on port 8000.

Keep the Terminal open (minimize it if you like), and open up your browser:
Type this into the address bar:
http://localhost:8000/
Let's suppose that you expanded the demo's ZIP fle to the Desktop.
It has two scripts in it:
quesrion.htm
answer.htm

Clicking on "Desktop" will show you all the folders/files on your Desktop.
From there, click on "question.htm" to execute this script:
BLOCK CACHING
Typically, when we are working on a script, we save it, make more alterations, and save it again. In this process, you might well re-save your script to a file of the same name, replacing the original, instead of creating a new version. But when you refresh your browser to see the new version, it won't appear: the browser will show you the original version you created instead! That's because the original was saved in a cache. You need to stop that happening in order to be able to work properly.

If you are using an up-to-date Firefox (as you should be when you use WP3 anyway), the solution is simple. See below.
Choose these options in your browser's menu.
http://localhost:8000
As you can see, localhost is set to allow caching.

Type the full site name at the top, as shown, and click on the BLOCK button.
Your typing is removed, and the site is now signalled with "Block" in the site-list.







You can now click on Save Changes and close the tab.
BUT BUT BUT BUT BUT
Here, we can run up against yet another quirk of Firefox. If you were developing the app on this page as I did, making alrerations to the coding and re-saving the same file, you would be unable to test it by running it on "local host" if you had BLOCKED CACHING as shown above. If you attempt to do it with this app or a similar one, you would get a vague message in the browser Console indicating a perfectly valid command as being a SECURITY RISK! After racking your brains for ages trying to find the source of the problem, you might give up, as I did, and consult Google AI or something. It turns out that the problem is this:

You are testing your app on a local server because Firefox prevents you from using LOCAL STORAGE offline, right? But if you have BLOCKED CACHING, FF regards items to/from Local Storage as being essentially the same as COOKIES, and blocks those too!

The message is, if the app you are re-saving and testing contains calls to Local Storage, DO NOT TURN ON THE CACHE BLOCKING OF localhost. You are condemned to doing it the tedious way as follows.
X
USE THIS INSTEAD
DON'T USE THIS
Type in "localhost" at the top.
Select "localhost" in the box below, followed by "Remove Selected" and "Save Changes". Confirm, and then close the tab.
Unfortunately, you need to repeat this EVERY TIME you make manual changes to your script and save it with the same file name.