Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified dist.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "voim",
"version": "1.0.0",
"version": "2.0.0",
"description": "μ‹œκ° 정보 해독이 μ–΄λ €μš΄ μ‚¬μš©μžλ₯Ό μœ„ν•œ 크둬 ν™•μž₯ ν”„λ‘œκ·Έλž¨",
"action": {
"default_icon": {
Expand Down Expand Up @@ -46,14 +46,14 @@
"128": "icons/icon-128.png"
},
"host_permissions": ["<all_urls>", "https://voim.store/*"],
"permissions": ["scripting", "activeTab", "storage", "tabs", "sidePanel"],
"permissions": ["scripting", "activeTab", "storage", "tabs"],
"commands": {
"toggle_iframe": {
"suggested_key": {
"default": "Alt+V",
"mac": "Alt+V"
},
"description": "Toggle floating iframe"
"description": "μ•„μ΄μ½˜ 끄기/ν‚€κΈ°"
},
"toggle_modal": {
"suggested_key": {
Expand All @@ -74,7 +74,7 @@
"default": "Alt+A",
"mac": "Alt+A"
},
"description": "λͺ¨λ“  κΈ°λŠ₯ ν† κΈ€"
"description": "λͺ¨λ“  κΈ°λŠ₯ 끄기/ν‚€κΈ°"
}
}
}
8 changes: 4 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "voim",
"version": "1.0.0",
"version": "2.0.0",
"description": "μ‹œκ° 정보 해독이 μ–΄λ €μš΄ μ‚¬μš©μžλ₯Ό μœ„ν•œ 크둬 ν™•μž₯ ν”„λ‘œκ·Έλž¨",
"action": {
"default_icon": {
Expand Down Expand Up @@ -46,14 +46,14 @@
"128": "icons/icon-128.png"
},
"host_permissions": ["<all_urls>", "https://voim.store/*"],
"permissions": ["scripting", "activeTab", "storage", "tabs", "sidePanel"],
"permissions": ["scripting", "activeTab", "storage", "tabs"],
"commands": {
"toggle_iframe": {
"suggested_key": {
"default": "Alt+V",
"mac": "Alt+V"
},
"description": "Toggle floating iframe"
"description": "μ•„μ΄μ½˜ 끄기/ν‚€κΈ°"
},
"toggle_modal": {
"suggested_key": {
Expand All @@ -74,7 +74,7 @@
"default": "Alt+A",
"mac": "Alt+A"
},
"description": "λͺ¨λ“  κΈ°λŠ₯ ν† κΈ€"
"description": "λͺ¨λ“  κΈ°λŠ₯ 끄기/ν‚€κΈ°"
}
}
}
15 changes: 7 additions & 8 deletions src/assets/onboardingData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@ export const onboardingData = {
info: {
title: "더 λ‚˜μ€ μ‡Όν•‘ κ²½ν—˜μ„ μœ„ν•œ VOIM",
phrase: [
"VOIM은 μ‡Όν•‘ μ‹œ 이미지 속 μ œν’ˆ 정보λ₯Ό μžλ™μœΌλ‘œ μš”μ•½ν•˜κ³ , μ€‘μš”ν•œ 성뢄을 뢄석해 μ „λ‹¬ν•˜λŠ” μ‹œκ° 보쑰 μž₯μΉ˜μž…λ‹ˆλ‹€.",
"μ‹œκ° 편의 섀정을 μœ„ν•΄ 메뉴바λ₯Ό μΌœμ‹œλ €λ©΄ 우츑 μƒλ‹¨μ˜ VOIM μ•„μ΄μ½˜μ„ ν΄λ¦­ν•˜κ±°λ‚˜ 단좕킀 ALT + Oλ₯Ό λˆŒλŸ¬μ£Όμ„Έμš”.\nμ„œλΉ„μŠ€ μ•„μ΄μ½˜ μˆ¨κΉ€ 섀정은 메뉴 > μ„œλΉ„μŠ€ μ„€μ •μ—μ„œ κ°€λŠ₯ν•©λ‹ˆλ‹€.",
"ν•˜λ‹¨μ˜ λ‹€μŒ λ²„νŠΌμ„ λˆ„λ₯΄μ‹œλ©΄ μ„œλΉ„μŠ€μ˜ κΈ°λŠ₯에 λŒ€ν•œ μ„€λͺ…이 λ‚˜μ˜΅λ‹ˆλ‹€. μ•ˆλ‚΄λ₯Ό κ±΄λ„ˆλ›°μ‹œλ €λ©΄ 우츑 μƒλ‹¨μ˜ λ‹«κΈ° λ²„νŠΌμ„ λˆŒλŸ¬μ£Όμ„Έμš”.",
"λ³΄μž„μ€ 온라인 μ‡Όν•‘ μ‹œ 이미지 속 정보λ₯Ό μžλ™μœΌλ‘œ μš”μ•½ν•΄ μƒν’ˆμ˜\nμ€‘μš”ν•œ μ„±λΆ„ 정보λ₯Ό μ „λ‹¬ν•˜λŠ” μ‹œκ° 보쑰 μž₯μΉ˜μž…λ‹ˆλ‹€.\n",

"μ„œλΉ„μŠ€ κΈ°λŠ₯ μ„€λͺ…을 보렀면 λ‹€μŒ λ²„νŠΌμ„, μ„€λͺ…을 κ±΄λ„ˆλ›°κ³  μ„œλΉ„μŠ€λ₯Ό\nμ¦‰μ‹œ μ΄μš©ν•˜λ €λ©΄ λ‹«κΈ° λ²„νŠΌμ„ λˆŒλŸ¬μ£Όμ„Έμš”.",
],
},
image: {
title: "이미지 뢄석 κΈ°λŠ₯ μ•ˆλ‚΄",
phrase: [
"이미지 정보λ₯Ό μ•Œμ•„λ³΄κ³  싢을 경우, 이미지 쒌츑 상단에 μžˆλŠ” 이미지 뢄석 λ²„νŠΌμ„ ν΄λ¦­ν•˜λ©΄ μ„ νƒν•œ μ΄λ―Έμ§€μ˜ 정보λ₯Ό ν…μŠ€νŠΈλ‘œ μ œκ³΅λ°›μ„ 수 μžˆμŠ΅λ‹ˆλ‹€.",
"쿠팑의 경우, μƒν’ˆ 상세 νŽ˜μ΄μ§€μ— μ§„μž…ν•˜λ©΄ VOIM이 μžλ™μœΌλ‘œ μž‘λ™λ˜μ–΄ μƒν’ˆ κ΄€λ ¨ μš”μ•½ 정보λ₯Ό 화면에 μ œκ³΅ν•©λ‹ˆλ‹€.",
"μ΄λ―Έμ§€μ˜ 정보λ₯Ό ν…μŠ€νŠΈλ‘œ μ œκ³΅λ°›μœΌλ €λ©΄ 이미지 쒌츑 상단에 μžˆλŠ”\n이미지 뢄석 λ²„νŠΌμ„ λˆŒλŸ¬μ£Όμ„Έμš”.\n",
"쿠팑 이용 μ‹œ, μƒν’ˆ 상세 νŽ˜μ΄μ§€μ—μ„œ μƒν’ˆ μš”μ•½ 정보가 μžλ™\nμ œκ³΅λ©λ‹ˆλ‹€.",
],
},
product: {
title: "μ„±λΆ„ 뢄석 κΈ°λŠ₯ μ•ˆλ‚΄",
phrase: [
"μ‹ν’ˆ, ν™”μž₯ν’ˆ, 건강기λŠ₯μ‹ν’ˆ μƒν’ˆμ— ν•œν•˜μ—¬ μ„±λΆ„κ³Ό κ΄€λ ¨λœ μ£Όμ˜μ‚¬ν•­μ„ κ°•μ‘°ν•΄ 화면에 μ œκ³΅ν•©λ‹ˆλ‹€.",
"μ‹ν’ˆ, ν™”μž₯ν’ˆ, 건강기λŠ₯μ‹ν’ˆ μƒν’ˆμ— ν•œν•˜μ—¬ μ„±λΆ„ κ΄€λ ¨ μ£Όμ˜μ‚¬ν•­μ΄\nμ œκ³΅λ©λ‹ˆλ‹€.",
],
},
theme: {
title: "κ³ λŒ€λΉ„λͺ¨λ“œ βˆ™ κΈ€μž βˆ™ 마우슀 μ»€μ„œ μ„€μ • μ•ˆλ‚΄",
phrase: [
"ν™”λ©΄ 우츑 μƒλ‹¨μ˜ μ„œλΉ„μŠ€ μ•„μ΄μ½˜μ„ ν΄λ¦­ν•˜κ±°λ‚˜ 단좕킀 ALT +Oλ₯Ό 눌러 μ‹œκ° 편의 섀정을 μœ„ν•œ 메뉴바λ₯Ό μΌ€ 수 μžˆμŠ΅λ‹ˆλ‹€.",
"μ„œλΉ„μŠ€ μ‚¬μš©μ— ν•„μš”ν•œ λͺ¨λ“  단좕킀에 λŒ€ν•œ μ•ˆλ‚΄λ„ μ œκ³΅ν•˜κ³  μžˆμœΌλ‹ˆ 메뉴바λ₯Ό μ°Έκ³ ν•΄μ£Όμ‹œκΈ° λ°”λžλ‹ˆλ‹€.",
"μ‹œκ° 편의 섀정을 켜렀면 μ„œλΉ„μŠ€ μ•„μ΄μ½˜μ„ λˆ„λ₯΄κ±°λ‚˜\n단좕킀 ALT + Oλ₯Ό λˆŒλŸ¬μ£Όμ„Έμš”.",
],
},
};
5 changes: 2 additions & 3 deletions src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
DEFAULT_FONT_WEIGHT,
} from "./constants";
import { initCommandListeners } from "./listeners/commandListeners";
import { handleModalToggle } from "./listeners/modalCommandHandler";

Check warning on line 11 in src/background/index.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

'handleModalToggle' is defined but never used. Allowed unused vars must match /^_/u
import { handleIconToggle } from "./listeners/iconHandler";

/**
Expand Down Expand Up @@ -146,8 +146,7 @@
body: JSON.stringify(payload),
}).then(async (res) => {
const text = await res.text();
console.log("[voim] 응닡 μƒνƒœ μ½”λ“œ:", res.status);
console.log("[voim] 응닡 원문:", text);

try {
const json = JSON.parse(text);
if (res.ok) {
Expand All @@ -158,7 +157,7 @@
error: json?.message ?? "μ—λŸ¬ λ°œμƒ",
});
}
} catch (err) {

Check warning on line 160 in src/background/index.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

'err' is defined but never used
console.error("[voim] JSON νŒŒμ‹± μ‹€νŒ¨", text);
sendResponse({
status: res.status,
Expand Down Expand Up @@ -282,7 +281,7 @@
})
.then(async (res) => {
const json = await res.json();
console.log("[voim][background] 응닡 원문:", json);

return json;
})
.then((data) => {
Expand Down Expand Up @@ -442,7 +441,7 @@
}
});

chrome.action.onClicked.addListener(async (tab) => {

Check warning on line 444 in src/background/index.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

'tab' is defined but never used. Allowed unused args must match /^_/u
try {
logger.debug("νˆ΄λ°” μ•„μ΄μ½˜ 클릭됨");
await handleIconToggle();
Expand Down
10 changes: 5 additions & 5 deletions src/components/panelContent/component.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useRef } from "react";
import { useFocusManagement } from "@src/hooks/useFocusManagement";
import ControlMode from "@src/components/modeButton/ControlMode";
import ControlFont from "@src/components/fontButton/ControlFont";
import { ShortcutTab } from "@src/components/shortcutTab";
import { MyInfo } from "@src/tabs/myInfo";
import ControlService from "@src/components/serviceButton/ControlService";
import { menuItems } from "@src/constants/menuItems";
import ControlMode from "@src/tabs/modeButton/ControlMode";
import ControlFont from "@src/tabs/fontButton/ControlFont";
import { ShortcutTab } from "@src/tabs/shortcutTab";
import ControlService from "@src/tabs/serviceButton/ControlService";

interface PanelContentProps {
menuId: string | null;
Expand All @@ -29,7 +29,7 @@ export const PanelContent: React.FC<PanelContentProps> = ({
case "shortcut":
return <ShortcutTab />;
case "my-info":
return <MyInfo />;
return <MyInfo onComplete={() => setMenuId(null)} />;
case "service":
return <ControlService onClose={() => setMenuId(null)} />;
default:
Expand Down
13 changes: 0 additions & 13 deletions src/components/productComponents/foodComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ const allergyNameMap: Record<string, string> = {
};

export const FoodComponent = () => {
console.log("FoodComponent λ“±μž₯");
const [nutrientAlerts, setNutrientAlerts] = useState<Nutrient[] | null>(
null,
);
Expand Down Expand Up @@ -122,10 +121,6 @@ export const FoodComponent = () => {
retryRes?.html?.trim() &&
retryRes?.productId
) {
console.log(
"[voim] FETCH_VENDOR_HTML μž¬μ‹œλ„ 성곡:",
retryRes,
);
clearInterval(interval);
resolve(retryRes);
} else if (--retries === 0) {
Expand All @@ -140,10 +135,6 @@ export const FoodComponent = () => {
);
}, 500);
} else {
console.log(
"[voim] FETCH_VENDOR_HTML 성곡 응닡:",
res,
);
resolve(res);
}
},
Expand All @@ -159,12 +150,8 @@ export const FoodComponent = () => {
allergies: Allergies || [],
};

console.log("[voim] FOOD API μš”μ²­ payload:", payload);

const result = await sendFoodDataRequest(payload);

console.log("[voim] FOOD API 응닡:", result);

setNutrientAlerts(result.overRecommendationNutrients || []);
setAllergyTypes(result.allergyTypes || []);
} catch (e) {
Expand Down
4 changes: 1 addition & 3 deletions src/components/productComponents/healthComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ export const HealthComponent = () => {
allergies: Allergies || [],
};

console.log("[voim] HEALTH API μš”μ²­ payload:", payload);

const result = await sendHealthDataRequest(payload);
console.log("[voim] HEALTH API 응닡:", result);

setHealthTypes(result || []);
} catch (e) {
console.error("[voim] HEALTH API μ‹€νŒ¨:", e);
Expand Down
14 changes: 0 additions & 14 deletions src/components/sizeController/components.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/sizeController/index.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/content/apiSetting/sendHealthDataRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const sendHealthDataRequest = (
payload: HealthRequestPayload,
): Promise<string[]> => {
return new Promise((resolve, reject) => {
console.log("[voim] HEALTH API μš”μ²­ payload:", payload);

chrome.runtime.sendMessage(
{
type: "FETCH_HEALTH_DATA",
Expand All @@ -38,10 +36,6 @@ export const sendHealthDataRequest = (
};

if (res.type === "HEALTH_DATA_RESPONSE" && res.data?.types) {
console.log(
"[voim] HEALTH API 응닡 데이터:",
res.data.types,
);
resolve(res.data.types);
} else {
console.error(
Expand Down
40 changes: 1 addition & 39 deletions src/content/apiSetting/sendReviewSummaryRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,20 @@ const waitForElement = (
export const collectCoupangReviewData =
async (): Promise<ReviewSummaryRequestPayload | null> => {
try {
console.log("[voim] 리뷰 데이터 μˆ˜μ§‘ μ‹œμž‘");

// 첫 번째 μΌ€μ΄μŠ€: .review-star-search-selector
let starRatingContainer = await waitForElement(
".review-star-search-selector",
);
console.log(
"[voim] 첫 번째 μΌ€μ΄μŠ€ 별점 μ»¨ν…Œμ΄λ„ˆ:",
starRatingContainer,
);

// 두 번째 μΌ€μ΄μŠ€: .sdp-review__article__order__star__option
if (!starRatingContainer) {
starRatingContainer = await waitForElement(
".sdp-review__article__order__star__option",
);
console.log(
"[voim] 두 번째 μΌ€μ΄μŠ€ 별점 μ»¨ν…Œμ΄λ„ˆ:",
starRatingContainer,
);
}

if (!starRatingContainer) {
console.error("[voim] 별점 μ»¨ν…Œμ΄λ„ˆλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.");
console.log(
"[voim] ν˜„μž¬ νŽ˜μ΄μ§€ HTML:",
document.body.innerHTML,
);
return null;
}

Expand All @@ -99,14 +85,12 @@ export const collectCoupangReviewData =
)
?.textContent?.trim() || "0";
const totalCount = parseInt(totalCountText.replace(/,/g, ""));
console.log("[voim] 전체 리뷰 수:", totalCount);

// 별점별 개수 μˆ˜μ§‘
const ratingsArray: number[] = [0, 0, 0, 0, 0]; // [졜고, μ’‹μŒ, 보톡, λ³„λ‘œ, λ‚˜μ¨]
const starItems = starRatingContainer.querySelectorAll(
".review-star-search-item, .sdp-review__article__order__star__list__item",
);
console.log("[voim] 별점 ν•­λͺ© 수:", starItems.length);

starItems.forEach((item) => {
const ratingText = item
Expand All @@ -121,13 +105,6 @@ export const collectCoupangReviewData =
)
?.textContent?.trim() || "0";

console.log(
"[voim] 별점 ν…μŠ€νŠΈ:",
ratingText,
"개수:",
countText,
);

const count = parseInt(countText.replace(/,/g, ""));
if (ratingText === "졜고") ratingsArray[0] = count;
else if (ratingText === "μ’‹μŒ") ratingsArray[1] = count;
Expand All @@ -136,13 +113,10 @@ export const collectCoupangReviewData =
else if (ratingText === "λ‚˜μ¨") ratingsArray[4] = count;
});

console.log("[voim] 별점 λ°°μ—΄:", ratingsArray);

// 리뷰 ν…μŠ€νŠΈ μˆ˜μ§‘
const reviewElements = document.querySelectorAll(
".review-content, .sdp-review__article__list__review__content",
);
console.log("[voim] 리뷰 μš”μ†Œ 수:", reviewElements.length);

const reviews: string[] = [];
reviewElements.forEach((element) => {
Expand All @@ -162,15 +136,6 @@ export const collectCoupangReviewData =
return null;
}

console.log("[voim] μˆ˜μ§‘λœ 데이터:", {
productId,
reviewRating: {
totalCount,
ratings: ratingsArray,
},
reviews,
});

// 데이터 μœ νš¨μ„± 검사
if (totalCount === 0) {
console.error("[voim] 리뷰 μˆ˜κ°€ 0μž…λ‹ˆλ‹€.");
Expand All @@ -197,7 +162,7 @@ export const collectCoupangReviewData =
};
} catch (error) {
console.error("[voim] 리뷰 데이터 μˆ˜μ§‘ 쀑 였λ₯˜:", error);
console.log("[voim] ν˜„μž¬ νŽ˜μ΄μ§€ URL:", window.location.href);

return null;
}
};
Expand All @@ -206,8 +171,6 @@ export const sendReviewSummaryRequest = (
payload: ReviewSummaryRequestPayload,
): Promise<ReviewSummaryData> => {
return new Promise((resolve, reject) => {
console.log("[voim] 리뷰 μš”μ•½ μš”μ²­ μ‹œμž‘");

chrome.runtime.sendMessage(
{
type: "FETCH_REVIEW_SUMMARY",
Expand Down Expand Up @@ -272,7 +235,6 @@ export const sendReviewSummaryRequest = (
isValidNegative &&
isValidKeywords
) {
console.log("[voim] 리뷰 μš”μ•½ μš”μ²­ 성곡");
resolve(res.data);
} else {
console.error("리뷰 μš”μ•½ 데이터 ν˜•μ‹ 였λ₯˜", {
Expand Down
2 changes: 1 addition & 1 deletion src/content/coupang/cartHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const extractCartItems = (): CartItem[] => {

export const sendCartItemsToBackground = () => {
const cartItems = extractCartItems();
console.log("[CartHandler] μΆ”μΆœλœ μž₯λ°”κ΅¬λ‹ˆ μ•„μ΄ν…œ:", cartItems);

chrome.runtime.sendMessage({
type: "CART_ITEMS_UPDATED",
data: cartItems,
Expand Down
Loading
Loading