Chrome插件开发:用户:Google Chrome不再支持pass @ url? [英] Chrome plugin development: user:pass@url not supported by Google Chrome anymore?

查看:201
本文介绍了Chrome插件开发:用户:Google Chrome不再支持pass @ url?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个Chrome插件,它使用XMLHttpRequest将带有用户名/密码的GET HTTP请求发送到受基本身份验证保护的URL,以便之后可以自动登录(因为Chrome会缓存凭据HTTP basic-auth)。



以下是我使用的代码:

  var xml = new XMLHttpRequest (); 
xml.open('GET',< url>,false,< username>,< password>)
xml.send('');

它过去很好,但很久以前就开始失败。插件代码没有改变,所以我认为它可能与Chrome本身有关。我下载了OSX(17)和BAM的旧版本,它再次运行。



经过一些额外的研究后,我发现它可能与Chrome 19不支持用户名:pwd @ url语法来验证basic-auth保护的URL,因为当我发送XMLHttpRequest时,我在Google Chrome的js控制台中看到了这一点:


GET http:// user:pass@domain.com 401(Unauthorized)


有谁知道这是一个错误还是Chrome停止支持此功能? b

谢谢,

Marcelo。

解决方案

您不是存在此问题的唯一人员。然而,鉴于来自Chromium开发者的评论:

$ b $


它看起来像故意删除了它。


I develop a Chrome plugin that uses XMLHttpRequest to send a GET HTTP request with an username/password to a basic-auth-protected URL, so that it can then "auto-login" to it afterwards (since Chrome caches credentials for HTTP basic-auth).

Here's the code I use:

  var xml = new XMLHttpRequest();
  xml.open('GET',<url>,false,<username>,<password>)
  xml.send('');

It used to work fine for quite a while, but started failing some time ago. The plugin code hasn't changed, so I thought it could have to do with Chrome itself. I downloaded a previous version for OSX (17) and BAM, it worked again.

After some additional research, I found out that it might have to do with Chrome 19 not supporting the username:pwd@url syntax for authenticating to basic-auth protected URLs, because when I send the XMLHttpRequest, I see this in Google Chrome's js console:

GET http://user:pass@domain.com 401 (Unauthorized)

Does anyone know whether it's a bug or if Chrome stopped supporting this feature?

Thanks,

Marcelo.

解决方案

You are not the only person having this issue. It's ruffled several other people's feathers.

However, given the comments from the Chromium Developers:

The support for embedded auth in URLs was intentionally deprecated.

It looks like it was removed intentionally.

这篇关于Chrome插件开发:用户:Google Chrome不再支持pass @ url?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆