HTA and mouse selection

R

Robert

Hi:

I intend to use an HTA (HTML application) in order to circumvent the
security model of Internet Explorer that prevents cross-domain
scripting.

The document I have normally no access to (i.e. www.yahoo.com) is
displayed in a frame. I can change its content, but for some reason
I cannot retrieve the selection the user makes with the mouse. In
other words:

function changeInput()
{
inputs = myFrame.document.getElementsByTagName('input');
for (i = 0; i < inputs.length; i++)
{
inputs.outerHTML = 'hello';
}
}

.... works, regardless of the url of myFrame, but...

function getText()
{
alert('we have a selection of type ' +
myFrame.document.selection.type);
alert (myFrame.document.selection.createRange().text);
}

.... only works if myFrame points to a document in my domain (an
"access is denied" error is raised when I try to access the
"selection" property - i.e. it behaves like a regular HTML page, not
like an HTA).

Any idea?

Thanks,
Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top