diff --git a/firefox/background.js b/firefox/background.js index 6d18fd5..e9b8e32 100644 --- a/firefox/background.js +++ b/firefox/background.js @@ -1,8 +1,50 @@ const homepageUrl = "https://startyparty.dev/"; // Click Icon -chrome.browserAction.onClicked.addListener((tab) => { - chrome.tabs.update(tab.id, { url: homepageUrl, loadReplace: true }); +chrome.browserAction.onClicked.addListener(async (tab) => { + // chrome.tabs.update(tab.id, { url: homepageUrl, loadReplace: true }); + // const response = await fetch('https://your-remote-endpoint.com/', { + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json' + // }, + // body: JSON.stringify({ + // url: tab.url, + // title: tab.title, + // favIcon: tab.favIconUrl + // }) + // }); + + // if (response.ok) { + // console.log('Webpage info sent successfully'); + // } else { + // console.error('Failed to send webpage info', response); + // } + + console.log("running check") + // fetch("https://startyparty.dev/api/auth/session", { + // mode: 'cors', + // headers: { + // "Allow-Control-Allow-Origin": "*", + // }, + // }) + // .then(response => response.json()) + // .then((session) => { + // if (Object.keys(session).length > 0) { + // onSuccess(session) + // } else { + // onSuccess(null) + // } + // }) + // .catch(err => { + // console.error(err); + // onSuccess(null) + // }) + + console.log(tab); + + return true; // Will respond asynchronously. + }); // Open New Window