Page 1 of 2

ActiveX Object.

Posted: Tue Sep 25, 2007 12:56 am
by figaro11
Is there such a thing as an ActiveX object model in Internet Explorer? One that would allow me to edit a registry key, Start Page key to be specific?

Sorry for being a little brief. But I don't know what else to say.

Re: ActiveX Object.

Posted: Tue Sep 25, 2007 4:40 am
by AKA Panama Jack
figaro11 wrote:Is there such a thing as an ActiveX object model in Internet Explorer? One that would allow me to edit a registry key, Start Page key to be specific?
Another reason why ActiveX should be banned from all browser usage.

Re: ActiveX Object.

Posted: Tue Sep 25, 2007 5:29 am
by superdezign
figaro11 wrote:One that would allow me to edit a registry key, Start Page key to be specific?
Any site that does that would be a site I'd never visit more than once (on purpose :P).

Posted: Tue Sep 25, 2007 9:07 am
by feyd
Without being from a "trusted site" ActiveX will not allow it to even look at the Registry, if memory serves.

Posted: Tue Sep 25, 2007 12:19 pm
by figaro11
I heard somewhere that ActiveX allows you registry access, maybe with a confirmation from the user with a confirmation dialog box.

The reason I'd like to access the registry is to set IE7 homepage. I don't mind if the user would be prompt that this is happening because I would want him to know what is happening.

Doesn't that make sense?

Feyd says that he remembers that ActiveX can't talk with the registry. I've been googling and googling but I couldn't even find a documentation for an ActiveX object in JScript, does one even exist?! I even searched on MSDN, no luck. What's going on here?

Posted: Tue Sep 25, 2007 12:31 pm
by feyd
Let them decide whether they want to make the site their homepage on their own. There's no reason to do this for a user.

Posted: Tue Sep 25, 2007 12:36 pm
by AKA Panama Jack
Just stay completely away from ActiveX. Most other browsers do not even support it. And not supported on other operating systems so using it is excluding quite a few people.

Fortunately, ActiveX is usually used only by obscure, rarely used sites or by hackers trying to gain access and information when you hit their site with IE.

Posted: Wed Sep 26, 2007 2:31 am
by figaro11
Okay, first let me clears some things up.
Feyd wrote: Let them decide whether they want to make the site their homepage on their own. There's no reason to do this for a user.
Yes there is. IE7 can not add [javascript: alert("hello world");] as a homepage of any kind. IE6 does but not IE7. The only way to get [javascript: alert();] as a homepage is to edit it directly in the registry. The average PC user doesn't even know what a registry is, or a browser for that matter, so I can't just say "For all you IE7 users out there, edit the registry key Start Page.". So I was thinking of automating the "installation", if you will, of my homepage/bookmarklet.

I know Safari doesn't allow the javascript protocol in a homepage, but they do in a bookmark and I haven't found any other solution for Safari.
AKA Panama Jack wrote:Just stay completely away from ActiveX. Most other browsers do not even support it. And not supported on other operating systems so using it is excluding quite a few people.
Don't worry Panama Jack, this will be IE specific.

Hopefully you understand. Is there a documentation of an IE specific object call ActiveX or something similar? I know that IE's HTTPRequest object is an ActiveX object, right?

EDIT: To create a new XMLHttpRequest object in IE:

Code: Select all

var HttpRequest = new ActiveXObject("MSXML2.XMLHTTP.3.0");
So I researched the ActiveXObject and found this. All this tells me is that the ActiveXObect has two parameters, one optional and one not. The first is a string, but I don't know what string is expected. What string is expected?

Posted: Wed Sep 26, 2007 9:26 am
by feyd
What the heck does alert() have to do with setting a homepage?

Posted: Wed Sep 26, 2007 1:31 pm
by AKA Panama Jack
feyd wrote:What the heck does alert() have to do with setting a homepage?
Really, that's a stumper. That is pretty darned useless.

Posted: Wed Sep 26, 2007 6:59 pm
by figaro11
AKA Panama Jack wrote:
feyd wrote:What the heck does alert() have to do with setting a homepage?
Really, that's a stumper. That is pretty darned useless.
Your absolutely right, alert is pointless. But I was using it as an example; I'm trying to prove a point. alert() is javascript, and it's the more simple function in javascript. So my point is, by writing [javascript: alert();] I'm saying just any old javascript where alert() is. Do you not not understand?

Posted: Wed Sep 26, 2007 7:07 pm
by AKA Panama Jack
Still pretty damned useless to put javascript into a homepage link in a browser. But I bet there are security reasons why most decent browsers prevent it.

Posted: Wed Sep 26, 2007 7:20 pm
by figaro11
AKA Panama Jack wrote:Still pretty damned useless to put javascript into a homepage link in a browser. But I bet there are security reasons why most decent browsers prevent it.
It's quite useful in FireFox. For example I could write something like this:

Code: Select all

javascript:function loadScript(scriptURL) { var scriptElem = document.createElement('SCRIPT'); scriptElem.setAttribute('language', 'JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem);}loadScript('http://westciv.com/xray/thexray.js');
But instead of the XRAY application, a customizable "homepage center". I don't know why you guys can't see it.

But anyways we're getting off topic. My question: What's the first parameter for the ActiveXObject() constructor?

Posted: Wed Sep 26, 2007 7:43 pm
by stereofrog
figaro11 wrote:I heard somewhere that ActiveX allows you registry access, maybe with a confirmation from the user with a confirmation dialog box.

The reason I'd like to access the registry is to set IE7 homepage. I don't mind if the user would be prompt that this is happening because I would want him to know what is happening.
Hi,

there's no such thing as "ActiveX object model". ActiveX is just the name of the technology, each ActiveX component has its own set of objects and methods, depending on its purpose. For accessing the registry (and other system-level tasks) there is the built-in "Scripting shell" component, here's an example on how to use it:

Code: Select all

// init the component
var wsh = new ActiveXObject("WScript.Shell");

// use it to read a registry value
var value = wsh.RegRead("HKLM\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page");
For writing there's symmetric RegWrite() method, for more info search MSDN on "WScript.Shell".

Of course, IE doesn't allow stuff like this by default, doing this only makes sense in a less secure environment (intranets etc).

Posted: Wed Sep 26, 2007 9:15 pm
by AKA Panama Jack
Thank god I use Opera and don't have to worry about someone doing something like that. :D