0

I 'd like to login to a webpage from my google chrome extension. and that webpage is not running in the background tab. so any ideas ?

My website uses regular login system. following is the code that calls the web service.

$(document).ready(function () {

$('#submit').click(function() {

$.ajax(
{

type: "POST",
url: "http://localhost:1204/ChromeExtensionService.asmx/HelloWorld",
//data: '{"id":"' + currentObjId.toString() + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {

alert('here');
alert(msg.d);
},

error: function (xhr, textStatus, errorThrown) {

alert(xhr.responseText);
}
thenewjames
  • 966
  • 2
  • 14
  • 25
ismail
  • 1
  • 1
  • 1
  • 1
    I guess that might be a security threat and browsers should keep you from trying it. Still I think it's possible. – Eduardo May 09 '11 at 17:17
  • I'm trying to call a web service from my website and whenever I try to call it right away , I get an authentication error, any ideas how solve this ? – ismail May 09 '11 at 18:46
  • Dude, don't post updates as answers. Edit your question instead. Stackoverflow isn't a forum! – dandan78 May 11 '11 at 19:06
  • okay , sorry about that. i'm kinda getting used to how things work around here :) – ismail May 12 '11 at 00:00

1 Answers1

0

If you ask how you can emulate login form submission see this answer.

Community
  • 1
  • 1
serg
  • 109,619
  • 77
  • 317
  • 330
  • thanks serg :) . actually, I'm trying to call a web service from my website and whenever I try to call it right away , I get an authentication error, any ideas how solve this ? – ismail May 09 '11 at 18:46
  • @ismail You need to provide some code and explain what sort of authentication is installed on your webservice. – serg May 09 '11 at 19:02
  • sorry for the late reply. my website uses regular login system. following is the code that calls the web service. $(document).ready(function () { $('#submit').click(function() { $.ajax( { type: "POST", url: "http://localhost:1204/ChromeExtensionService.asmx/HelloWorld", //data: '{"id":"' + currentObjId.toString() + '"}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { alert('here'); alert(msg.d); }, error: function (xhr, textStatus, errorThrown) { alert(xhr.responseText); } – ismail May 10 '11 at 23:00