Convert Figma logo to code with AI

ChromeDevTools logodevtools-frontend

The Chrome DevTools UI

3,114
465
3,114
115

Top Related Projects

162,288

Visual Studio Code

The faster and smarter Debugger for Firefox DevTools 🔥🦊🛠

The faster and smarter Debugger for Firefox DevTools 🔥🦊🛠

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

88,205

JavaScript API for Chrome and Firefox

46,847

Fast, easy and reliable testing for anything that runs in a browser.

Quick Overview

ChromeDevTools/devtools-frontend is the official repository for the Chrome DevTools frontend. It contains the source code for the developer tools built into Google Chrome, allowing developers to inspect, debug, and profile web applications directly in the browser.

Pros

  • Powerful debugging and profiling capabilities for web development
  • Regularly updated with new features and improvements
  • Open-source, allowing for community contributions and customizations
  • Extensive documentation and resources available for learning and usage

Cons

  • Large codebase can be challenging to navigate for new contributors
  • Tightly coupled with Chrome, limiting cross-browser compatibility
  • Complex build process and setup for local development
  • Steep learning curve for advanced features and customizations

Code Examples

As this is not a code library but rather a development tool, code examples are not applicable in the traditional sense. However, here are some examples of how you might interact with Chrome DevTools programmatically:

// Open the Chrome DevTools programmatically
chrome.debugger.attach({tabId: tabId}, version, function() {
  if (chrome.runtime.lastError) {
    console.error(chrome.runtime.lastError.message);
    return;
  }
  console.log('Debugger attached');
});
// Execute a command in Chrome DevTools
chrome.debugger.sendCommand({tabId: tabId}, "Network.enable", {}, function() {
  if (chrome.runtime.lastError) {
    console.error(chrome.runtime.lastError.message);
    return;
  }
  console.log('Network tracking enabled');
});
// Listen for events from Chrome DevTools
chrome.debugger.onEvent.addListener(function(debuggeeId, message, params) {
  if (message == "Network.responseReceived") {
    console.log("URL:", params.response.url);
  }
});

Getting Started

To get started with Chrome DevTools development:

  1. Clone the repository:

    git clone https://github.com/ChromeDevTools/devtools-frontend.git
    
  2. Install dependencies:

    cd devtools-frontend
    npm install
    
  3. Build the project:

    npm run build
    
  4. Run the development server:

    npm run start
    
  5. Open Chrome and navigate to chrome://inspect. Click on "Open dedicated DevTools for Node" to use your local version of DevTools.

For more detailed instructions and contribution guidelines, refer to the repository's README and documentation.

Competitor Comparisons

162,288

Visual Studio Code

Pros of VS Code

  • Broader scope: VS Code is a full-featured IDE, while DevTools Frontend is specifically for browser debugging
  • Extensive ecosystem: Larger community and more extensions available
  • Cross-platform: Works on multiple operating systems, not just within Chrome

Cons of VS Code

  • Heavier resource usage: Requires more system resources compared to DevTools Frontend
  • Steeper learning curve: More features can mean a longer time to master all functionalities
  • Less integrated with web browsers: DevTools Frontend has tighter integration with Chrome

Code Comparison

VS Code (settings.json):

{
  "editor.fontSize": 14,
  "editor.wordWrap": "on",
  "files.autoSave": "afterDelay"
}

DevTools Frontend (devtools_app.js):

Runtime.experiments.isEnabled('sourcesPrettyPrint')
UI.inspectorView.showPanel('sources')
Workspace.workspace.project().uiSourceCodes()

Both projects use TypeScript and have a modular architecture, but VS Code's codebase is larger and more complex due to its broader scope. DevTools Frontend focuses on browser-specific debugging features, while VS Code provides a more general-purpose development environment.

The faster and smarter Debugger for Firefox DevTools 🔥🦊🛠

Pros of debugger

  • More focused and specialized for debugging JavaScript
  • Lighter weight and potentially faster to load
  • Easier to contribute to due to smaller codebase

Cons of debugger

  • Less comprehensive feature set compared to devtools-frontend
  • Smaller community and potentially slower development pace
  • Limited to Firefox, while devtools-frontend works across Chromium-based browsers

Code Comparison

debugger:

export function getSelectedSource(state: OuterState) {
  return state.sources.selectedSource;
}

devtools-frontend:

export function getSelectedSource(state) {
  return state.debugger.selectedSource;
}

Both repositories use similar patterns for state management, but devtools-frontend tends to have more complex structures due to its broader scope. The debugger project often has more focused, single-purpose functions, while devtools-frontend may include additional logic and checks within similar functions.

Overall, debugger is a more specialized tool for JavaScript debugging in Firefox, while devtools-frontend offers a comprehensive suite of development tools for Chromium-based browsers. The choice between them depends on the specific browser ecosystem and development needs.

The faster and smarter Debugger for Firefox DevTools 🔥🦊🛠

Pros of debugger

  • More focused and specialized for debugging JavaScript
  • Lighter weight and potentially faster to load
  • Easier to contribute to due to smaller codebase

Cons of debugger

  • Less comprehensive feature set compared to devtools-frontend
  • Smaller community and potentially slower development pace
  • Limited to Firefox, while devtools-frontend works across Chromium-based browsers

Code Comparison

debugger:

export function getSelectedSource(state: OuterState) {
  return state.sources.selectedSource;
}

devtools-frontend:

export function getSelectedSource(state) {
  return state.debugger.selectedSource;
}

Both repositories use similar patterns for state management, but devtools-frontend tends to have more complex structures due to its broader scope. The debugger project often has more focused, single-purpose functions, while devtools-frontend may include additional logic and checks within similar functions.

Overall, debugger is a more specialized tool for JavaScript debugging in Firefox, while devtools-frontend offers a comprehensive suite of development tools for Chromium-based browsers. The choice between them depends on the specific browser ecosystem and development needs.

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

Pros of Playwright

  • Cross-browser support: Works with Chromium, Firefox, and WebKit
  • Powerful API for automation and testing across multiple browsers
  • Auto-wait functionality for improved test reliability

Cons of Playwright

  • Steeper learning curve compared to DevTools Frontend
  • Requires separate installation and setup

Code Comparison

DevTools Frontend (Chrome-specific):

chrome.debugger.sendCommand({tabId: tabId}, "Network.enable", {}, callback);

Playwright (Cross-browser):

const browser = await playwright.chromium.launch();
const page = await browser.newPage();
await page.route('**/*', route => route.continue());

Key Differences

  • DevTools Frontend is specifically for Chrome DevTools, while Playwright is a general-purpose browser automation tool
  • Playwright offers cross-browser support, whereas DevTools Frontend is Chrome-centric
  • DevTools Frontend provides a GUI for debugging, while Playwright focuses on programmatic control and testing

Use Cases

  • DevTools Frontend: Chrome extension development, Chrome-specific debugging
  • Playwright: Cross-browser testing, web scraping, automated UI testing

Community and Support

Both projects have active communities, but Playwright's broader scope may lead to more diverse contributions and use cases.

88,205

JavaScript API for Chrome and Firefox

Pros of Puppeteer

  • High-level API for browser automation and testing
  • Supports headless and non-headless modes for Chrome and Firefox
  • Extensive documentation and active community support

Cons of Puppeteer

  • Limited to Chromium-based browsers and Firefox
  • Requires Node.js environment to run
  • Can be resource-intensive for large-scale automation tasks

Code Comparison

Puppeteer:

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'screenshot.png'});
await browser.close();

DevTools Frontend:

const target = await chrome.devtools.inspectedWindow.eval('window.location.href');
chrome.devtools.inspectedWindow.reload();
chrome.devtools.panels.create('My Panel', 'icon.png', 'panel.html', (panel) => {
  // Panel created
});

Key Differences

  • Puppeteer focuses on browser automation and testing, while DevTools Frontend is for building Chrome DevTools extensions and panels
  • Puppeteer operates externally, controlling the browser, while DevTools Frontend works within the browser's developer tools
  • Puppeteer is more versatile for general web automation tasks, while DevTools Frontend is specialized for debugging and development workflows

Use Cases

  • Puppeteer: Web scraping, automated testing, generating PDFs, pre-rendering SPAs
  • DevTools Frontend: Creating custom debugging tools, extending Chrome DevTools functionality, building specialized developer panels
46,847

Fast, easy and reliable testing for anything that runs in a browser.

Pros of Cypress

  • Easier to set up and use for end-to-end testing
  • Provides a more user-friendly interface for test writing and debugging
  • Offers real-time reloading and automatic waiting for elements

Cons of Cypress

  • Limited to testing web applications only
  • Lacks support for multi-tab testing
  • Has a steeper learning curve for developers new to end-to-end testing

Code Comparison

DevTools Frontend (JavaScript):

function formatDisplayName(node) {
  const name = node.nodeNameInCorrectCase();
  if (node.pseudoType())
    return '::' + node.pseudoType();
  return name;
}

Cypress (JavaScript):

Cypress.Commands.add('login', (email, password) => {
  cy.visit('/login')
  cy.get('#email').type(email)
  cy.get('#password').type(password)
  cy.get('button[type="submit"]').click()
})

The DevTools Frontend code focuses on DOM manipulation and inspection, while Cypress code demonstrates its intuitive syntax for creating custom commands and interacting with web elements. DevTools Frontend is more suited for browser debugging and performance analysis, whereas Cypress excels in automated testing scenarios.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Chrome DevTools frontend

npm package

The client-side of the Chrome DevTools, including all TypeScript & CSS to run the DevTools webapp.

Source code and documentation

The frontend is available on chromium.googlesource.com. Check out the Chromium DevTools documentation for instructions to set up, use, and maintain a DevTools front-end checkout, as well as design guidelines, and architectural documentation.

Source mirrors

DevTools frontend repository is mirrored on GitHub.

DevTools frontend is also available on NPM as the chrome-devtools-frontend package. It's not currently available via CJS or ES modules, so consuming this package in other tools may require some effort.

The version number of the npm package (e.g. 1.0.373466) refers to the Chromium commit position of latest frontend git commit. It's incremented with every Chromium commit, however the package is updated roughly daily.

Getting in touch

There are a few options to keep an eye on the latest and greatest of DevTools development: