fix: embed(탭) GET 조회 폼에서 중첩 셸 표시 방지

GET 폼 제출 시 action 쿼리스트링에서 embed=1 이 빠져 전체 크롬이
탭 안에 다시 그려지는 문제 → 숨김 input(embed=1) 주입으로 유지

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
taekyoungc
2026-06-25 14:31:29 +09:00
parent 5b903c9aa6
commit d366661b4b

View File

@@ -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 () {