I get that the show method can not be invoked from outside the main addon script. So, what is the right logic to show panel2 when a link in panel1 is clicked? Is it by using using window.open() ?
How can I tell thepanel2 script to not get executed until the panel2.html window is opened? because when I tried it, the panel2 script get executed nefore I click the link in panel1 and before the panel2.html page opnes.
Another problem that makes window.open(panel2.html) is not a good solution is that I want to pass variable from index.js to panel2.js. Therefore, I need to define it as a panel in index.js. But the problem is I can not open it through panel1.js.