-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.isSecureContext is false on localhost in forefox #18217
Comments
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
I was facing this problem as well with following setup (Cypress 12, Node 18, Firefox 112) Like the author of the issue I managed to break the problem down to the fact that we use webCryptoAPI to generate a auth session token which is encrytped. (keyword: HKDF) Although I cannot fully explain why, but this helped me, and maybe others. I encountered another problem when I used http://localhost:3000 as baseUrl in combination with an api mock server. Best guess that my problem has something to do with the Node17/18 DNS resolving changes in combination of ipv4 and ipv6 other issue. Running e2e.baseUrl on http://localhost:3000 I got for window.isSecureContext = false // cypress.config.ts
import { defineConfig } from 'cypress'
export default defineConfig({
experimentalWebKitSupport: true,
modifyObstructiveCode: false,
e2e: {
baseUrl: 'http://127.0.0.1:3000',
chromeWebSecurity: false,
viewportHeight: 1080,
viewportWidth: 1920,
supportFile: './cypress/support/index.ts',
}
}) |
I believe this is due to us setting
|
A workaround in Firefox is this undocumented config flag: This seems to work:
|
Current behavior
When running tests in firefox
localhost
is not treated as secure contextDesired behavior
When running tests in firefox
localhost
should be treated as secure context:Test code to reproduce
https://github.com/marek-saji/cypress-bug-firefox-localhost-secure
Cypress Version
8.4.1
Other
I’m using web crypto API, which requires secure context.
I figured that it seems like something in firefox profile cypress is using. I ran firefox with same parameters that cypress does, sans
-profile
:and
isSecureContext
on localhost istrue
, but when I add:(and disable proxying in settings) it’s
false
.The text was updated successfully, but these errors were encountered: