1

i want set my own web proxy in google chrome to get all the web pages from my server. I know that we can set a web proxy server from the settings but what i want is also pass parameters to the server, so instead of that : 24.33.20.87:8888 i want redirect the pages to here : 24.37.47.30:8888/cgi-bin/mgetpage?tm=567567567&send=0&murl=google.com

Do you have an idea how to do it please? Thanks in advance

Alaoui Ghita
  • 1,859
  • 4
  • 22
  • 26
  • That's not a proxy (from the viewpoint of a browser), that's just some website that acts similar to a proxy. – ThiefMaster Jun 04 '12 at 20:32
  • i have already a proxy server, in this server i get the url of every requested web page, get the page from the web, make some content transformation and then send the new template to the user, that's what my program wants to do, but to do that i have to redirect all the request web pages to my server with some parameters, i.e., when the user enter "google.com" in the bar address, i need to redirect the request to my sever with some parameters, like that : 24.37.47.30:8888/cgi-bin/mgetpage?tm=567567567&send=0&murl=google.com – Alaoui Ghita Jun 04 '12 at 20:41

1 Answers1

1

You'll have to write an extension that captures each tab and redirects it to your custom URL if it isn't already there.

You'll need to use the Tabs API. Lets say you use getCurrent to get the current tab. You can get it's url and see if document.domain is equal to your 24.37.47.30. If it is not, you can use window.location to redirect it to:

24.37.47.30:8888/cgi-bin/mgetpage?tm=567567567&send=0&murl={tab_url}

Apparently there are some Chrome extensions that already do something like this.

https://chrome.google.com/webstore/detail/odchblbgkkchnldldakeikkjfbkllaah

https://chrome.google.com/webstore/detail/lacckjdlmkdhcacjdodpjokfobckjclh

sachleen
  • 30,730
  • 8
  • 78
  • 73
  • i'm totally new in google chrome extensions, but it seems like that it's exactly what i want, i will make search and do all what you told to me to do and hope that it will work ! thank you very much for your help ! – Alaoui Ghita Jun 04 '12 at 20:48
  • [Search](https://chrome.google.com/webstore/search/redirect%20pages) the Chrome store first to see if there's anything that you can look at the source of to learn how it's done! – sachleen Jun 04 '12 at 20:49