{"id":13870,"date":"2021-07-31T10:36:38","date_gmt":"2021-07-31T01:36:38","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=13870"},"modified":"2023-05-28T08:00:46","modified_gmt":"2023-05-27T23:00:46","slug":"%e3%80%90web%e3%80%91%e5%90%8c%e4%b8%80%e7%94%9f%e6%88%90%e5%85%83%e3%83%9d%e3%83%aa%e3%82%b7%e3%83%bcsop%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=13870","title":{"rendered":"\u3010Web\u3011\u540c\u4e00\u751f\u6210\u5143\u30dd\u30ea\u30b7\u30fc(SOP)\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u30aa\u30ea\u30b8\u30f3\u3068\u306f\uff1f<\/h2>\n<p>URL\u306e\u3053\u3068\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001\u30b9\u30ad\u30fc\u30e0\uff08http\u306a\u3069\uff09\u3001\u30db\u30b9\u30c8\u540d\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u3068\u3044\u30463\u3064\u306e\u5024\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u3053\u3068\u3067\u3059\u3002(RFC 6454\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002)<\/p>\n<h2>\u30aa\u30ea\u30b8\u30f3\u9593\u306e\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\u306e\u7a2e\u985e<\/h2>\n<h3>\u30ea\u30bd\u30fc\u30b9\u306e\u30d6\u30e9\u30a6\u30b6\u5185\u30a2\u30af\u30bb\u30b9<\/h3>\n<p>Fetch API\u306a\u3069\u3067\u30ea\u30bd\u30fc\u30b9\u306e\u4e2d\u8eab\u306e\u64cd\u4f5c\u3084\u3001\u30a6\u30a4\u30f3\u30c9\u30a6\u3078\u3092\u7d4c\u7531\u3057\u305fDOM\u64cd\u4f5c\u306a\u3069\u3002<\/p>\n<h3>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u306e\u30a2\u30af\u30bb\u30b9<\/h3>\n<p>FetchAPI\u306a\u3069\u306b\u3088\u308bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u95a2\u3057\u3066\u306f\u4e00\u5b9a\u306e\u5236\u9650\u304c\u306a\u3055\u308c\u308b\u3079\u304d\u3002<\/p>\n<h4>a\u30bf\u30b0\u3084form\u30bf\u30b0\u306b\u3088\u308b\u30da\u30fc\u30b8\u9077\u79fb\uff08\u5358\u7d14\u30ea\u30af\u30a8\u30b9\u30c8\uff09<\/h4>\n<p>Web\u306e\u767b\u5834\u5f53\u521d\u304b\u3089\u5b58\u5728\u3057\u307e\u3057\u305f\u3002<span style=\"color: #ff0000;\"><strong>\u3053\u308c\u306fWeb\u306e\u57fa\u672c\u7684\u306a\u5229\u7528\u306b\u95a2\u308f\u308b\u3053\u3068\u306a\u306e\u3067\u3001\u57fa\u672c\u306f\u5236\u9650\u306f\u3057\u306a\u3044\u3002<\/strong><\/span><\/p>\n<h4>FetchAPI\u3084XHR\u306b\u3088\u308bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\uff08\u5358\u7d14\u3067\u306f\u306a\u3044\u30ea\u30af\u30a8\u30b9\u30c8\uff09<\/h4>\n<p>\u3053\u308c\u306f\u4e00\u5b9a\u306e\u5236\u9650\u3092\u8ab2\u3059\u3079\u304d\u3067\u3059\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u6bd4\u8f03\u7684\u6700\u8fd1\u51fa\u3066\u304d\u305f\u6280\u8853\u306a\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u3053\u3046\u3044\u3046\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u6765\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u306a\u3044\u30b5\u30a4\u30c8\u3082\u3042\u308b\u305f\u3081<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h3>\u57cb\u3081\u8fbc\u307f<\/h3>\n<h4>&lt;iframe&gt;\u3084&lt;img&gt;\u30bf\u30b0\u306b\u3088\u308b\u30da\u30fc\u30b8\u5185\u3078\u306e\u30ea\u30bd\u30fc\u30b9\u57cb\u3081\u8fbc\u307f<\/h4>\n<p>\u591a\u5c11\u306f\u8105\u5a01\u306f\u3042\u308b\u3082\u306e\u306e\u300c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u306e\u30a2\u30af\u30bb\u30b9\u300d\u306b\u6bd4\u3079\u305f\u3089\u88ab\u5bb3\u306f\u5c11\u306a\u3044\u3002<\/p>\n<h2>\u540c\u4e00\u751f\u6210\u5143\u30dd\u30ea\u30b7\u30fc(SOP)<\/h2>\n<p><span style=\"color: #ff0000;\"><strong>\u30d6\u30e9\u30a6\u30b6\u304c\u6301\u3063\u3066\u3044\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u30c1\u30a7\u30c3\u30af\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u5834\u5408\u306f<span style=\"color: #ff0000;\"><strong>\u300c\u540c\u4e00\u751f\u6210\u5143\u306e\u30a2\u30af\u30bb\u30b9(Same-Origin)\u300d<\/strong><\/span>\u3068\u307f\u306a\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30db\u30b9\u30c8\u540d<\/li>\n<li>\u30b9\u30ad\u30fc\u30e0\uff08HTTP\u306a\u3069\uff09<\/li>\n<li>\u30dd\u30fc\u30c8\u756a\u53f7<\/li>\n<\/ul>\n<p>\u4e00\u65b9\u4e0a\u8a18\u3044\u305a\u308c\u304b\u304c\u7570\u306a\u308b\u5834\u5408\u306f\u300cCross-Origin\u300d\u3067\u3042\u308b\u3068\u3044\u3044\u307e\u3059\u3002<\/p>\n<h3>SOP\u4e0b\u3067\u306e\u64cd\u4f5c\u5236\u9650<\/h3>\n<table style=\"width: 600px;\">\n<tbody>\n<tr>\n<th style=\"width: 120.844px;\">\u30ea\u30bd\u30fc\u30b9\u9593<\/th>\n<th style=\"width: 162.156px;\">\u64cd\u4f5c<\/th>\n<th style=\"width: 270px;\">\u5236\u9650<\/th>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u540c\u4e00\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">\u30d6\u30e9\u30a6\u30b6\u5185\u30a2\u30af\u30bb\u30b9<\/td>\n<td style=\"width: 270px;\">\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u540c\u4e00\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u30a2\u30af\u30bb\u30b9<\/td>\n<td style=\"width: 270px;\">\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u540c\u4e00\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">iframe\u57cb\u3081\u8fbc\u307f<\/td>\n<td style=\"width: 270px;\">\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u30af\u30ed\u30b9\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">\u30d6\u30e9\u30a6\u30b6\u5185\u30a2\u30af\u30bb\u30b9<\/td>\n<td style=\"width: 270px;\">\u307b\u307c\u7981\u6b62<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u30af\u30ed\u30b9\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u30a2\u30af\u30bb\u30b9<\/td>\n<td style=\"width: 270px;\">\u5358\u7d14\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u8a31\u53ef\u3001\u305d\u308c\u4ee5\u5916\u306f\u7981\u6b62<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 120.844px;\">\u30af\u30ed\u30b9\u30aa\u30ea\u30b8\u30f3<\/td>\n<td style=\"width: 162.156px;\">iframe\u57cb\u3081\u8fbc\u307f<\/td>\n<td style=\"width: 270px;\">\u306a\u3057<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u30d6\u30e9\u30a6\u30b6\u5185\u30a2\u30af\u30bb\u30b9<\/h4>\n<p>\u300chttp:\/\/localhost:1000\/aaa.html\u300d\u304b\u3089\u300chttp:\/\/localhost:1000\/bbb.html\u300d\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306a\u3069\u3002<\/p>\n<h4>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d8a\u3057\u30a2\u30af\u30bb\u30b9<\/h4>\n<p>\u300chttp:\/\/localhost:1000\/aaa.html\u300d\u304b\u3089\u300chttp:\/\/xxxx:2000\/aaa.html\u300d\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306e\u3088\u3046\u306b\u30db\u30b9\u30c8\u540d\u3084\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u7570\u306a\u308b\u30a2\u30af\u30bb\u30b9\u306a\u3069\u3002<\/p>\n<p>Same-Origin\u306a\u3089\u884c\u3051\u307e\u3059\u304c\u3001\u30af\u30ed\u30b9\u30aa\u30ea\u30b8\u30f3\u3060\u3068\u30d6\u30e9\u30a6\u30b6\u306b\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u30aa\u30ea\u30b8\u30f3\u3068\u306f\uff1f URL\u306e\u3053\u3068\u3067\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001\u30b9\u30ad\u30fc\u30e0\uff08http\u306a\u3069\uff09\u3001\u30db\u30b9\u30c8\u540d\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u3068\u3044\u30463\u3064\u306e\u5024\u306e\u7d44\u307f\u5408\u308f\u305b\u306e\u3053\u3068\u3067\u3059\u3002(RFC 6454\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002) \u30aa\u30ea\u30b8\u30f3\u9593\u306e\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\u306e\u7a2e\u985e \u30ea\u30bd\u30fc\u30b9\u306e\u30d6\u30e9\u30a6 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[122],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13870"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13870"}],"version-history":[{"count":5,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13870\/revisions"}],"predecessor-version":[{"id":20680,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/13870\/revisions\/20680"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13870"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}