복귀 링크 기본 경로 정리
This commit is contained in:
@@ -48,7 +48,7 @@ Car는 차량 모뎀/게이트웨이에서 받은 상태를 수집해 DB에 저
|
||||
|
||||
헤더 우측 컨트롤은 WakeLock, 언어, 테마 순서입니다. WakeLock은 Screen Wake Lock API를 지원하는 브라우저에서 화면 꺼짐을 방지하며, 활성 상태는 초록색 아이콘 버튼으로 표시합니다. 사용자의 선택은 `localStorage`에 저장하고, 새로고침이나 탭 복귀 후에는 브라우저 정책에 맞춰 다시 획득을 시도합니다.
|
||||
|
||||
좌측 상단 복귀 링크는 이전 페이지가 `chaegeon.com` 계열이면 해당 URL을 사용합니다. 같은 출처에서 이동한 경우에는 이전 문서의 title을 읽어 표시하고, 직접 접속이나 이전 페이지 확인이 어려운 경우에는 `https://chaegeon.com/blog`를 기본 목적지로 사용합니다. `seo.chaegeon.com`의 상대 경로로 이동하지 않도록 절대 URL을 기본값으로 둡니다.
|
||||
좌측 상단 복귀 링크는 이전 페이지가 `chaegeon.com` 계열이면 해당 URL을 사용합니다. `chaegeon.com`이면 채건닷컴, `/blog`이면 블로그처럼 알려진 경로명을 우선 표시하고, 같은 출처의 다른 이전 페이지는 문서 title을 읽어 표시합니다. 직접 접속이나 이전 페이지 확인이 어려운 경우에는 `https://chaegeon.com/`를 기본 목적지로 사용합니다. `seo.chaegeon.com`의 상대 경로로 이동하지 않도록 절대 URL을 기본값으로 둡니다.
|
||||
|
||||
## 구성
|
||||
|
||||
|
||||
+6
-5
@@ -1372,7 +1372,7 @@ car_monitor_require_access(false);
|
||||
<i class="fas fa-car"></i>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://chaegeon.com/blog" id="blogBackLink" class="blog-back-link"><span class="backArrow">‹</span> 블로그</a>
|
||||
<a href="https://chaegeon.com/" id="blogBackLink" class="blog-back-link"><span class="backArrow">‹</span> 채건닷컴</a>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<div class="app-title" data-i18n="appTitle">Car Monitor</div>
|
||||
<span id="live-badge" class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary border-opacity-20 rounded-pill" style="font-size:0.6rem; vertical-align: top;">WAIT</span>
|
||||
@@ -1826,7 +1826,7 @@ car_monitor_require_access(false);
|
||||
let wakeLockWanted = false;
|
||||
let latestDashboardData = null;
|
||||
let latestDashboardMeta = null;
|
||||
const FALLBACK_BACK_TARGET = 'https://chaegeon.com/blog';
|
||||
const FALLBACK_BACK_TARGET = 'https://chaegeon.com/';
|
||||
const BACK_LINK_PATH_TITLE = {
|
||||
'/': '채건닷컴',
|
||||
'/home': '홈',
|
||||
@@ -1903,9 +1903,10 @@ car_monitor_require_access(false);
|
||||
const ref = sameSiteUrl(document.referrer || '');
|
||||
const current = new URL(location.href);
|
||||
const target = ref && ref.href !== current.href ? ref.href : FALLBACK_BACK_TARGET;
|
||||
let label = titleFromBackUrl(target);
|
||||
const knownLabel = titleFromBackUrl(target);
|
||||
let label = knownLabel;
|
||||
|
||||
if (ref && ref.origin === location.origin) {
|
||||
if (!knownLabel && ref && ref.origin === location.origin) {
|
||||
try {
|
||||
const res = await fetch(ref.href, { credentials: 'same-origin', cache: 'force-cache' });
|
||||
if (res.ok) {
|
||||
@@ -1924,7 +1925,7 @@ car_monitor_require_access(false);
|
||||
if (!link) return;
|
||||
|
||||
link.href = FALLBACK_BACK_TARGET;
|
||||
updateBackLinkLabel('블로그');
|
||||
updateBackLinkLabel('채건닷컴');
|
||||
|
||||
resolveBackTarget().then(({ href, label }) => {
|
||||
link.href = href;
|
||||
|
||||
Reference in New Issue
Block a user