debug 의 try 문제거
This commit is contained in:
@@ -892,190 +892,64 @@ export default function MainView({ className, initService }) {
|
||||
📱 Launch Params:
|
||||
</div>
|
||||
{(() => {
|
||||
try {
|
||||
// 항상 모든 정보를 표시
|
||||
const windowExists = typeof window === "object";
|
||||
const palmSystemExists = windowExists && !!window.PalmSystem;
|
||||
const launchParamsExists =
|
||||
palmSystemExists &&
|
||||
window.PalmSystem.launchParams !== undefined;
|
||||
const launchParamsValue = palmSystemExists
|
||||
? window.PalmSystem.launchParams
|
||||
: null;
|
||||
const launchParamsType = palmSystemExists
|
||||
? typeof window.PalmSystem.launchParams
|
||||
: "N/A";
|
||||
let raw = window.PalmSystem?.launchParams || "{}";
|
||||
let parsed = JSON.parse(raw);
|
||||
let containerFlag = parsed["x-webos-app-container-launch"];
|
||||
let finalParams =
|
||||
containerFlag === true ? parsed.details : parsed;
|
||||
let contentTarget = finalParams?.contentTarget || "N/A";
|
||||
|
||||
let raw = "N/A";
|
||||
let parsed = {};
|
||||
let containerFlag = "N/A";
|
||||
let finalParams = {};
|
||||
let contentTarget = "N/A";
|
||||
let parseError = null;
|
||||
return (
|
||||
<>
|
||||
<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>
|
||||
|
||||
// TV에서 launch params가 빈 문자열이거나 null일 수 있음
|
||||
if (launchParamsExists && launchParamsValue) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
<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>
|
||||
|
||||
// Redux에서 가져온 contentTarget (비교용)
|
||||
const reduxContentTarget = deepLinkInfo.contentTarget;
|
||||
|
||||
// getLaunchParams() 함수 결과 확인
|
||||
let getLaunchParamsResult = {};
|
||||
try {
|
||||
// helperMethods.js의 getLaunchParams 함수 직접 호출
|
||||
if (
|
||||
typeof window === "object" &&
|
||||
window.PalmSystem &&
|
||||
window.PalmSystem.launchParams
|
||||
) {
|
||||
getLaunchParamsResult = JSON.parse(
|
||||
window.PalmSystem.launchParams
|
||||
);
|
||||
if (
|
||||
getLaunchParamsResult[
|
||||
"x-webos-app-container-launch"
|
||||
] === true
|
||||
) {
|
||||
getLaunchParamsResult = getLaunchParamsResult.details;
|
||||
}
|
||||
} else {
|
||||
// localLaunchParams가 반환될 것임
|
||||
getLaunchParamsResult = {
|
||||
source: "localLaunchParams (fallback)",
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
getLaunchParamsResult = { error: e.message };
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ marginBottom: "1px" }}>
|
||||
<div>
|
||||
<div>
|
||||
contentTarget:{" "}
|
||||
<span
|
||||
style={{
|
||||
color: palmSystemExists ? "#00ff00" : "#ff6666",
|
||||
color:
|
||||
contentTarget && contentTarget !== "N/A"
|
||||
? "#00ff00"
|
||||
: "#ff6666",
|
||||
}}
|
||||
>
|
||||
webOS환경: {palmSystemExists ? "✓" : "✗"}
|
||||
{contentTarget || "MISSING"}
|
||||
</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>
|
||||
launch contentTarget:{" "}
|
||||
<span
|
||||
style={{
|
||||
color:
|
||||
contentTarget && contentTarget !== "N/A"
|
||||
? "#00ff00"
|
||||
: "#ff6666",
|
||||
}}
|
||||
>
|
||||
{contentTarget || "MISSING"}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
redux contentTarget:{" "}
|
||||
<span
|
||||
style={{
|
||||
color: reduxContentTarget ? "#00ff00" : "#ff6666",
|
||||
}}
|
||||
>
|
||||
{reduxContentTarget || "MISSING"}
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ marginTop: "2px" }}>
|
||||
<div style={{ color: "#ffff00" }}>
|
||||
getLaunchParams() 결과:
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
fontSize: "10px",
|
||||
color: "#cccccc",
|
||||
marginLeft: "5px",
|
||||
whiteSpace: "pre-wrap",
|
||||
wordBreak: "break-all",
|
||||
}}
|
||||
>
|
||||
{JSON.stringify(getLaunchParamsResult, null, 2)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{parseError && (
|
||||
<div style={{ color: "#ff6666", marginTop: "2px" }}>
|
||||
Parse Error: {parseError}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
} catch (e) {
|
||||
return (
|
||||
<div style={{ color: "#ff6666" }}>Error: {e.message}</div>
|
||||
);
|
||||
}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user