IConnectionPointContainer* pConPtContainer = NULL Hr = pElemDisp- >QueryInterface(IID_IHTMLFormElement, ( void**)&pElem) If a page has a password field, then you'll be interested in getting the user ID and password.įor( long lIndex = 0 lIndex item(varIdx, varIdx, &pElemDisp) get element collection from page to check You never know which one contains uid and pwd fields Hr = pUnk- >QueryInterface(IID_IWebBrowser2, S_OK = pEnumerator- >Next( 1, &pUnk, &uFetched) Hr = pContainer- >EnumObjects(OLECONTF_EMBEDDINGS, &pEnumerator) HRESULT hr = spDocument- >QueryInterface(IID_IOleContainer, Void CIeLoginHelper::EnumFrames(CComPtr & spDocument) * there can be frames in HTML page enumerate each of frameset or iframeĪnd find out if any of them contain a login page*/ If this is not an HTML document (e.g., it's a Word doc or a PDF), don't sink. HRESULT hr = m_pWebBrowser2- >get_Document(&spDisp) If you find one, we are almost sure that this is a login page. To detect this, you have to search through all the elements in the document object and find out if there is any element that's of type "password". Here, we should check if a page is a login page. When the browser completes downloading a page, it sends an event DISPID_DOCUMENTCOMPLETE. Another important thing is that most login pages have only one object of type and only one object of type. After some experiments, I found that we should try to retrieve the password of a page only if it has at least one input field of type "password". If you get an answer to this, you can do the rest. The basic question that comes in mind is how we can detect that a given page is a login page. There are many articles on how to develop a BHO using ATL, so I would skip this and focus on how to handle events and access DOM to retrieve user ID and password. Imagine developing a software that can retrieve the user ID and password! To achieve the above, I needed to develop an Internet Explorer plug-in or BHO. The latest version of Firefox and Netscape also support this by Passcard. Have you ever used any password manager and auto form filler software? AI RoboForm is the oldest and the best in the industry.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |