473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Read WMI from FF extension and [SOLVED]Change value of textbox via Firefox extension

as title says i wish to change the value of a textfield in the current website.

Basicly it enters a certan user and pass on a certan website, both will be stoerd in the prefrences.

then the script will check if the website is the correct it will logon and click submit.

also (sorry for merging 2 questions) is it possible to get WMI data from within a firefox extension , i can do it in VBscript.

Thankyou

This is my basic idea/script:

Expand|Select|Wrap|Line Numbers
  1. var CURL = (get url sumhow, will reasearch later);
  2. var Uname = (get user frm prefs);
  3. var Pass = (get pass from prefs);
  4.  
  5. if (CURL = (url i want)) {
  6. document.forms[0].TEXTFIELD1.value = Uname 
  7. document.forms[0].TEXTFIELD2.value = Pass
  8. document.forms[0].submit()
  9. }
  10.  
Jan 15 '09 #1
5 3317
Expand|Select|Wrap|Line Numbers
  1. content.document.forms[0].TEXTFIELD.value = "GhOsTTeCh"
  2.  
That code changes the value of "TEXTFIELD" to "GhOsTTECh"
for any1 reading this that also wants an awnser (possibly from a google search) add "content." beofre "document."

well than the next question remains , How do i Query the WMI via a firefox extension
Jan 15 '09 #2
rnd me
427 Expert 256MB
you can use command line tools to enumerate wmi.

not sure that extensions can run commands however.
why does it need to be an extension?

it would be easier to do it all in regular firefox javascript.

i have a small routine that uses a simple exe to fetch a remote url, local file, or run and retrieve a command. i can find it for you if it sounds useful.

it can be activated using a custom mime-type document.
it reports back to the script via a script tag pointing to a file in the same folder as the exe.
Jan 15 '09 #3
@rnd me
Due to the fact in order to browse the net , umust now login into the new Routers we have(thats why i had to change the Textbox values), we cannot edit the router login page and most 70% forget to log in , so if it was automatic it would save us alot of time and headache.

@rnd me
unfortanetly a exe cannot be used in this scenario as the extension will check the SSID and if it matches the set SSID , it will apply proxy settings and log the user in. with a exe it may get too complicated for the users and the "Technichal Support" (if you only knew the full story you would laugh or be shocked). a simple extension is good due to the fact they will not start complaining about reasons they pull out of their behind.

at the moment i hav created a simple exe that reads the WMI and saves the data to a txt file. Firefox exectues this file and then reads the txt, the negativ is that mozilla dose not wait for the exe to finish and the WMI class lags and sometimes it goes to read the file it the file dosnt exist so proxy isnt applied.
however with a built in WMI command it will wait to compltely grab the data before executing the rest of the extension.
Jan 15 '09 #4
rnd me
427 Expert 256MB
@GhOsTTeCh
that's basically the setup i described except for one thing:
i don't use a raw text-file, i use json and a callback.
this allows the data to be loaded though a script tag.

i have a function that re-loads a script tag by changing it's source.

lets call that function reCheck().

when the exe runs, the first thing it does is write to the json file "setTimeout(reCheck, 500)".

this causes the script to self-refresh twice a second until the data is written by the slow exe.

i guess you could simply poll the text file though...

to me, it sounds like the main idea is to break your operation into two parts:
the data call and a callback, and let the exe run between those.

EDIT: one more thought:
is you have an ASP server, you can call an exe from there and wait for the results. you could call the ASP page with a synchronous ajax call, and the data would have be there as function process the result. ASP can wait, javascript really cannot.
Jan 15 '09 #5
@rnd me
Rechecking it to see if the file has been written smart :).
i did a quick and dirty way to keep chcking and if it exists to read it .

Expand|Select|Wrap|Line Numbers
  1. file = [FF classes , etc]
  2.  
  3. var to = 0;
  4. do
  5. to++;
  6. while (file.exists() == false)
  7. //then i wanted to see what to was after the looping
  8. alert(to);
  9.  
to ranged from 1200 - 2700 so it is much fatser than the 3 seconds timeout i had set.

if anyone still knows how to query the WMI via the fox plz tell , im still curious and it may help with diagnostic extensions.

thankyou rnd me ur idea gave me the right idea :)
Jan 16 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Anand | last post by:
I have a C extension to a dll function. static PyObject *_wrap_SetTxCommandRegister(PyObject *self, PyObject *args) { PyObject *resultobj; int arg1 ; int arg2 ; int arg3 ; char *arg4 = (char...
1
by: Krechting | last post by:
Hi All, I tried to read the value of a textbox in another form. I have a page which contains one record. The textbox "txtWID" contains the autonumber of the record. I want to read this value in...
3
by: SzokU | last post by:
Hi All! I have problem... I want to write/read value from param tag in applet, but I don't know how... This is exaple code:...
1
by: Alex Stevens | last post by:
Hi All, I have implemented my own toolbar on a form which houses the crystal reprot viewer. I would like to have a combobox to allow the user to change the zoom level to say 25 / 50 / 75 / 100...
1
by: carlbernardi | last post by:
Hi everyone, I have to following code but I am not able to get it to work when the data file does not have the same origin as the html file. Can anyone help me out. The code was originally...
1
by: myahact | last post by:
Hello, I have <input type=file id=myfile> in a form. In IE I can read the value thusly: document.getElementById("myfile").value But thusly returns "" in Mozilla/Netscape. I also tried...
2
by: zoneal | last post by:
Hi everybody there .....I need help ..... I want know how I can get or read value from website by using Visaul basic Net .....Is this possible or not .... I want to get value from this website...
7
by: ravenfrost | last post by:
Hello, I have a text box that I am entering items into line by line. I want to read in the data one line at a time into a variable through a loop. I know the textbox does not have a readline...
4
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.