Custom.css support Custom.css been removed from Chrome in version 32.
This answer provides two ways to easily activate style sheets in developer tools. The second method is recommended, but works only for Chrome 33+, the first method also works for Chrome 32.
Both methods are Chrome extensions, to use the examples below, follow these steps:
- Create a directory and put the following files in it.
- Go to
chrome://extensions - Select "Developer Mode"
- Click Download Unpacked Extension
- Select the directory you just created.
True emulation Custom.css
This section uses one of the two methods described in How to embed javascript in Chrome DevTools itself . This extension can be easily generalized to fully emulate Custom.css, i.e. Activate a stylesheet on each page, for example Custom.css.
Note. If you use Chrome 33+, I highly recommend this method in the next section.
manifest.json
{ "content_scripts": [{ "js": [ "run_as_devtools.js" ], "matches": [ "<all_urls>" ] }], "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4r/pUHVPYQTn7vu3YHT52I0SKM15OBOTi0Jii4q5Koxd3Gdc/WXdqC2YgMA25J5PRiSubu/nHFf12Ubp3OZyNqB3j45ZscQ+tH1bwcV+cqdvv/Ik6VQaS6/qLmenLdFPKOCg/g1L1iKZu6Jjny6GlovpBj+7gjWQZBIoGBd70HQIDAQAB", "manifest_version": 2, "name": "Emulate Custom.css", "version": "1.0", "web_accessible_resources": [ "Custom.css" ] } / WXdqC2YgMA25J5PRiSubu / nHFf12Ubp3OZyNqB3j45ZscQ + tH1bwcV + cqdvv / Ik6VQaS6 / qLmenLdFPKOCg / g1L1iKZu6Jjny6GlovpBj + 7gjWQZBIoGBd70HQIDAQAB", { "content_scripts": [{ "js": [ "run_as_devtools.js" ], "matches": [ "<all_urls>" ] }], "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4r/pUHVPYQTn7vu3YHT52I0SKM15OBOTi0Jii4q5Koxd3Gdc/WXdqC2YgMA25J5PRiSubu/nHFf12Ubp3OZyNqB3j45ZscQ+tH1bwcV+cqdvv/Ik6VQaS6/qLmenLdFPKOCg/g1L1iKZu6Jjny6GlovpBj+7gjWQZBIoGBd70HQIDAQAB", "manifest_version": 2, "name": "Emulate Custom.css", "version": "1.0", "web_accessible_resources": [ "Custom.css" ] }
run_as_devtools.js
if (location.protocol === 'chrome-devtools:') (function() { 'use strict'; var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = chrome.runtime.getURL('Custom.css'); document.head.appendChild(l); })();
custom.css
The official method (Chrome 33+ only)
If you want to customize the devtools style, you need to use chrome.devtools.panels.applyStyleSheet . This function is currently hidden behind the flag ( --enable-devtools-experiments , Chrome restart required) and the checkbox (after turning on the flag, open devtools, click the gear icon, go to Experiments and check the box "Allow user interface themes").
manifest.json
{ "name": "<name> DevTools Theme", "version": "1", "devtools_page": "devtools.html", "manifest_version": 2 }
devtools.html
<script src="devtools.js"></script>
devtools.js
var x = new XMLHttpRequest(); x.open('GET', 'Custom.css'); x.onload = function() { chrome.devtools.panels.applyStyleSheet(x.responseText); }; x.send();
custom.css
For more information, see https://code.google.com/p/chromium/issues/detail?id=318566