views:

84

answers:

1

Hello all,

My chrome extension needs to send requests to a server on my home LAN, where I don't have DNS setup, so I'm using raw IP's with everything. I'm sending these requests via my background page, so with proper permissions in the manifest file it should let me do it. This is what I have in the manifest:

"permissions": [
    "http://10.0.0.4:3000/*","http://*/*"
]

However with the http sniffer I see that no requests are sent out to that destination. via logging I see that the jQuery $.ajax() call is reached:

$.ajax({ url: url,
         type: 'POST',
         timeout: 500,
         context: document.body,
         success: function(){} });

I've read this thread, which directed me to make http requests from the background page.

Question: do you guys think that using raw IPs is causing the request to be dropped by chrome?

Thanks.

+1  A: 

No, using raw IPs is not the problem. I just tried getting my router's page through its IP from an extension with universal permissions (http://*/*) and it worked fine. Two notes about your code though:

  1. You're doing a POST but not specifying any data. I'm not sure if that's legal.
  2. There was a missing closing brace in your example. I edited it in, assuming it's a typo, but perhaps that's the problem.
Max Shawabkeh
thanks max, very brightly (on my behalf) I was missing the data parameter in the jquery call... I was including it in the url without giving it a second though, only to now realize that Im posting and not getting hence the data param has to be used. thanks for pointing that out. the semicolon was a typo... so now Im seeing the requests Im making in the servers log, but it still doesnt show in the http sniffer as being sent out, which is pretty strange... Im on win32 using EffeTech HTTP Sniffer. either way, thank you for your time, its appreciated!
deepblue

related questions