-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
333 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
/** アイコン (有効) */ | ||
export const ACTION_ICONS_ENABLE = { | ||
'16': 'assets/images/icon_16.png', | ||
'32': 'assets/images/icon_32.png', | ||
'48': 'assets/images/icon_48.png', | ||
'128': 'assets/images/icon_128.png', | ||
} | ||
|
||
/** アイコン (無効) */ | ||
export const ACTION_ICONS_DISABLE = { | ||
'16': 'assets/images/icon_gray_16.png', | ||
'32': 'assets/images/icon_gray_32.png', | ||
'48': 'assets/images/icon_gray_48.png', | ||
'128': 'assets/images/icon_gray_128.png', | ||
} | ||
|
||
/** GitHub */ | ||
export const GITHUB_URL = 'https://github.com/Midra429/NCOverlay' | ||
|
||
/** dアニメストア ニコニコ支店のチャンネルID */ | ||
export const DANIME_CHANNEL_ID = 2632720 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,8 @@ | ||
import type { | ||
ChromeMessage, | ||
ChromeMessageBody, | ||
ChromeResponse, | ||
} from '@/types/chrome/message' | ||
|
||
const queue: ChromeMessage<'chrome:sendToPopup'>[] = [] | ||
let running: Promise<ChromeResponse> | null = null | ||
|
||
const run = (message?: ChromeMessage<'chrome:sendToPopup'>) => { | ||
if (message) { | ||
running = chrome.runtime | ||
.sendMessage(message) | ||
.finally(() => run(queue.shift())) | ||
} else { | ||
running = null | ||
} | ||
} | ||
import type { ChromeMessage, ChromeMessageBody } from '@/types/chrome/message' | ||
|
||
export const sendToPopup = (body: ChromeMessageBody['chrome:sendToPopup']) => { | ||
const message: ChromeMessage<'chrome:sendToPopup'> = { | ||
chrome.runtime.sendMessage<ChromeMessage<'chrome:sendToPopup'>>({ | ||
type: 'chrome:sendToPopup', | ||
body: body, | ||
} | ||
|
||
if (running) { | ||
queue.push(message) | ||
} else { | ||
run(message) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { ChromeMessage, ChromeMessageBody } from '@/types/chrome/message' | ||
|
||
export const setAction = (body: ChromeMessageBody['chrome:action']) => { | ||
chrome.runtime.sendMessage<ChromeMessage<'chrome:action'>>({ | ||
type: 'chrome:action', | ||
body: body, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { ChromeMessage, ChromeMessageBody } from '@/types/chrome/message' | ||
|
||
export const setActionBadge = ( | ||
body: ChromeMessageBody['chrome:action:badge'] | ||
) => { | ||
chrome.runtime.sendMessage<ChromeMessage<'chrome:action:badge'>>({ | ||
type: 'chrome:action:badge', | ||
body: body, | ||
}) | ||
} |
Oops, something went wrong.