I have created a web app (using flask) in which there are some links like follow:
<a target="_blank" href=" https://in.tradingview.com/chart/?symbol=NSE:ACC1! ">ACC</a>
<a target="_blank " href="https://in.tradingview.com/chart/?symbol=NSE:ADANIENT1! ">ADANIENT</a>
<a target="_blank " href="https://in.tradingview.com/chart/?symbol=NSE:ADANIPORTS1! ">ADANIPORTS</a>
when this links are clicked, the respective page opens, and after loading the page, following popup window is shown on that page.
one way to close this popup is by clicking the cross symbol
and other is to press escape key.
it is annoying to do this on each page i visit.
i want to Programmatically press escape when the page loads completely.
i refered to this question Press Ctrl+c keys automatically onload
difference between this question and mine is that i want to press escape key on the page that is opened when link is clicked and not on the page that i am currently on
when searching for solution i came acroos the onload
function in javascript
i am beginner in javascript.
i want to know how can i use this function on the new page that is loaded.
if question is not clear
this is what exactly i want to do:
- user clicks the link on my webapp
- he gets redirected to respective webpage
- when the webpage loads completely,
escape key
should get pressed on that page so that popup window gets closed.
Note that my webapp is not a public-facing site; I am the only user.
update 2:
after blocking elements unable to access the page normally.