I have got a page in my frontend with different buttons, all buttons, on their own, work perfectly, but if I click the button that opens an extension in the chrome web store and click on another button afterwards, the page doesn't open.
Here is an exmaple of what I am talking about. If you click the buttons without closing the tabs that are opening, the button you click after the chrome web store opens won't have an effect. Does anybody know why that is and how to work around that?
https://html-ichr7r.stackblitz.io
Here is the code for it.
<button id="button1" onclick="window.open('https://www.facebook.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button2" onclick="window.open('https://www.google.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
<button id="button3" onclick="window.open('https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj?hl=de','popup','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button4" onclick="window.open('https://www.9gag.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
Any help is appreciated!
EDIT: I just figured out that it works in firefox, still don't know why it doesn't work in Chrome though.
I have somewhat of a solution: for your Google webstore link change popup
to something else like popupWindow
, so you'll have:
<button id="button1" onclick="window.open('https://www.facebook.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button2" onclick="window.open('https://www.google.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
<button id="button3" onclick="window.open('https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj?hl=de','popupWindow','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button4" onclick="window.open('https://www.9gag.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
You will have actually have two different popups with this code.
About the explanation, I am a bit in the dark with this one. I think Chrome is preventing executing JS on https://chrome.google.com/webstore/*
as a security measure. You can read more about similar issues here and here here.
Addition (after having some thoughts about it):
This is probably a smart move by the developers of Chrome. By not allowing any JS to alter any of the pages on https://chrome.google.com/webstore/
, they are sure that also no extension can possibly alter this page. Immagine if you install an extension that does the thing in advertises quite well so it will get a positive score, while it also alters the page of the extension webstore. It could trick users into installing additional (hacky/adware-ish) extensions or software that would infect the users browser or computer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With