Web Security · Junior · Question 14 of 75
What is a secure context in the browser?
- 1A browser tab in incognito mode
- ✓Correct answer: A page delivered over HTTPS (or from localhost), where powerful APIs like geolocation or service workers are allowed
- 3A page that runs inside a sandboxed iframe
Explanation
Many APIs require a secure context because a network attacker could otherwise abuse them. window.isSecureContext tells you if the current page qualifies.