Closed IlyaHarlamov closed 1 year ago
This is actually not related to geckodriver but an issue in Firefox. geckodriver just sets the preference browser.startup.page
to 0
so that only a single tab is open with about:blank
loaded. And as it looks like this page doesn't allow to use this API.
When I start Firefox normally and set the settings under New Windows and Tabs
both to Blank Tab
, I can access the API when opening a new tab. But once I explicitly load about:blank
in that newly created tab the API is not available anymore.
@smaug---- do you have an idea why that is the case? If it's a bug I'm happy to file it but not sure where exactly right now.
Note that whenever a real page is loaded the API is available. It's just the blank page which causes the issue, and it is still reproducible in a recent Nightly build.
Hi @whimboo, hmm, I am using Selenide to run the tests, when I open a real page with it, the issue is still there... Not sure how this preference works, or maybe there is any other preference affecting this. I guess something to investigate a bit more
Ok, more information: the "real page" I am opening is hosted on the localhost. For instance, when I open google.com, the API is available, but on the localhost it is not.
UPD:
blank page isn't secure context, and randomUUID() is available on secure contexts only. See [SecureContext] annotation in https://w3c.github.io/webcrypto/#crypto-interface
Thanks @smaug---- ! Looks like we can close this issue then.
System
Testcase
crypto.randomUUUID function is not available when running Firefox 102.11.0esr with geckodriver (reproduced with 0.31.0 and 0.33.0). When trying to call the crypto.randomUUUID function from the browser console, an error "crypto.randomUUID is not a function" is returned. The function is available in the browser when running the browser manually without geckodriver.