Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I pretty much want to make a website that allows users to paste a link to any webpage and be able to see a preview of that page together with the html code behind it (just like you would use 'Inspect' in google chrome). The tricky part is making the following key feature: when the user hovers over an element on the preview of the webpage, it should highlight the html code responsible for it, and further identify which element did the user click on if he performs that action at all.
How would you go about implementing this?
I also want to use only Django with templates, if that impacts the approach at all.

What I have tried:

I searched online but found pretty much nothing related to building such a tool
Posted
Updated 11-Jul-23 11:03am
Comments
Dave Kreskowiak 11-Jul-23 19:01pm    
Question: Why would you do this when anyone can just go to the site they're interested in and just hit F12 in their browser?

1 solution

Basically, you'll have to write (or clone from Chromium) a new browser that lets you interact with the elements. You can embed a web browser in applications in some languages (.NET allows it pretty easily) but without access to the internals of the browser code that's not going to help you.

Is this a job I'd take on? No. It'd take too long, and be too frustrating I suspect.

[edit]
As an update, I found this:
The Chromium browser codebase contains about 35 million source lines of code.
You're probably going to have to understand maybe half of that ... big job! :D
[/edit]
 
Share this answer
 
v2
Comments
Andre Oosthuizen 12-Jul-23 5:22am    
I agree, basically re-inventing the wheel again.
AlexandruCrisan 12-Jul-23 6:42am    
Yea this is pretty much the idea but I am as well evaluating if I should even attempt this. Thank you anyway
OriginalGriff 12-Jul-23 7:16am    
You're welcome!
As I said, I wouldn't!
(Answer updated)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900