Open Bug 1656172 Opened 5 years ago Updated 5 years ago

Page does not load with -url command line option and fetch-EventListener

Categories

(Core :: DOM: Service Workers, defect, P5)

79 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: sebbl, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

Reproducible using Firefox 78.1.0esr or Firefox 79.0 (both x64, German, on Windows 10 1803). Not reproducible using Firefox 68.11.0esr.

  1. Create a webpage with a small service worker, listening to the fetch event
    index.html:
    <!DOCTYPE html>
    <html>
    <head>
    <title>SWTest</title>
    <script>
    navigator.serviceWorker.register('/serviceworker.js');
    </script>
    </head>
    <body>
    <h1>Page</h1>
    </body>
    </html>

serviceworker.js:
self.addEventListener('fetch', event => {
return fetch(event.request);
});

  1. Deploy the page to a (development) webserver, which serves https
  2. Open index.html via webserver in Firefox and acknowledge certificate warnings, if using a self signed certificate
  3. Make sure, the Service Worker ist installed using about:debugging
  4. Close Firefox
  5. Open Firefox using PowerShell and command line options: .\firefox.exe -P "Test2" -url "https://01spapp-01v.netto.lan"

Actual results:

  • Firefox starts using the "Test2"-Profile
  • A very short loading animation is displayed, which stops nearly instantly
  • No URL is displayed in the addressbar. Just the default "Mit Google suchen oder Adresse eingeben".
  • The webpage stays blank
  • Opening Developer Tools, no requests or console errors are displayed. In fact, no code is displayed at all in "Inspector", just <html><head></head><body></body></html>
  • Using Fiddler HTTP Proxy, I can see a request to https://01spapp-01v.netto.lan/serviceworker.js with a HTTP 200 response. No other requests are made.
  • Opening the page in the same session and same tab by entering https://01spapp-01v.netto.lan in the addressbar works just fine
  • Starting firefox additionally with -jsconsole displays some seemingly unrealated warnings and errors. The first error is "STATE_IS_BROKEN without a known reason. Full state was: 67108865" in ThreadSafeDevToolsUtils.js:82:13
  • When removing the fetch-EventListener from the ServiceWorker, the page will load consistently via command line options

Expected results:

The page https://01spapp-01v.netto.lan should display a h1 "Page"(see sample code above) when starting Firefox via commandline options and using a page with a ServiceWorker and fetch-EventListener.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Service Workers
Product: Firefox → Core

I could not get ahold of Windows x64 1803, but I cannot reproduce this on 1809 with 79 or 78.0.1ESR. What I see is what is mentioned above as 'Expected result'.

Steps I followed:

  1. Install Firefox 79 and then 78.0.1ESR (after uninstalling 79).
  2. Generate certificate: openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
  3. Simple python3 script to serve the files:
import http.server, ssl

server_address = ('localhost', 4443)
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
                               server_side=True,
                               certfile='server.pem',
                               ssl_version=ssl.PROTOCOL_TLS)
httpd.serve_forever()
  1. From firefox install location: .\firefox.exe -P "Test2" -url "https://localhost:4443".
Severity: -- → S4
Priority: -- → P5

It seems this behaviour is only reproduceable at Windows 7 64Bit Machines. If you open an url where also a serviceworker is registered with the command line like: firefox.exe -url "https://twitter.com" than it can be that the page isnt loaded when you have already this service-worker installed. But if you call an html page before and redirect after 3seconds with javascript than it works always. Perhaps the BrowserAPIs aren't loaded correctly at this point?

Systeminformation:
Element Wert
Betriebssystemname Microsoft Windows 7 Professional
Version 6.1.7601 Service Pack 1 Build 7601
Zusätzliche Betriebssystembeschreibung Nicht verfügbar
Betriebssystemhersteller Microsoft Corporation
Systemname 009944-10
Systemhersteller Dell Inc.
Systemmodell OptiPlex 9020
Systemtyp x64-basierter PC
Prozessor Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 3301 MHz, 4 Kern(e), 4 logische(r) Prozessor(en)
BIOS-Version/-Datum Dell Inc. A24, 24.10.2018
SMBIOS-Version 2.7
Windows-Verzeichnis C:\Windows
Systemverzeichnis C:\Windows\system32
Startgerät \Device\HarddiskVolume1
Gebietsschema Deutschland
Hardwareabstraktionsebene Version = "6.1.7601.24545"
Benutzername --
Zeitzone Mitteleuropäische Zeit
Installierter physikalischer Speicher (RAM) 4,00 GB
Gesamter realer Speicher 3,91 GB
Verfügbarer realer Speicher 364 MB
Gesamter virtueller Speicher 7,82 GB
Verfügbarer virtueller Speicher 2,73 GB
Größe der Auslagerungsdatei 3,91 GB
Auslagerungsdatei C:\pagefile.sys

You need to log in before you can comment on or make changes to this bug.