- Mar 22, 2013
- 8,676
- 10,228
I have a weird problem. I'm using Firefox. There's a website I visit sometimes and I click a button whenever it appears. The button normally opens in a popup, but I have set Firefox to open all popups as tabs.
This particular button, when I start the browser and I do one click manually, then as long as the browser stays open my Greasemonkey script can click the button whenever it appears and it works fine.
Here is what I use now:
But if I open the browser and I don't do a click manually, when Greasemonkey does the click I get this in Firefox:
Firefox prevented this site from opening a pop-up window
I have the option to add the site to the whitelist/exceptions, and then popups will be allowed and it will always work. But I can't do that because this creates a new problem for me.
The new problem is that sometimes this website sort of "autoclicks" this button on its own, and when it does, and the site is added to whitelist/exceptions, the browser automatically redirects me to that other tab (like focusing a popup I guess). But I don't want this. I want to stay on the first tab always. I tried finding a way to prevent Firefox from allowing automatic tab switches, to make it load popups in background, but nothing works.
The code on the website for this button is this:
I think the problem is that it's an "onclick" event thing, and Firefox handles it weirdly. Not like the usual buttons I'm used to automating clicks for anyway
So I'm thinking the solution is either some sort of Firefox edit, or a Greasemonkey click that stimulates a mouse click for real (some fancy ajax/jquery/black magic, not my noob methods).
Any ideas? @TomTheCat @Gogol
This particular button, when I start the browser and I do one click manually, then as long as the browser stays open my Greasemonkey script can click the button whenever it appears and it works fine.
Here is what I use now:
JavaScript:
document.elementFromPoint(900, 421).click();
But if I open the browser and I don't do a click manually, when Greasemonkey does the click I get this in Firefox:
Firefox prevented this site from opening a pop-up window
I have the option to add the site to the whitelist/exceptions, and then popups will be allowed and it will always work. But I can't do that because this creates a new problem for me.
The new problem is that sometimes this website sort of "autoclicks" this button on its own, and when it does, and the site is added to whitelist/exceptions, the browser automatically redirects me to that other tab (like focusing a popup I guess). But I don't want this. I want to stay on the first tab always. I tried finding a way to prevent Firefox from allowing automatic tab switches, to make it load popups in background, but nothing works.
The code on the website for this button is this:
Code:
<a class="bla_ble_blue asd3-wer" onclick="openWinPopupTimeNetw(123, 'yadayada==', 'rty-dfg', '654dhfdfh8', '9', '15', ma na ta ra', 'dsf6845ASD84!@$dfg56');"><span> </span><div class="lala">tra sta</div></a>
I think the problem is that it's an "onclick" event thing, and Firefox handles it weirdly. Not like the usual buttons I'm used to automating clicks for anyway
So I'm thinking the solution is either some sort of Firefox edit, or a Greasemonkey click that stimulates a mouse click for real (some fancy ajax/jquery/black magic, not my noob methods).
Any ideas? @TomTheCat @Gogol