ActiveX Object.

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

ActiveX Object.

Post 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.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Re: ActiveX Object.

Post 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.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: ActiveX Object.

Post 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).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Without being from a "trusted site" ActiveX will not allow it to even look at the Registry, if memory serves.
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post 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.
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What the heck does alert() have to do with setting a homepage?
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post 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.
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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?
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post 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.
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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?
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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).
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

Thank god I use Opera and don't have to worry about someone doing something like that. :D
Post Reply