Login to a webpage from my chrome extension
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. fol开发者_开发问答lowing 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);
}
If you ask how you can emulate login form submission see this answer.
精彩评论