이 문서에서는 Maps JavaScript API의 웹사이트 콘텐츠 보안 정책(CSP)을 구성하는 방법에 관한 권장사항을 제공합니다. 최종 사용자는 다양한 브라우저 유형과 버전을 사용하므로 개발자는 이 예를 참고하여 추가 CSP 위반이 발생하지 않도록 세부적으로 조정하는 것이 좋습니다.
허용 목록 CSP 대신 엄격한 CSP를 사용하여 보안 공격의 가능성을 줄이는 것이 좋습니다.
Maps JavaScript API는 nonce 기반의 엄격한 CSP 사용을 지원합니다.
웹사이트는 script 및 style 요소를 모두 nonce 값으로 채워야 합니다.
내부적으로 Maps JavaScript API는 이러한 첫 번째 요소를 찾아 API 스크립트에서 삽입한 스타일 또는 스크립트 요소에 nonce 값을 각각 적용합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis document provides recommendations for configuring Content Security Policy (CSP) when using the Maps JavaScript API to ensure compatibility across various browsers.\u003c/p\u003e\n"],["\u003cp\u003eAll websites must specify \u003ccode\u003egoogleapis.com\u003c/code\u003e in their CSP directives by Q2 2023 for the Maps JavaScript API to function correctly.\u003c/p\u003e\n"],["\u003cp\u003eStrict CSP with nonce-based implementation is the recommended approach for enhanced security, requiring websites to add nonce values to \u003ccode\u003escript\u003c/code\u003e and \u003ccode\u003estyle\u003c/code\u003e elements.\u003c/p\u003e\n"],["\u003cp\u003eAllowlist CSP, while supported, requires referencing Google Maps Domains documentation and release notes to keep the allowlist current with new domains.\u003c/p\u003e\n"]]],["Developers should configure their website's Content Security Policy (CSP) for the Maps JavaScript API. Using strict CSP with nonce values for `script` and `style` elements is recommended. Websites must include `googleapis.com` in CSP directives, especially after Q2 2023. The API will apply the first found nonce to its inserted elements. Allowlist CSP users need to consult the list of Google Maps Domains and include any new domains, especially legacy or region-specific ones, in `script-src`.\n"],null,[]]