Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use Chrome Experimental Devtools API

I'm trying to use the Chrome Experimental Devtools API.

I've tried running Chrome with: --enable-experimental-extension-apis as suggested here: http://developer.chrome.com/extensions/experimental.html and enabled the "Experimental Extension APIs" in the flags settings.

When I open the Console in Chrome (or Canary), I get the following:

  • chrome.devtools: undefined
  • chrome.experimental: undefined

I'm running Chrome 21.0.1180.77 beta-m. I've also tried Canary.

What am I missing?

like image 333
Martin Avatar asked Dec 05 '25 10:12

Martin


1 Answers

As explained here: http://developer.chrome.com/extensions/devtools.html, the chrome.devtools APIs are only available in your devtools HTML page.

First, you need to create an HTML file and then add it to your extension's manifest under the "devtools_page" key. When you load your extension into Chrome and open the DevTools, you should see your new tab.

In that tab is the only place chrome.devtools will work.

chrome.experimental is different and will be available in all of your background pages and content scripts.

like image 104
James deBoer Avatar answered Dec 08 '25 10:12

James deBoer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!