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

chrome.search example #605

Open
guest271314 opened this issue Jun 6, 2021 · 7 comments · May be fixed by #1106
Open

chrome.search example #605

guest271314 opened this issue Jun 6, 2021 · 7 comments · May be fixed by #1106
Assignees

Comments

@guest271314
Copy link

Are there any examples of chrome.search https://developer.chrome.com/docs/extensions/reference/search/?

@dabjulmaros
Copy link

is there a link to the search api example?
doing
"permissions": ["search"]
in the manifest and

 chrome.search.query(
      { text: document.querySelector('input').value }
    ).then(e => console.log(e))

in my script returns
Cannot read properties of undefined (reading 'query')

@dabjulmaros
Copy link

Found the solution.
To be able to use the search api you also need to have permission to the tabs api.
so to fix my code all I had to do was modify my manifest to add
"permissions": ["tabs","search"]
If that information is mentioned anywhere in the search api reference Im blind cause I didnt saw it.

@jpmedley
Copy link
Contributor

I'm not sure why this was closed, since we don't have a search example.

@jpmedley jpmedley reopened this Jul 10, 2023
@jpmedley
Copy link
Contributor

cc: @patrickkettner

@Pask00
Copy link
Contributor

Pask00 commented Feb 23, 2024

I would like to write a sample for this!

My idea is the following: clicking on the extension icon a popup will appear, from there you can type the search query and choose where it should be opened (current tab, new tab etc.).

@oliverdunk
Copy link
Member

Thanks @Pask00, that sounds like a good plan. I'll assign you to this issue.

@Pask00 Pask00 linked a pull request Feb 23, 2024 that will close this issue
@locallhostcl

This comment was marked as spam.

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

Successfully merging a pull request may close this issue.

6 participants