Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Execute Javascript code
Tue, Jun 13 2017 2:43 PMPermanent Link

thomh

Hi,

Is there anyway to execute this piece of Javascript code in EWB?

 function openURL()
 {
     var shell = new ActiveXObject("WScript.Shell");
     shell.run("Firefox http://www.google.com");
 }

Thanks.

// Thom
Tue, Jun 13 2017 4:14 PMPermanent Link

Walter Matte

Tactical Business Corporation

Uses WebDom;

Window.Location.href := 'http://www.google.com';
Wed, Jun 14 2017 3:06 AMPermanent Link

thomh

Walter Matte wrote:

<<Uses WebDom;

Window.Location.href := 'http://www.google.com';>>

Hi Walter,

This code overwrites the Google web page in the existing browser tab. The Javascript code it supposed to shell out and open a new Firefox browser window.

// Thom
Wed, Jun 14 2017 5:10 AMPermanent Link

Walter Matte

Tactical Business Corporation

Javascript:

 window.open('http://www.google.com','_blank');
Mon, Jun 19 2017 3:12 PMPermanent Link

Kenneth

Avatar

<<Is there anyway to execute this piece of Javascript code in EWB?

 function openURL()
 {
     var shell = new ActiveXObject("WScript.Shell");
     shell.run("Firefox http://www.google.com");
 }>>

If you want to run exactly your function as it is then add it to the External Files and run it as an external procedure.
Kenneth
Image