From d366661b4b60551e8dfbaf49a4a7ef45e3f37149 Mon Sep 17 00:00:00 2001 From: taekyoungc Date: Thu, 25 Jun 2026 14:31:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20embed(=ED=83=AD)=20GET=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=ED=8F=BC=EC=97=90=EC=84=9C=20=EC=A4=91=EC=B2=A9=20?= =?UTF-8?q?=EC=85=B8=20=ED=91=9C=EC=8B=9C=20=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GET 폼 제출 시 action 쿼리스트링에서 embed=1 이 빠져 전체 크롬이 탭 안에 다시 그려지는 문제 → 숨김 input(embed=1) 주입으로 유지 Co-Authored-By: Claude Opus 4.8 --- app/Views/bag/layout/embed.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Views/bag/layout/embed.php b/app/Views/bag/layout/embed.php index 43c777d..4da288f 100644 --- a/app/Views/bag/layout/embed.php +++ b/app/Views/bag/layout/embed.php @@ -196,8 +196,19 @@ tailwind.config = { document.addEventListener('submit', function (e) { var f = e.target; if (!f || f.tagName !== 'FORM') return; - var ne = withEmbed(f.getAttribute('action') || location.href); - if (ne) f.setAttribute('action', ne); + var method = (f.getAttribute('method') || 'get').toLowerCase(); + if (method === 'get') { + // GET 폼은 제출 시 action의 쿼리스트링이 폼 필드로 대체되므로, + // action 수정 대신 hidden input 으로 embed=1 을 유지한다(중첩 셸 방지). + if (!f.querySelector('input[name="embed"]')) { + var h = document.createElement('input'); + h.type = 'hidden'; h.name = 'embed'; h.value = '1'; + f.appendChild(h); + } + } else { + var ne = withEmbed(f.getAttribute('action') || location.href); + if (ne) f.setAttribute('action', ne); + } }, true); // 표 '번호' 컬럼 역순 채번 (사이트 레이아웃과 동일) var run = function () {