No, google-chrome in headless mode doesn't supports extensions yet.
[email protected]
in his comment clearly mentioned:
We've decided against implementing extension support in headless mode for now because supporting all the required features is rather complex
You can find the complete analysis in Add extension support for headless chrome
[email protected]
in his comment mentioned the real time issues as:
- A lot of extension APIs are specific to non-headless browsers, so can't be supported in headless chrome.
- Of the APIs we could feasibly support, only parts are implemented in such a way that we can currently reuse them for headless chrome.
- Changing this requires a lot of refactoring that doesn't seem justified given the benefit we'd gain.
He further added,
Either way, extensions would likely have to be adapted to work with headless chrome due to (1). So even if we solved (2), most existing extensions would not be compatible. (This also renders headless chrome unsuitable for testing chrome extensions.)
Most if not all functions that extensions could provide to headless chrome can be realized via the DevTools API that headless exposes to its users. If you have a use case that isn't supported via the DevTools API, please file a feature request.
Moreover, in his comment, [email protected]
clearly mentioned:
I realize a lot of folks would like to use extensions with headless but unfortunately that's a large project which we have /no plans to do/. The problem is Headless Chromium is a content embedder which means it doesn't have access to anything from other content embedders such as chrome and unfortunately extensions are a chrome feature.
In another comment he further added, if you're using Selenium through DevTools you can build a proxy. You can filter URLs and modify headers via Network.setRequestInterception and Network.continueInterceptedRequest.