deeplink debug 재수정

This commit is contained in:
opacity@t-win.kr
2025-08-27 16:43:40 +09:00
parent 2210a82027
commit 2635d0e79d

View File

@@ -835,13 +835,13 @@ export default function MainView({ className, initService }) {
left: "0", left: "0",
bottom: "0", bottom: "0",
color: "#fff", color: "#fff",
fontSize: "11px", fontSize: "12px",
opacity: ".9", opacity: ".9",
zIndex: "999", zIndex: "999",
backgroundColor: "rgba(0,0,0,0.7)", backgroundColor: "rgba(0,0,0,0.7)",
padding: "8px", padding: "6px",
width: "700px", width: "800px",
height: "550px", height: "700px",
borderRadius: "5px", borderRadius: "5px",
fontFamily: "monospace", fontFamily: "monospace",
overflow: "hidden", overflow: "hidden",
@@ -853,66 +853,30 @@ export default function MainView({ className, initService }) {
<div <div
style={{ style={{
fontWeight: "bold", fontWeight: "bold",
marginBottom: "5px", marginBottom: "2px",
color: "#00ff00", color: "#00ff00",
fontSize: "10px", fontSize: "11px",
}} }}
> >
🔗 Deep Link Debug Info 🔗 Deep Link Debug Info
</div> </div>
<div style={{ display: "flex", gap: "5px", height: "100%" }}> <div style={{ display: "flex", gap: "10px", height: "100%" }}>
{/* Left Column */} {/* Left Column */}
<div style={{ flex: 1, fontSize: "11px" }}> <div style={{ flex: 1, fontSize: "12px" }}>
{/* Current State */}
<div style={{ marginBottom: "5px" }}>
<div style={{ color: "#ffff00", marginBottom: "2px" }}>
📊 Current:
</div>
<div>
isDeepLink:{" "}
<span
style={{
color: deepLinkInfo.isDeepLink ? "#00ff00" : "#ff6666",
}}
>
{deepLinkInfo.isDeepLink ? "✓" : "✗"}
</span>
</div>
<div>
contentTarget:{" "}
<span
style={{
color: deepLinkInfo.contentTarget ? "#00ff00" : "#ff6666",
}}
>
{deepLinkInfo.contentTarget || "MISSING"}
</span>
</div>
<div>
panels: {panels.length}, top:{" "}
{panels.length > 0 ? panels[panels.length - 1].name : "none"}
</div>
</div>
{/* App Status */} {/* App Status */}
<div style={{ marginBottom: "5px" }}> <div style={{ marginBottom: "6px" }}>
<div style={{ color: "#ffff00", marginBottom: "2px" }}> <div style={{ color: "#ffff00", marginBottom: "0px" }}>
📱 System: 📱 System:
</div> </div>
<div>webOS: {appStatus.webOSVersion || "unknown"}</div> <div>webOS: {appStatus.webOSVersion || "unknown"}</div>
<div> <div>deviceId: {appStatus.deviceId || "unknown"}</div>
deviceId:{" "}
{appStatus.deviceId
? appStatus.deviceId.substring(0, 8) + "..."
: "unknown"}
</div>
<div>server: {appStatus.serverHOST || "unknown"}</div> <div>server: {appStatus.serverHOST || "unknown"}</div>
</div> </div>
{/* Redux State */} {/* Redux State */}
<div> <div>
<div style={{ color: "#ffff00", marginBottom: "2px" }}> <div style={{ color: "#ffff00", marginBottom: "0px" }}>
🏪 Redux: 🏪 Redux:
</div> </div>
<div>deepLink: {JSON.stringify(deepLinkInfo)}</div> <div>deepLink: {JSON.stringify(deepLinkInfo)}</div>
@@ -921,94 +885,120 @@ export default function MainView({ className, initService }) {
</div> </div>
{/* Right Column */} {/* Right Column */}
<div style={{ flex: 1, fontSize: "11px" }}> <div style={{ flex: 1, fontSize: "12px" }}>
{/* Launch Params */} {/* Launch Params */}
<div style={{ marginBottom: "5px" }}> <div>
<div style={{ color: "#ffff00", marginBottom: "2px" }}> <div style={{ color: "#ffff00", marginBottom: "0px" }}>
📱 Launch Params: 📱 Launch Params:
</div> </div>
{(() => { {(() => {
try { try {
if ( // 항상 모든 정보를 표시
!( const hasWebOS =
typeof window === "object" && typeof window === "object" &&
window.PalmSystem && window.PalmSystem &&
window.PalmSystem.launchParams window.PalmSystem.launchParams;
)
) {
return (
<div style={{ color: "#ff6666" }}>
No webOS environment
</div>
);
}
const raw = window.PalmSystem.launchParams; let raw = "N/A";
const parsed = JSON.parse(raw); let parsed = {};
const containerFlag = parsed["x-webos-app-container-launch"]; let containerFlag = "N/A";
const finalParams = let finalParams = {};
containerFlag === true ? parsed.details : parsed; let contentTarget = "N/A";
const contentTarget = finalParams.contentTarget; let parseError = null;
if (hasWebOS) {
try {
raw = window.PalmSystem.launchParams;
parsed = JSON.parse(raw);
containerFlag = parsed["x-webos-app-container-launch"];
finalParams =
containerFlag === true ? parsed.details : parsed;
contentTarget = finalParams.contentTarget;
} catch (e) {
parseError = e.message;
}
}
return ( return (
<> <>
<div>raw: {raw.substring(0, 50)}...</div> <div style={{ marginBottom: "1px" }}>
<div>containerFlag: {String(containerFlag)}</div> <span
style={{ color: hasWebOS ? "#00ff00" : "#ff6666" }}
>
webOS환경: {hasWebOS ? "✓" : "✗"}
</span>
</div>
<div style={{ marginBottom: "1px" }}>
<div style={{ color: "#ffff00" }}>
raw (최초 파라미터):
</div>
<div
style={{
fontSize: "10px",
color: "#cccccc",
marginLeft: "5px",
whiteSpace: "pre-wrap",
wordBreak: "break-all",
}}
>
{raw}
</div>
</div>
<div style={{ marginBottom: "1px" }}>
containerFlag: {String(containerFlag)}
</div>
<div style={{ marginBottom: "1px" }}>
<div style={{ color: "#ffff00" }}>initialParse:</div>
<div
style={{
fontSize: "10px",
color: "#cccccc",
marginLeft: "5px",
whiteSpace: "pre-wrap",
wordBreak: "break-all",
}}
>
{JSON.stringify(parsed, null, 2)}
</div>
</div>
<div style={{ marginBottom: "1px" }}>
<div style={{ color: "#ffff00" }}>finalParams:</div>
<div
style={{
fontSize: "10px",
color: "#cccccc",
marginLeft: "5px",
whiteSpace: "pre-wrap",
wordBreak: "break-all",
}}
>
{JSON.stringify(finalParams, null, 2)}
</div>
</div>
<div> <div>
contentTarget:{" "} contentTarget:{" "}
<span <span
style={{ style={{
color: contentTarget ? "#00ff00" : "#ff6666", color:
contentTarget && contentTarget !== "N/A"
? "#00ff00"
: "#ff6666",
}} }}
> >
{contentTarget || "MISSING"} {contentTarget || "MISSING"}
</span> </span>
</div> </div>
</>
);
} catch (e) {
return (
<div style={{ color: "#ff6666" }}>Error: {e.message}</div>
);
}
})()}
</div>
{/* Real-time Check */} {parseError && (
<div> <div style={{ color: "#ff6666", marginTop: "2px" }}>
<div style={{ color: "#ffff00", marginBottom: "2px" }}> Parse Error: {parseError}
🔄 Real-time: </div>
</div> )}
{(() => {
try {
let currentParams = {};
if (
typeof window === "object" &&
window.PalmSystem &&
window.PalmSystem.launchParams
) {
currentParams = JSON.parse(window.PalmSystem.launchParams);
if (
currentParams["x-webos-app-container-launch"] === true
) {
currentParams = currentParams.details;
}
}
return (
<>
<div>time: {new Date().toLocaleTimeString()}</div>
<div>
current:{" "}
<span
style={{
color: currentParams.contentTarget
? "#00ff00"
: "#ff6666",
}}
>
{currentParams.contentTarget || "MISSING"}
</span>
</div>
</> </>
); );
} catch (e) { } catch (e) {
@@ -1020,36 +1010,6 @@ export default function MainView({ className, initService }) {
</div> </div>
</div> </div>
</div> </div>
{/* Parsed Deep Link */}
{deepLinkInfo.contentTarget && (
<div
style={{ marginTop: "8px", fontSize: "8px", paddingBottom: "5px" }}
>
<div style={{ color: "#ffff00", marginBottom: "2px" }}>
🔍 Parsed:
</div>
{(() => {
const tokens = deepLinkInfo.contentTarget.split("_");
if (tokens[0] === "V2" || tokens[0] === "V3") {
return (
<>
<div>
Version: {tokens[0]}, Code: {tokens[1]}, Name: {tokens[2]}
, Type: {tokens[3]}
</div>
{tokens.length > 4 && (
<div>Extra: {tokens.slice(4).join("_")}</div>
)}
</>
);
}
return (
<div style={{ color: "#ff6666" }}> Not V2/V3 format</div>
);
})()}
</div>
)}
</div> </div>
</div> </div>
); );