For some security reasons,I need to disable this behavior .
I have tried to override the OnBeforeNavigation method, but "javascript:" scheme seems not trigger this method.
Thanks!
HarmlessDave wrote:You could use CEF in windowed mode and create a main frame with your own user interface, then you have complete control over the address bar, menus, tabs, etc.
Czarek wrote:Try OnBeforeBrowse in the Browser process.
mainFrame->LoadURL("javascript:alert(1)")
zgshen wrote:HarmlessDave wrote:You could use CEF in windowed mode and create a main frame with your own user interface, then you have complete control over the address bar, menus, tabs, etc.
Yes,I did. I use "mainFrame->LoadURL" to handle the request from address bar.
Do you mean that I should check the url before invoking LoadURL?
HarmlessDave wrote:zgshen wrote:HarmlessDave wrote:You could use CEF in windowed mode and create a main frame with your own user interface, then you have complete control over the address bar, menus, tabs, etc.
Yes,I did. I use "mainFrame->LoadURL" to handle the request from address bar.
Do you mean that I should check the url before invoking LoadURL?
Yes, do a case-insensitive match of the start of the string. You just can block "javascript:", or other things like "file:" and "mailto:" if you want. You could even just allow http:, https:, bout:blank, and URLs with no ':' character before any '?' character. That last one is to allow typing just "google.com" or "www.google.com" without http://
Users browsing this forum: No registered users and 48 guests