Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery pageWorker不能处理Facebook上的所有页面_Jquery_Firefox Addon_Firefox Addon Sdk - Fatal编程技术网

Jquery pageWorker不能处理Facebook上的所有页面

Jquery pageWorker不能处理Facebook上的所有页面,jquery,firefox-addon,firefox-addon-sdk,Jquery,Firefox Addon,Firefox Addon Sdk,我正在编写一个firefox扩展来读取隐私设置。我使用PageWorkers浏览不同的网站。不过,有些网站正在查找,而其他网站则无法打开 function visitWebsite(url, flowURL){ var profile_website = pageWorkers.Page({ contentURL: url, contentScriptFile: [data.url('jquery-1.6.4.js'), flowURL,

我正在编写一个firefox扩展来读取隐私设置。我使用PageWorkers浏览不同的网站。不过,有些网站正在查找,而其他网站则无法打开

function visitWebsite(url, flowURL){
var profile_website = pageWorkers.Page({
  contentURL: url,
  contentScriptFile: [data.url('jquery-1.6.4.js'),
                      flowURL,
                      data.url('extract_algorithm.js'),
                      data.url('ProfileSettings/profile_controller.js')],
  contentScriptWhen: "ready"
});

//event triggers, when all profile settings were loaded from a site from profile_controller
profile_website.port.on('profile_results', function(profile_results){    
    add_to_all_results(profile_results);
});
}


function checkProfileSettings(){
visitWebsite("http://www.facebook.com/editprofile.php?sk=basic", data.url('ProfileSettings/Flow_Site1.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=relationships", data.url('ProfileSettings/Flow_Site2.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=eduwork", data.url('ProfileSettings/Flow_Site3.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=philosophy", data.url('ProfileSettings/Flow_Site4.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=entertainment", data.url('ProfileSettings/Flow_Site5.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=sports", data.url('ProfileSettings/Flow_Site6.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=activities", data.url('ProfileSettings/Flow_Site7.js'));
visitWebsite("http://www.facebook.com/editprofile.php?sk=contact", data.url('ProfileSettings/Flow_Site8.js')); 
}
Flow\u SiteX.js
包含用于读取的参数,但我使用profile\u controller.js中的
console.log($('.label').text())
对其进行了测试。每个站点中至少有一个类带有
.label
,因此应该有一个输出。网站的基本功能、人际关系、理念和娱乐功能始终完美运行。但寻呼机似乎根本不开放体育或活动!?教育工作有时有效,有时无效。 嗯,我不明白为什么有些网站在工作,而有些没有。。。我尝试了
checkProfileSettings()
,例如,仅对运动项目进行了测试,因为我认为内存或其他内容已满,但也无法正常工作

谢谢!:)

编辑:我写了一个小测试

main.js

var data = require("self").data;
var pageWorkers = require("page-worker");
var timers = require("timers");

function TestvisitWebsite(url, flowURL){
var profile_website = pageWorkers.Page({
  contentURL: url,
  contentScriptFile: [data.url('jquery-1.6.4.js'),
                      data.url('script.js')],
  contentScriptWhen: "ready"
});
}
function testcheck()
{
  TestvisitWebsite("http://www.facebook.com/editprofile.php?sk=sports", "aaa");    
}
var timeout = timers.setInterval(function() 
{
    testcheck();
}, 1000);
script.js:

function combobox_by_name(ID_of_name){
console.log("Testoutput - " + $('select[name=audience\\[' + ID_of_name + '\\]\\[value\\]] option:selected').text());
}

combobox_by_name(129991670408857);
有趣的输出如下所示:


Freunde是德语中“friends”的意思,是正确的输出,但只是有时!?例如,当我尝试使用它时,它总是有效的

它可能是一个竞争条件(即facebook在就绪事件后加载您正在查找的元素)

它可能是一个竞争条件(即facebook在就绪事件后加载您正在查找的元素)

安装扩展并检查实际加载的内容以及服务器如何响应可能是个好主意。谢谢您的提示。我为体育运动写了一个小测试,它大约40%的时间都在工作。我和HttpFox查过了,他每次都能找到内容完整的页面。。。所以页面工作者正确地获取了整个页面,但他只是偶尔扫描它!?有趣的是,它只出现在一些页面上??pageworkers是否存在已知错误?安装扩展并检查实际加载的内容以及服务器如何响应可能是个好主意。谢谢您的提示。我为体育运动写了一个小测试,它大约40%的时间都在工作。我和HttpFox查过了,他每次都能找到内容完整的页面。。。所以页面工作者正确地获取了整个页面,但他只是偶尔扫描它!?有趣的是,它只出现在一些页面上??pageworkers是否存在已知的bug?