Cefsharp context menu or get element from mouse location

1,795 views
Skip to first unread message

Francesco

unread,
Aug 4, 2012, 8:46:36 AM8/4/12
to cefs...@googlegroups.com
First of all i must say i'm just a beginner in vb.net and i don't know anything about C#, so trying to edit the cefsharp source code for me would be impossible.
Now, i'm trying to show my personalized context menu, i think that the best way to do it would be by getting the html element from mouse position, so if the tag name is "IMG" i show the menu for the image, if it is "A" i show the menu for the link... Then i could get the "href" or "src" attribute so i will know the link or the image location!
Any ideas of how to do this???
You can give me also C# examples and i will try to convert it in vb.net

PS: You are doing a great job, but i think you should improve the usability of the control:
-Embedding it is very difficult, you could not just drag the control with the designer
-It hasn't got events for downloading files, like "BeforeDownload"
-There is almost no documentation so when people has also a small problem they always have to post a question on the group

anthony taranto

unread,
Aug 7, 2012, 2:40:05 PM8/7/12
to cefs...@googlegroups.com


On Saturday, August 4, 2012 5:46:36 AM UTC-7, Francesco wrote:
First of all i must say i'm just a beginner in vb.net and i don't know anything about C#, so trying to edit the cefsharp source code for me would be impossible.
Now, i'm trying to show my personalized context menu, i think that the best way to do it would be by getting the html element from mouse position, so if the tag name is "IMG" i show the menu for the image, if it is "A" i show the menu for the link... Then i could get the "href" or "src" attribute so i will know the link or the image location!
Any ideas of how to do this???
You can give me also C# examples and i will try to convert it in vb.net

I don't think this is possible using CEF/CefSharp, you will most likely have to write javascript to handle this.
 

PS: You are doing a great job, but i think you should improve the usability of the control:
-Embedding it is very difficult, you could not just drag the control with the designer

The Visual Studio designer does not support embedding controls defined in DLLs that mix managed and unmanaged code, as CefSharp does.
 
-It hasn't got events for downloading files, like "BeforeDownload"

A few other users have implemented this in their forks, I have not merged it into my fork yet.
 
-There is almost no documentation so when people has also a small problem they always have to post a question on the group

I work on CefSharp in my free time, writing documentation is boring.

--Anthony

Jack O'Connor

unread,
Aug 7, 2012, 3:11:36 PM8/7/12
to cefs...@googlegroups.com
You can find poor man's documentation in the header files of the CEF project itself, which are well documented inline. Much of CefSharp uses the same method names, has the same boolean flags, etc.

--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cefsharp/-/EaGtFsOgkcsJ.

To post to this group, send email to cefs...@googlegroups.com.
To unsubscribe from this group, send email to cefsharp+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cefsharp?hl=en.

Francesco Li Causi

unread,
Aug 11, 2012, 4:37:44 AM8/11/12
to cefs...@googlegroups.com

Thank you both for your answers.
For Anthony: I'm trying to create a simple browser, so i don't think i can edit the page to add JavaScript code before passing it to cefsharp...
Are you going to add the download events also to your fork?
For Jack: thank you for the suggestion, i will read and try to understand them

anthony taranto

unread,
Aug 13, 2012, 2:57:34 PM8/13/12
to cefs...@googlegroups.com
Yes, I plan to bind the download handler.
Reply all
Reply to author
Forward
0 new messages