Chrome extension : sending submit from background.html?

Background. Html exists in the extension context and can not directly alter pages because pages exist within their own page context. In your case background.

Html has no context for any particular page/tab when you call submit(). So you will probably need to use a content script and then communicate with it via message passing.

Thank you for help I will look more in to content script . Background. Html has some content – user766182 May 23 at 18:44 I URL1 may not be valid to have forms inside the background page.

YOu might want to look into that. – sym3tri May 24 at 0:37.

If you want to send a POST request to a web server you should use XMLHttpRequest. If you know jQuery or any other framework, they usually provide convenient wrappers for this: $. Post("some_url", { test: "...", addr: "..." }); //jQuery If not, then you can use XMLHttpRequest directly: var xhr = new XMLHttpRequest(); xhr.

Onreadystatechange=function() { if (xhr. ReadyState==4 && xhr. Status==200) { console.

Log("done"); } } xhr. Open("POST","some_url",true); xhr. SetRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr.

Send("test=TEST_VALUE&addr=ADDRESS_VALUE"); More details here.

Thank you. Looks like what I need. Is there any way in $.

Post or XMLHttpRequest to open in new tab something like target="_blank" for form. – user766182 May 24 at 14:51 @user766182 I don't think so. Here is similar problem to what you described, looks like it is a bug in Chrome (no solution): stackoverflow.Com/questions/2024240/… – serg May 24 at 15:34.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions