firefox support beta

This commit is contained in:
skidoodle 2025-03-15 19:41:30 +01:00
parent 862be4f924
commit 971a980def
No known key found for this signature in database
6 changed files with 29 additions and 11 deletions

View file

@ -1,3 +1,8 @@
import { useState, useEffect } from 'react';
import browser from 'webextension-polyfill';
import { isPrivateIP } from '@/utils';
import { FetchServerInfoRequest, FetchServerInfoResponse, ServerData } from '@/utils/model';
export function useTabData() {
const [data, setData] = useState<ServerData | null>(null)
const [loading, setLoading] = useState(true)
@ -6,7 +11,7 @@ export function useTabData() {
useEffect(() => {
const fetchData = async () => {
try {
const [tab] = await chrome.tabs.query({
const [tab] = await browser.tabs.query({
active: true,
currentWindow: true,
})
@ -43,7 +48,7 @@ export function useTabData() {
})
}
const response = await chrome.runtime.sendMessage({
const response = await browser.runtime.sendMessage<FetchServerInfoRequest, FetchServerInfoResponse>({
type: 'FETCH_SERVER_INFO',
hostname: hostname,
})