Safari 5的扩展XMLHtt prequest错误:INVALID_STATE_ERR:DOM异常11异常、错误、prequest、XMLHtt

2023-09-11 01:35:57 作者:_回忆`并不悲伤

我尝试用新的Safari 5的扩展JS API,我有从地上权的问题,我想用一个XMLHtt prequest拿到然而于从。发送一个网站,一个RSS feed( )就立刻揭开序幕错误:

I am experimenting with the new Safari 5 extensions JS API and I am having an issue right from the ground up, I want to use an XMLHttpRequest to get an RSS feed from a website however upon the .send() it immediatly kicks off errors:

无法加载资源:取消

然后在看XMLHtt prequest对象说,在状态:错误:INVALID_STATE_ERR:DOM异常11

Then looking at the XMLHttpRequest object is says in status: Error: INVALID_STATE_ERR: DOM Exception 11

我不知道为什么,但这是我的code,我希望我能得到一些建议,以什么去错了:

I don't know why but this is my code, I hope I can get some advice as to whats going wrong:

var xml = new XMLHttpRequest();
xml.open('GET', 'http://year3.gdnm.org/feed/');
xml.send();

在此先感谢。

Thanks in advance.

推荐答案

确认,在扩展生成器,你已经给到现场分机接入。在标题扩展网站访问设置的访问级别为全部或将其设置为部分,并提供year3.gdnm.org作为允许的域模式。

Make sure that in Extension Builder you have given your extension access to the site. Under the heading "Extension Website Access" set the access level to "all" or set it to "some" and provide "year3.gdnm.org" as an allowed domain pattern.