Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open extension in new tab #86

Open
realrecordzLab opened this issue May 17, 2020 · 2 comments
Open

open extension in new tab #86

realrecordzLab opened this issue May 17, 2020 · 2 comments

Comments

@realrecordzLab
Copy link

I've started using this plugin with vue cli ui. I want to create a new tab when the extension button is clicked, so I've selected standalone when I've configured the project in the ui. The problem is that nothing will happen if I click the extension button so now I'm confused on how to proceed with the project setup. I've added the tab permission in the manifest, is there any other step I need to do?

@adambullmer
Copy link
Owner

I think you'll need to make a background script that is responsible for opening a new tab when the browser action button is clicked. I recommend scaffolding the app with background and standalone to get the relevant manifest and boilerplate background script generated for you, and then tweaking the background handler to open a new tab

@realrecordzLab
Copy link
Author

Found the solution

browser.browserAction.onClicked.addListener( tab => {
  browser.tabs.create({ ... });
});

This will create a new tab when the extension icon is clicked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants