How to capture visited URLs and their html with any browsers

I want to find a decent solution to track the URLs and html content that users visit and provide the user with additional information. The solution should bring minimal impact to end users.

I do not want to write plugins for different browsers. It is hard to maintain. I do not accept the proxy method, since I do not want to change any proxy settings. My application is written in C # and is aimed at Windows. It is best if the solution can support other OSs.

Based on my research, I found the following methods that work for me, but they all have their drawbacks, I can not determine which one is better.

  • Use WinPcap WinPcap reduces all TCP packets without changing any user settings, but it requires installing WinPcap, which is acceptable for me. But I have two questions: a. how to convert TCP packet to URL and HTML b. Does this really affect performance? I do not know if the sniffer can use all TCP traffic for this requirement.

  • Find history files for different browsers. This method looks easy, but I wonder if the solution is stable. I'm not sure that the browser will consistently write history when it writes. My application will display information before the user leaves the current page. The solution will not work for me if the browser writes to the history file when the user closes the browser.

  • Use the FindWindow object or accessiblity or COM interface to find the user interface element that contains the URL. I believe that this path is not completed, for example, in Chrome, only the active tab URL will be displayed, but not all of them. Another disadvantage is that I have to request the URL at another time in order to get its HTML content.

Any comments or suggestions are welcome. By the way, I do not do spyware. The application tries to find all RSS feeds from a web page and show them to end users. I can easily do this in a browser plugin, but I really want to support multiple browsers with a single user interface. Thank.

+3
source share
1 answer

, .

1 WinPcap - . , . .

Pcap.Net, HTTP. HTTP httpresponsedatagram , .

- Tcp Winpcap

0

Source: https://habr.com/ru/post/1784466/


All Articles