Skip to content

Commit

Permalink
설치 시 기본 이모티콘 추가 및 스토어 링크 열기
Browse files Browse the repository at this point in the history
  • Loading branch information
dn1t committed Jan 18, 2023
1 parent fc14503 commit 87c16a0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
chrome.runtime.onInstalled.addListener(async (details) => {
if (details.reason == "install") {
const ids = (await chrome.storage.sync.get(["emoticons"])).emoticons ?? [];
if (ids.length === 0) {
await chrome.storage.sync.set({ emoticons: ["6049a7d7cea5c400506e9bee", "63a15d244a098f0076fbcf6f"] });
chrome.tabs.create({ url: "https://dutmoticon.tica.fun" });
}
}
});

chrome.tabs.onUpdated.addListener((tabId, info) => {
if (
!info.url?.startsWith("http://localhost:3000/emoticon/") &&
Expand Down

0 comments on commit 87c16a0

Please sign in to comment.