0

I would like to redirect a search query to google from a chrome extension but google/chrome does not allow it.

I'm to ask a simple link that will redirect to the following: https://www.google.com/search?q=tesla+news. But since my domain is (for example) www.tesla-news.com I cannot redirect to google.com/search?q=tesla+news but just to redirect to tesla-news.com/search?q=tesla+news. And also allow people to search themselves within google chrome extension and simply redirect them to google.

I was thinking of doing some kind of simple re directing in server side? For example - getting tesla-news.com/search?q=tesla+news in my site and redirecting to https://www.google.com/search?q=tesla+news.

Does anybody have an idea how to solve it?

Thanks!

EliK
  • 157
  • 1
  • 2
  • 4
  • What have you tried to far? – Mark Santos Nov 17 '19 at 22:45
  • If you want Google results on your own site then you should use the Google Search API... https://developers.google.com/custom-search/v1/overview – Reinstate Monica Cellio Nov 17 '19 at 23:00
  • Extensions can do it using chrome.webRequest.onBeforeRequest event, look for examples. However it's unclear where exactly in the user's workflow you want to perform the redirection. – wOxxOm Nov 18 '19 at 04:15
  • 1) I didn't try anything so far as I don't know how to approach it.. 2) Google custom search is not a good option as it gives you a results in a page that is not similar to regular google. 3) onBeforeRequest will give the same results- google will block any request that is not coming from your own domain.. – EliK Nov 18 '19 at 07:23

0 Answers0