-
Notifications
You must be signed in to change notification settings - Fork 181
CEF Debugging
CEF keeps several stable branches going in parallel. In a CEF version number like 3.1547.1459
, 1547
is the branch number and 1459
is the SVN revision number (which increments when any branch is updated). These numbers are not connected to the Chromium version number.
Look in brackets-shell/Gruntfile.js and find the "cef": { "version" : "...." }
declaration (near bottom).
- For a running copy of Brackets -- Type
navigator.userAgent
in Brackets dev tools. The section likeChrome/39.0.2171.36
is the Chromium version. - Otherwise -- Look up the CEF version number at http://cefbuilds.com/ (or https://code.google.com/p/chromiumembedded/wiki/BranchesAndBuilding)
When issues appear with a new version of CEF, it can be hard to tell is the issue is due to CEF, Chromium, or some other factor. One way to find out is to run the same code in different environments:
This lets you compare simple testcases (such as a JSFiddle, or a CodeMirror demo page) in Chrome vs. brackets-shell.
- In dev tools, run
window.location="..."
- Compare to the same URL running in Chrome
This lets you compare most of Brackets core in Chrome vs. brackets-shell.
- Checkout the
pflynn/in-browser-file-system
branch - Point a simple local webserver (like serf) at the Brackets
src
folder. - First, verify that this still repros the issue in brackets-shell: run
window.location="localhost:8080/index.html"
in dev tools to load this in brackets-shell - Next, load
localhost:8080/src/index.html
in Chrome also
"cefclient" is a bare-bones reference app that uses CEF. This lets you see if a bug is due to brackets-shell customizations vs. core CEF.
- Go to http://cefbuilds.com/
- Find the exact version of CEF that matches the version Brackets is integrating (you may have to click the gray "More revisions" link)
- Click the "Test App" link to download the matching cefclient build
- Unzip and run (no installer needed). Now you can...
- Compare a simple testcase in cefclient vs. Chrome, or cefclient vs. brackets-shell (similar to "Loading other webpages in brackets-shell" above)
- Compare Brackets in-browser in cefclient vs. Chrome, or cefclient vs. brackets-shell (similar to "Running Brackets outside brackets-shell" above)
Note: your version of cefclient will rarely be an exact match for the current stable version of Chrome, so this isn't a perfect test (there are two variables that differ: CEF vs. Chrome, and Chromium version slightly differs).
Brackets-shell doesn't configure CEF/Chromium engine exactly the same as a normal browser does. For example, GPU acceleration is disabled and on some OSes process security sandboxing is also disabled.
For testing, you can launch Chrome with flags to make it behave more like brackets-shell:
- Create an empty folder somewhere on disk to act as a throwaway Chrome user profile
- On the command prompt, run:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir=<<absolute path to empty folder>> <<add extra flags here>>
-or-
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=<<absolute path to empty folder>> <<add extra flags here>>
- This will not interfere with your normal running copy of Chrome
Some useful options:
- Disable GPU acceleration:
--disable-gpu
- Disable process sandboxing:
--no-sandbox
Full list of options: http://peter.sh/experiments/chromium-command-line-switches/ (updated in sync with Chromium source)