/    Sign up×
Community /Pin to ProfileBookmark

Javascript and greasemonkey open a window and press a button

Hello all, i’m real noob, but i’m trying to learn, but perhaps what i need to do is really to difficult for a begginner.
i need to do the following operations for my greasemonkey on mozilla.
i need to create a javascript file that does:

-open a new window
-on that window i know a button is there. i need to press that button automaticly. if the button is not there close the window.

is this really so difficult? i read something i have to do with DOM inspector, but in actual fact i tryed writing the first part (opening a new window)and it won’t work.

Soory for my noobness

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoJul 21.2007 — This is a security violation and is not possible. Most people who want to do this are either trying to fool click support ads or trying to cheat at online games . . . or trying to install a virus without the user having to accept a download . . .
Copy linkTweet thisAlerts:
@nmeloniauthorJul 21.2007 — oh i didn't know this. what i wanted to do was to find a short cut to not having to press the submit button twice (each on both the windows that open) on the online game. The actual procedure is this:

i have to search the player i want to attack. once i found him on the list, i have to press the attack button. after that a new window appears and i have to press the attack button once again. What i want to do is to have to avoid to have to press that button twice. it is so annoying. That was all. i don't think that is cheating.
Copy linkTweet thisAlerts:
@konithomimoJul 21.2007 — That same exact question was on this forum multiple times the last time i was on . . . a few months ago . . . and the only thing you can do is build a java applet to do what you want, or some other language that has access to the net, or use a clicking program that you download, which most likely wont work in your case, since the windows probably wont open up in the same location every time.
Copy linkTweet thisAlerts:
@nmeloniauthorJul 21.2007 — The Point Is Nobody Helped Me Yet
Copy linkTweet thisAlerts:
@konithomimoJul 21.2007 — The Point Is Nobody Helped Me Yet[/QUOTE]
OK . . . the thing is that JavaScript cannot do what you want, since force clicking a button is a security violation. It was supported in older versions of IE, as a bug, but no longer is. if you still wish to do this then try asking in the JAVA forum, to get someone to build an applet for you that will detect a pages location, and the location of buttons on that page, and then click that button. JS has no control over the mouse location (as you want it), and there is no event for a button to autoclick it.
×

Success!

Help @nmeloni spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...