dylanede / cefpython

Automatically exported from code.google.com/p/cefpython
0 stars 0 forks source link

Add Browser.IsDevTools() #169

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There should be a way to differentiate if a browser is a Developer Tools 
window. For example in LoadHandler.OnLoadStart() we're executing app specific 
code and when Browser.ShowDevTools() is called this will result in OnLoadStart 
being called for developer tools window as well.

In the meantime use this code to detect if this is a DevTools browser:

  if re.search(r"^http://127\.0\.0\.1:\d+/devtools/devtools\.html",
               frame.GetUrl()):

Original issue reported on code.google.com by czarek.t...@gmail.com on 21 Jan 2015 at 11:00

GoogleCodeExporter commented 9 years ago
Exposing Browser.GetDevToolsUrl() is not a good idea, as this method was 
removed in newer CEF branches. The devtools url doesn't contain specific ID for 
a frame and is in a form like "chrome-devtools://localhost/devtools.html". For 
an explanation see http://magpcss.org/ceforum/viewtopic.php?f=6&t=11724 and 
https://code.google.com/p/chromium/issues/detail?id=308281

Original comment by czarek.t...@gmail.com on 22 Jan 2015 at 4:38