HTMLAnchorElement.click() security problem

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I have a class that tries to navigate IE using SHDocVw.dll and mshtml.tlb.

I have a function that clicks a link based on the value of the innerText
property.

public void ClickAnchorWithValue(string anchorValue)
{
HTMLAnchorElement anchor = (HTMLAnchorElement) GetElementByValue("A",
anchorValue);
anchor.click();
WaitForComplete();
}

Works great unless there is script attached to the link... in which case it
I get an permission denied error.

For example both of these links are found and clicked but...

This link give no error.

<a href="/services/">Business Solutions</a>

This one gives the error and the script is not run.

<a href=/mgyhp.html
onClick=document.getElementById("hp").setHomepage("'+a+'");_rptHp();>Make
Google Your Homepage!</a>
 

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

Back
Top