0

Here's sample code

useEffect(() => { // eslint-disable-next-line no-undef chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { setCurrentUrl(tabs[0].url); }); }, []);

I could get the current URL using about code

ionosphere
  • 373
  • 2
  • 13
kkg
  • 1
  • 2
  • Could you elaborate on what your question is? If your goal is to get the url, then you can do so with Web APIs that aren’t Chrome specific like `window.location.href`. Is there a reason why you need this to be browser specific? – ionosphere May 26 '23 at 13:59
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 26 '23 at 21:23

0 Answers0