我正在尝试为Opera编写我的第一个扩展。它的快速延伸。 我希望它向我展示一些来自网站的数据,但要访问这些数据我需要登录。如何在opera扩展中共享cookie?
我已登录,并且歌剧知道它;-)(当我在Opera的地址中键入网站的地址时酒吧,那么一切正常)。我想让歌剧告诉JS,我登录;-)
但是,当我试图在js中获得该网站,我得到的文字,说,我需要先登录:
r_xmlhttp.open("GET",url,true);
//r_xmlhttp.withCredentials = 'true'; //even with that on, nothing changes.
r_xmlhttp.onreadystatechange = user_func;
r_xmlhttp.send();
我的config.xml(that`s一个从教程;-),添加ACCES起源和特性歌剧:股饼干:
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" id="http://example.com/SimpleClockSD" defaultlocale="en" viewmodes="minimized">
<name short="Simple Clock">Clock Speed Dial Extension</name>
<description>This is an example Speed Dial extension showing a simple clock.</description>
<author href="http://people.opera.com/danield/">Daniel Davis</author>
<icon src="images/icon_64.png"/> <!-- Icon source: http://www.openclipart.org/detail/17552 -->
<feature name="opera:share-cookies" required="false"/>
<access origin="http://wykop.pl" subdomains="true"/>
<feature name="opera:speeddial" required="false">
<param name="url" value="http://wykop.pl"/>
</feature>
</widget>
我抬头一看是怎么回事使用Wireshark,我可以告诉大家,歌剧发送其他饼干比JS,这就是为什么JS说我没有登录。但我想JS发送相同的cookie是歌剧发送,理论上它应该这样做,因为我添加了名为“opera:share-cookies”的功能,对吧?
我该怎么做?