Skip to content

WebKit doesn't appear to work with files loaded from disk #159

@simonw

Description

@simonw

I tried this:

# Different browsers
echo '<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>User Agent</title>
</head>
<body>
    <h1>Your User Agent:</h1>
    <p id="ua"></p>
    <script>
        document.getElementById("ua").textContent = navigator.userAgent;
    </script>
</body>
</html>' > user-agent.html
shot-scraper user-agent.html \
  -o examples/useragent-default-chromium.png -h 400 -w 800
shot-scraper user-agent.html \
  -o examples/useragent-firefox.png -h 400 -w 800 -b firefox
shot-scraper user-agent.html \
  -o examples/useragent-webkit.png -h 400 -w 800 -b webkit
rm user-agent.html

It passed for Chrome and Firefox but failed for WebKit:

playwright._impl._api_types.Error: A server with the specified hostname could not be found.
=========================== logs ===========================
navigating to "http://user-agent.html/", waiting until "load"
============================================================

Looks like there's a bug where WebKit doesn't correctly work with files loaded from disk.

Originally posted by @simonw in #158 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions