Chromium settings in headless mode

3,784 views
Skip to first unread message

xivan...@gmail.com

unread,
Mar 9, 2017, 5:10:57 AM3/9/17
to headless-dev
Hello, 

i'm trying to turn off images loading through Chromium settings (chrome://settings).
Is it possible to use this settings with --headless flag?

I have tried the following, but got no success:
1. Make empty dir
2. Run Chromium UI with --user-data-dir key referring to dir from p1
3. Configure something through chrome://settings (in my case it was Advanced -> Content Settings -> Images -> Do not show any images = True)
4. Run Chromium in headless mode with same --user-data-dir
5. Load some page (chrome debugging api in my case), observe that images still loading (tcpdump)


Tested on Linux Chromium 58.0.3029.0.

Eric Seckler

unread,
Mar 9, 2017, 5:50:56 AM3/9/17
to xivan...@gmail.com, headless-dev
Such settings are not supported in headless mode at the moment. (This is because the headless architecture is based on the content layer and does not include embedder-specific functionality from chrome.)

Alex mentioned here that you could alternatively use a custom proxy or C++ protocol handlers to block images. We are also thinking about adding functionality to DevTools that would allow blocking resources.

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/6df98693-a55c-440c-90b7-086afec17227%40chromium.org.

Sami Kyostila

unread,
Mar 9, 2017, 7:25:53 AM3/9/17
to Eric Seckler, xivan...@gmail.com, headless-dev

xivan...@gmail.com

unread,
Mar 10, 2017, 12:11:43 AM3/10/17
to headless-dev, esec...@chromium.org, xivan...@gmail.com, skyo...@google.com
Guys, thank you for explanations and suggestions.

I have overridden corresponding setting with --blink-settings=imagesEnabled=false command line argument and it just works.

However "imagesEnabled" functionality is not generic, it would be nice if there will be some way to block resources using debugging api.
For an instance "ads blocking" case requires more control over network requests.

Alex Clarke

unread,
Mar 10, 2017, 3:32:03 AM3/10/17
to xivan...@gmail.com, headless-dev, Eric Seckler, Sami Kyostila
On 10 March 2017 at 05:11, <xivan...@gmail.com> wrote:
Guys, thank you for explanations and suggestions.

I have overridden corresponding setting with --blink-settings=imagesEnabled=false command line argument and it just works.

However "imagesEnabled" functionality is not generic, it would be nice if there will be some way to block resources using debugging api.

This is a common request. We're thinking about adding some devtools commands to allow fine grained blocking and modification of requests. Or plans need a little more time to bake,  but later I hope to post a link to a design doc and tracking bug.

 
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.

To post to this group, send email to headle...@chromium.org.

Georgios Diamantopoulos

unread,
Mar 10, 2017, 10:58:53 AM3/10/17
to headless-dev, xivan...@gmail.com, esec...@chromium.org, skyo...@google.com
In the meantime, how would one go about overriding network request "stuff"?

Sami Kyostila

unread,
Mar 10, 2017, 12:06:45 PM3/10/17
to Georgios Diamantopoulos, headless-dev, xivan...@gmail.com, esec...@chromium.org
Reply all
Reply to author
Forward
0 new messages