Firefox - open page and auto-click?

Scorpion Ghost

Elite Member
Executive VIP
Jr. VIP
Joined
Mar 22, 2013
Messages
9,145
Reaction score
10,489
So I want to do something in Firefox. It's something between Greasemonkey and a bookmarklet.

In a nutshell, I want to open a page and have something be auto-clicked on it.

The issue with bookmarklets is that they stop working on page reload. So I can use a bookmarklet to open the page, but then the code won't continue to execute the click.

The problem with Greasemonkey is that it's URL-bound. And that won't work in this case because I need a different thing clicked on the same URL (the click should be defined by me).

The idea was to use bookmarklets, and to have for example 3 bookmarklets in my browser:

| Open tab and Click 1 | Open Tab and click 2 | Open tab and Click 3 |

And then depending on what I need I would click the correct bookmarklet and it would open the page and click what I want.

So let's say I want to open 1 tab for each. I would do 1 middle-mouse-click on each bookmarklet. That would open 3 new tabs, and each would have the right thing clicked.

---

So bookmarklets won't work, at least not according to the guy who tried to make this for me and according to the reading I did on stackoverflow (granted, the stackoverflow threads are old).

Greasemonkey won't work. Unless, I don't know, if I can manipulate Firefox to open a URL of my choice, but inside that URL load the page I need (maybe in a frame?), and then I can have greasemonkey click what I need inside the frame. So say I open:

bhw.com
bhw1.com
bhw2.com

Bu they all actually open/display bhworld.com on the page. Then Greasemonkey could click based on URL, and solve my problem.

So I don't know. Any ideas?
 
You can learn Robotic Process Automation, and download UiPath. Good luck.
 
I can't believe it, but I actually found a working solution. I literally came up with it while writing this thread. That's what happens when you "think outloud" :D

So I'm sure some coders are gonna wanna find my location and attack me for what I did, but fuck me it worked! :eek:

I used this extension to allow me to inject HTML in a page - https://addons.mozilla.org/en-US/firefox/addon/codeinjector/

Then I found this on Stackoverflow - https://stackoverflow.com/questions/38068019/load-another-domain-website-in-a-iframe

I'm injecting the same domain website, just 2 different pages. So I added this HTML in the Firefox extension:
HTML:
<!DOCTYPE html>
<html>
<body>
   <iframe src="https://mysite.com/ " width="800" height="800">
   </iframe>
</body>
</html>

The on page load it actually fucking worked. The page I set was injected. And it also worked! I could use the site through the iFrame like a boss, everything worked!

But then I had an issue that the embedding was happening at the end of the page, requiring me to scroll down. So I thought about maybe editing the code somehow or wrapping the code in another iFrame, in order to command it to be on top! I failed. Then I thought about contacting the developer of the Code Inject extension, but there's no email there, only a Github page, and no one is replying to the issues on the Github page. I figure editing the actual extension could force it to display the injected code at the top of the page.

So eventually I figured, just hide the entire page with CSS! So I used a Firefox extension called "Stylus" and I set a "display:none" to the entire site. Header, footer, fucking everything. And it worked! :cool:

So now the page loads, everything gets hidden by Stylus, and Code Injector adds my frame which gets displayed on the entire page, and I get what I wanted!!! YESSSSSSSSSSSSSSSSSSSSS!!!

Now I need to see if I can get Greasemonkey to do clicks inside the frame. That could be trickly, but I think, and hope, doable :)
 
Have you tried imacros addon?

That might easily do what you are trying to do.
 
Have you tried imacros addon?

That might easily do what you are trying to do.

Yes, but no.

Even if the iMacros window is expanded, i still need to open say 5 tabs, then select the proper script, then click play.

A bookmark that takes me to a page and then Greasemonkey clicking on the page is faster! Requires less clicks and thinking by me. A better solution.
 
Aaand Greasemonkey works and clicks in the iFrame fine just fine.


Hooraaaa :D

 
Is there any way to refresh an url every 3 seconds and if a button appears auto click on it ?
 
You could do it with Javascript. I'll see if I can make the code
Wow that would be great for me there are some chrome plugins that can only refresh the pages and give alerts if smth new on the specific area but without auto click options
 
Back
Top