diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9a645a6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 cho yeon seop + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/background.js b/background.js new file mode 100644 index 0000000..d08d17f --- /dev/null +++ b/background.js @@ -0,0 +1,34 @@ +/** +* --------------------------------------------------------------------------------- +* | 백그라운드 | +* --------------------------------------------------------------------------------- +* - 디폴트 컬러를 지정하여 스토리지 API 를 호출하여 지정한 색을 저장시킵니다. +**/ +let color = '#3aa757'; + + +chrome.runtime.onInstalled.addListener(() => { + chrome.storage.sync.set({ color }); + console.log('기본 배경색은 %cgreen', `color: ${color}`); +}); + +chrome.webNavigation.onCompleted.addListener((details) => { + // console.log("details.url", details.url) + console.log(`B`); + if (details.frameId === 0 && details.url.includes("booktoki")) { + console.log(`A`); + chrome.scripting.executeScript({ + target: { tabId: details.tabId }, + function: () => { + const title = document.title; + alert(`Page Title: ${title}\nPage Load Complete!`); + } + }); + } else { + console.log(`Page Title: ${title}\nis not target Page!`); + } +}); + +chrome.runtime.onInstalled.addListener(() => { + console.log('Page Load Notifier installed.'); +}); diff --git a/button.css b/button.css new file mode 100644 index 0000000..66b2a79 --- /dev/null +++ b/button.css @@ -0,0 +1,13 @@ +button { + height: 30px; + width: 30px; + outline: none; + margin: 10px; + border: none; + border-radius: 2px; +} + +button.current { + box-shadow: 0 0 0 2px white, + 0 0 0 4px black; +} \ No newline at end of file diff --git a/images/icons8-color-128.png b/images/icons8-color-128.png new file mode 100644 index 0000000..9a58e15 Binary files /dev/null and b/images/icons8-color-128.png differ diff --git a/images/icons8-color-16.png b/images/icons8-color-16.png new file mode 100644 index 0000000..62449e9 Binary files /dev/null and b/images/icons8-color-16.png differ diff --git a/images/icons8-color-32.png b/images/icons8-color-32.png new file mode 100644 index 0000000..9efa7bd Binary files /dev/null and b/images/icons8-color-32.png differ diff --git a/images/icons8-color-48.png b/images/icons8-color-48.png new file mode 100644 index 0000000..863937e Binary files /dev/null and b/images/icons8-color-48.png differ diff --git a/images/icons8-color-64.png b/images/icons8-color-64.png new file mode 100644 index 0000000..fd2bec4 Binary files /dev/null and b/images/icons8-color-64.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..80cc44c --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "name": "배경색 변경 크롬 확장 프로그램", + "description": "웹 페이지의 배경색을 변경해 주는 크롬 확장 프로그램입니다.", + "version": "0.1.003", + "manifest_version": 3, + "background": { + "service_worker": "background.js" + }, + "permissions": [ + "storage", + "activeTab", + "scripting", + "webNavigation"], + "host_permissions": [ + "https://lunaticbum.kr/", + "https://booktoki468.com/" + ], + "icons": { + "16": "/images/icons8-color-16.png", + "32": "/images/icons8-color-32.png", + "48": "/images/icons8-color-48.png", + "128": "/images/icons8-color-128.png" + }, + "options_page": "options.html" +} diff --git a/options.html b/options.html new file mode 100644 index 0000000..3a36b29 --- /dev/null +++ b/options.html @@ -0,0 +1,14 @@ + + + +
+ + + + +배경색 변경
+