mirror of
https://github.com/skidoodle/hostinfo
synced 2025-03-16 13:59:38 +01:00
firefox support beta
This commit is contained in:
parent
862be4f924
commit
971a980def
6 changed files with 29 additions and 11 deletions
|
@ -3,9 +3,9 @@ export async function updateIcon(countryCode: string | null) {
|
|||
countryCode?.match(/^[A-Z]{2}$/i)?.[0]?.toLowerCase() || 'unknown'
|
||||
|
||||
const loadImageBitmap = async (code: string): Promise<ImageBitmap> => {
|
||||
const url = chrome.runtime.getURL(`${code}.webp`)
|
||||
const url = browser.runtime.getURL("/")
|
||||
try {
|
||||
const response = await fetch(url)
|
||||
const response = await fetch(url + `${code}.webp`)
|
||||
if (!response.ok) throw new Error('Flag not found')
|
||||
const blob = await response.blob()
|
||||
return await createImageBitmap(blob)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue