Source language: Translate to:

WebBrowser get Variable List

General questions about NeoBook

Moderator: Neosoft Support

WebBrowser get Variable List

Postby David de Argentina » Fri Dec 06, 2013 1:01 pm

Hi all,

Are there any way to get a list for all variables from the WebBrowser object (and its values...) ?
Specially Javascript variables.

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Re: WebBrowser get Variable List

Postby CN_Iceman » Fri Dec 06, 2013 2:52 pm

Mmmm... I'm also really interested in this.

Greetings.
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
CN_Iceman
 
Posts: 297
Joined: Tue Mar 01, 2011 11:04 am
Location: España

Re: WebBrowser get Variable List

Postby Gaev » Fri Dec 06, 2013 4:00 pm

David de Argentina, CN_Iceman:

I did some google searches ... the solutions referenced below output to console.log() ... which is the Debugger window of the Browser ... but you should be able replace that with alert command (first) or back to NeoBook variables (later).

1) http://stackoverflow.com/questions/2934 ... me-console
Code: Select all
for(var b in window) {
  if(window.hasOwnProperty(b)) console.log(b);
}


2) http://stackoverflow.com/questions/1727 ... ed-by-site
Code: Select all
var keys = Object.getOwnPropertyNames( window ),
    value;

for( var i = 0; i < keys.length; ++i ) {
    value = window[ keys[ i ] ];
    console.log( value );
}


More suggestions at http://stackoverflow.com/questions/8369 ... -variables

I have not tried any of these but feel free to post back here if you run into problems.


Note: if you have control over the html page's javascript, you could use a JSON object to store all variables (as key/value pairs) ... then it becomes easy to read all keys of this one object.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: WebBrowser get Variable List

Postby CN_Iceman » Sat Dec 07, 2013 2:01 am

Thank's for the info Gaev.
Greetings.
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
CN_Iceman
 
Posts: 297
Joined: Tue Mar 01, 2011 11:04 am
Location: España

Re: WebBrowser get Variable List

Postby yanzco » Fri Dec 12, 2014 11:02 am

any info on this?..
anyone tried?

i also want to lnow how can i get variables in javascript into neobook setvar..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: WebBrowser get Variable List

Postby Neosoft Support » Fri Dec 12, 2014 12:38 pm

You will have to experiment, but try replacing the console.log command in the above examples with something like this:

window.external.nbSetVar( '[neobookvar]', value );
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests