debug 값 변경
This commit is contained in:
@@ -894,10 +894,17 @@ export default function MainView({ className, initService }) {
|
|||||||
{(() => {
|
{(() => {
|
||||||
try {
|
try {
|
||||||
// 항상 모든 정보를 표시
|
// 항상 모든 정보를 표시
|
||||||
const hasWebOS =
|
const windowExists = typeof window === "object";
|
||||||
typeof window === "object" &&
|
const palmSystemExists = windowExists && !!window.PalmSystem;
|
||||||
window.PalmSystem &&
|
const launchParamsExists =
|
||||||
window.PalmSystem.launchParams;
|
palmSystemExists &&
|
||||||
|
window.PalmSystem.launchParams !== undefined;
|
||||||
|
const launchParamsValue = palmSystemExists
|
||||||
|
? window.PalmSystem.launchParams
|
||||||
|
: null;
|
||||||
|
const launchParamsType = palmSystemExists
|
||||||
|
? typeof window.PalmSystem.launchParams
|
||||||
|
: "N/A";
|
||||||
|
|
||||||
let raw = "N/A";
|
let raw = "N/A";
|
||||||
let parsed = {};
|
let parsed = {};
|
||||||
@@ -906,7 +913,8 @@ export default function MainView({ className, initService }) {
|
|||||||
let contentTarget = "N/A";
|
let contentTarget = "N/A";
|
||||||
let parseError = null;
|
let parseError = null;
|
||||||
|
|
||||||
if (hasWebOS) {
|
// TV에서 launch params가 빈 문자열이거나 null일 수 있음
|
||||||
|
if (launchParamsExists && launchParamsValue) {
|
||||||
try {
|
try {
|
||||||
raw = window.PalmSystem.launchParams;
|
raw = window.PalmSystem.launchParams;
|
||||||
parsed = JSON.parse(raw);
|
parsed = JSON.parse(raw);
|
||||||
@@ -919,13 +927,47 @@ export default function MainView({ className, initService }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<div style={{ marginBottom: "1px" }}>
|
<div style={{ marginBottom: "1px" }}>
|
||||||
<span
|
<span
|
||||||
style={{ color: hasWebOS ? "#00ff00" : "#ff6666" }}
|
style={{
|
||||||
|
color: palmSystemExists ? "#00ff00" : "#ff6666",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
webOS환경: {hasWebOS ? "✓" : "✗"}
|
webOS환경: {palmSystemExists ? "✓" : "✗"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -981,7 +1023,8 @@ export default function MainView({ className, initService }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
contentTarget:{" "}
|
<div>
|
||||||
|
launch contentTarget:{" "}
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
color:
|
color:
|
||||||
@@ -993,6 +1036,33 @@ export default function MainView({ className, initService }) {
|
|||||||
{contentTarget || "MISSING"}
|
{contentTarget || "MISSING"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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 && (
|
{parseError && (
|
||||||
<div style={{ color: "#ff6666", marginTop: "2px" }}>
|
<div style={{ color: "#ff6666", marginTop: "2px" }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user