diff --git a/SearchTradeMark.zip b/SearchTradeMark.zip new file mode 100644 index 0000000..25e17c0 Binary files /dev/null and b/SearchTradeMark.zip differ diff --git a/content.js b/content.js index f7add6b..38fd8f7 100644 --- a/content.js +++ b/content.js @@ -23,7 +23,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { tooltipEl.style.color = "#333"; tooltipEl.style.maxWidth = "600px"; tooltipEl.style.maxHeight = "500px"; - // 전체 툴팁 컨테이너에 flex 컬럼 레이아웃 + // flex 컬럼 레이아웃으로 구성 tooltipEl.style.display = "flex"; tooltipEl.style.flexDirection = "column"; @@ -35,9 +35,10 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { headerDiv.style.background = "#fff"; headerDiv.style.padding = "12px 16px"; headerDiv.style.borderBottom = "1px solid #ccc"; - headerDiv.style.display = "flex"; - headerDiv.style.justifyContent = "space-between"; - headerDiv.style.alignItems = "center"; + // 헤더 내부: 검색 키워드와 제작자 정보를 수직 정렬 + const headerContent = document.createElement("div"); + headerContent.style.display = "flex"; + headerContent.style.flexDirection = "column"; // 검색 키워드 제목 const titleElem = document.createElement("h2"); @@ -45,9 +46,19 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { titleElem.style.margin = "0"; titleElem.style.fontSize = "20px"; titleElem.style.color = "#2c3e50"; - headerDiv.appendChild(titleElem); + headerContent.appendChild(titleElem); - // 내부 닫기 버튼 (헤더 내) + // 제작자 정보 (작은 글씨) + const creatorElem = document.createElement("span"); + creatorElem.id = "tooltip-creator"; + creatorElem.textContent = "내차는언제타냐: 지재권 검색기"; + creatorElem.style.fontSize = "12px"; + creatorElem.style.color = "#7f8c8d"; + headerContent.appendChild(creatorElem); + + headerDiv.appendChild(headerContent); + + // 내부 닫기 버튼 (헤더 우측) const headerCloseBtn = document.createElement("button"); headerCloseBtn.textContent = "닫기"; headerCloseBtn.style.padding = "6px 10px"; @@ -59,16 +70,16 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { headerCloseBtn.onclick = removeTooltip; headerDiv.appendChild(headerCloseBtn); - // 스크롤되는 본문 영역 + // 본문 영역 (스크롤 가능) const bodyDiv = document.createElement("div"); bodyDiv.id = "markinfo-tooltip-body"; bodyDiv.style.padding = "16px"; bodyDiv.style.overflowY = "auto"; - // 본문 영역은 전체 높이에서 헤더 높이를 뺀 만큼 사용 bodyDiv.style.flex = "1 1 auto"; tooltipEl.appendChild(headerDiv); tooltipEl.appendChild(bodyDiv); + document.body.appendChild(tooltipEl); // 글로벌 닫기 버튼 (항상 보이는 우측 상단) @@ -105,7 +116,6 @@ function removeTooltip() { tooltipEl.parentNode.removeChild(tooltipEl); } tooltipEl = null; - // 글로벌 닫기 버튼 제거 const globalClose = document.getElementById("tooltip-global-close"); if (globalClose && globalClose.parentNode) { globalClose.parentNode.removeChild(globalClose); @@ -136,10 +146,11 @@ function renderDetailInfo(results, keyword) { const bodyDiv = document.getElementById("markinfo-tooltip-body"); if (!bodyDiv) return; let html = `
`; + // 결과가 없을 경우 안전한 단어 표시 if (results.error) { html += `

오류: ${results.error}

`; } else if (!Array.isArray(results) || results.length === 0) { - html += `

검색 결과가 없습니다.

`; + html += `

지식재산권이 없는 안전한 단어

`; } else { results.forEach((result, idx) => { html += `
`; diff --git a/manifest.json b/manifest.json index 62fde1c..6a94719 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 3, - "name": "지재권 검색 확장 (컨텍스트 메뉴)", + "name": "내차는언제타냐 - 지재권 검색 확장 (컨텍스트 메뉴)", "version": "1.0", "description": "드래그한 텍스트를 우클릭 → '지재권 검색'으로 MarkInfo 검색을 수행하고 결과를 툴팁으로 표시합니다.", "permissions": [ diff --git a/final1/background.js b/test_final/background.js similarity index 100% rename from final1/background.js rename to test_final/background.js diff --git a/final1/icon.png b/test_final/icon.png similarity index 100% rename from final1/icon.png rename to test_final/icon.png diff --git a/final1/manifest.json b/test_final/manifest.json similarity index 100% rename from final1/manifest.json rename to test_final/manifest.json