John
PD🧩 Plasmo Developers
•Created by John on 5/2/2024 in #👟framework
How to create a new tab from a router?
update: I was able to use useLocation to solve this:
export const Routing = () => {
const location = useLocation();
useEffect(() => {
if (location.pathname === "/") {
openLoginTab();
}, [location]);
const openLoginTab = () => {
chrome.tabs.create({url: 'chrome-exension://{x}/newtab/login'});
};
where the routes are the same as above
hovever; now I am facing an issue where the new tab is blocked by brave browser. There is nothing but straight jsx on the login page (no api call or anything); how could i solve this?
3 replies