Skip to content

How to disable loading of images? #13

Answered by daijro
tobwen asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

The most effective way to block images is through the permissions.default.image Firefox preference:
https://kb.mozillazine.org/Permissions.default.image

with Camoufox(
    headless=False,
    firefox_user_prefs={
        "permissions.default.image": 2,
    }
) as browser:
    page = browser.new_page()
    page.goto("https://www.pexels.com/")

Edit: As of v0.1.3, you can now also pass block_images=True:

with Camoufox(
    headless=False,
    block_images=True
) as browser:
    page = browser.new_page()
    page.goto("https://www.pexels.com/")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by daijro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants