{"json_modified": "2016-08-30T21:07:00.867580", "uuid": "341b3483-70be-49fb-bd46-9153d47bdadf", "title": "window.postMessage", "url": "/ja/docs/Web/API/Window/postMessage", "tags": ["DOM", "Gecko"], "translations": [{"uuid": "46aa6d00-a137-462a-88eb-279aaaca588b", "title": "Window.postMessage()", "url": "/en-US/docs/Web/API/Window/postMessage", "tags": ["R\u00e9f\u00e9rence", "Reference", "DOM", "API", "Method"], "summary": "The window.postMessage
method safely enables cross-origin communication. Normally, scripts on different pages are allowed to access each other if and only if the pages that executed them are at locations with the same protocol (usually both https
), port number (443
being the default for https
), and host (modulo document.domain being set by both pages to the same value). window.postMessage
provides a controlled mechanism to circumvent this restriction in a way which is secure when properly used.", "localization_tags": [], "locale": "en-US", "last_edit": "2015-12-22T22:01:58", "review_tags": ["technical"]}, {"uuid": "52e8b028-d5ca-444c-a196-21313d228cd1", "title": "window.postMessage", "url": "/zh-CN/docs/Web/API/Window/postMessage", "tags": ["\u53c2\u8003", "API", "DOM", "\u65b9\u6cd5"], "summary": "window.postMessage
\u662f\u4e00\u4e2a\u5b89\u5168\u7684\u8de8\u6e90\u901a\u4fe1\u7684\u65b9\u6cd5\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5f53\u4e14\u4ec5\u5f53\u6267\u884c\u811a\u672c\u7684\u9875\u9762\u4f7f\u7528\u76f8\u540c\u7684\u534f\u8bae\uff08\u901a\u5e38\u90fd\u662f http\uff09\u3001\u76f8\u540c\u7684\u7aef\u53e3\uff08http\u9ed8\u8ba4\u4f7f\u752880\u7aef\u53e3\uff09\u548c\u76f8\u540c\u7684 host\uff08\u4e24\u4e2a\u9875\u9762\u7684 document.domain \u7684\u503c\u76f8\u540c\uff09\u65f6\uff0c\u624d\u5141\u8bb8\u4e0d\u540c\u9875\u9762\u4e0a\u7684\u811a\u672c\u4e92\u76f8\u8bbf\u95ee\u3002 window.postMessage
\u63d0\u4f9b\u4e86\u4e00\u4e2a\u53ef\u63a7\u7684\u673a\u5236\u6765\u5b89\u5168\u5730\u7ed5\u8fc7\u8fd9\u4e00\u9650\u5236\uff0c\u5f53\u5176\u5728\u6b63\u786e\u4f7f\u7528\u7684\u60c5\u51b5\u4e0b\u3002", "localization_tags": ["inprogress"], "locale": "zh-CN", "last_edit": "2016-08-17T17:48:08", "review_tags": ["editorial"]}, {"uuid": "807d07ee-70cf-4e27-905a-fa76e2d6d12a", "title": "Window.postMessage", "url": "/fr/docs/Web/API/Window/postMessage", "tags": ["API", "Reference", "Methode", "R\u00e9f\u00e9rence", "DOM", "M\u00e9thode"], "summary": "La m\u00e9thode window.postMessage
permet une communication inter-domaine en toute s\u00e9curit\u00e9. Normalement, les scripts de diff\u00e9rentes pages sont autoris\u00e9s \u00e0 acc\u00e9der les uns aux autres si et seulement si les pages depuis lesquelles ils sont ex\u00e9cut\u00e9s ont des URL de m\u00eame origine, c'est-\u00e0-dire avec le m\u00eame protocole (g\u00e9n\u00e9ralement http
ou https
), le m\u00eame num\u00e9ro de port (80
\u00e9tant le port par d\u00e9faut pour\u00a0 http
), et le m\u00eame nom d'h\u00f4te (\u00e0 condition que document.domain soit initialis\u00e9 \u00e0 la m\u00eame valeur par les deux pages). window.postMessage
fournit un m\u00e9canisme contr\u00f4l\u00e9 pour contourner cette restriction d'une mani\u00e8re s\u00e9curis\u00e9e si bien utilis\u00e9e.", "localization_tags": [], "locale": "fr", "last_edit": "2015-03-19T05:06:09", "review_tags": []}], "modified": "2016-08-30T21:07:00", "label": "window.postMessage", "localization_tags": [], "locale": "ja", "id": 2776, "last_edit": "2016-08-30T21:06:54", "summary": "window.postMessage
\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u3068\u304d\u3001MessageEvent \u3092\u5bfe\u8c61\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u4f1d\u9054\u3057\u3001\u305d\u306e\u3068\u304d\u3001\u5b9f\u884c\u3055\u308c\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u4efb\u610f\u306e\u4fdd\u7559\u4e2d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u5b8c\u4e86\u3057\u307e\u3059\uff08\u4f8b\u3048\u3070\u3001window.postMessage
\u304c\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u304b\u3089\u547c\u3070\u308c\u305f\u5834\u5408\u30a4\u30d9\u30f3\u30c8\u30cf\u30f3\u30c9\u30e9\u306e\u5b58\u7d9a\u3001\u4ee5\u524d\u306b\u8a2d\u5b9a\u3055\u308c\u305f\u4fdd\u7559\u4e2d\u306e\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3001\u306a\u3069\uff09\u3002 MessageEvent \u306b\u306f message
\u3068\u3044\u3046\u578b\u3001window.postMessage
\u306b\u4e0e\u3048\u3089\u308c\u308b\u7b2c\u4e00\u5f15\u6570\u306e\u6587\u5b57\u5217\u306e\u5024\u306b\u8a2d\u5b9a\u3055\u308c\u308b data
\u30d7\u30ed\u30d1\u30c6\u30a3\u3001 window.postMessage
\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u3068\u304d\u3001window.postMessage
\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u30a6\u30a3\u30f3\u30c9\u30a6\u5185\u306e\u30e1\u30a4\u30f3\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u751f\u6210\u5143\u306b\u5bfe\u5fdc\u3059\u308b origin
\u30d7\u30ed\u30d1\u30c6\u30a3\u3001window.postMessage
\u3092\u547c\u3073\u51fa\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u3042\u308b source
\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u3042\u308a\u307e\u3059\u3002\uff08\u4ed6\u306e\u30a4\u30d9\u30f3\u30c8\u306e\u6a19\u6e96\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u305d\u308c\u3089\u306e\u671f\u5f85\u3055\u308c\u308b\u5024\u3067\u5b58\u5728\u3057\u307e\u3059\uff09", "sections": [{"id": "Quick_Links", "title": null}, {"id": "Summary", "title": "\u6982\u8981"}, {"id": "Syntax", "title": "\u69cb\u6587"}, {"id": "The_dispatched_event", "title": "\u4f1d\u9054\u3055\u308c\u308b\u30a4\u30d9\u30f3\u30c8"}, {"id": "Security_concerns", "title": "\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u95a2\u3059\u308b\u3053\u3068"}, {"id": "Example", "title": "\u4f8b"}, {"id": "Notes", "title": "\u6ce8\u8a18"}, {"id": "Specification", "title": "\u4ed5\u69d8"}, {"id": "See_also", "title": "\u95a2\u9023\u60c5\u5831"}], "slug": "Web/API/Window/postMessage", "review_tags": []}