ykethan
ykethan
PD🧩 Plasmo Developers
Created by ykethan on 6/6/2024 in #🔰newbie
redirect between tabs page and content
Hey, i trying to create a extension that put a button in a github issue. In the simplest form all the button does is 2 api calls. But the additive is i want to add auth and found tab pages are the go to for this. The idea is when the button is clicked the user is redirected to tab page, where they log in, i then redirect them back to github issue. I wasnt sure how i could redirect them to the tab page. tried:
chrome.tabs.create({
url: `chrome-extension://${chrome.runtime.id}/tabs/auth.html`
})
chrome.tabs.create({
url: `chrome-extension://${chrome.runtime.id}/tabs/auth.html`
})
but get Cannot read properties of undefined (reading 'create') the runtime id does seem to work
update: looks like i need to pass this to the background as message which seems to work. now to figure out to to redirect back from the tabs page after the auth and store the auth info any suggestion on improving this idea would are also appreciated. for the auth i am using amplify auth found this thread for the suggestion https://discord.com/channels/946290204443025438/1070189779838324807/1070254686118092801
3 replies