2011-12-16 33 views
1

我已经安装ConsoleExport Firebug扩展。通过将extensions.firebug.consoleexport.active设置为true,我已启用自动导出功能about:config。我打开了一个包含JavaScript错误的页面,例如http://www.random.org。我已启用Firebug,重新加载页面。我可以看到在日志中的错误:如何捕获ConsoleExport Firebug扩展发送的XML数据包?

uncaught exception: Error: Permission denied for <https://www.facebook.com> to get property Proxy.InstallTrigger 

ConsoleExport页说:

您也可以激活自动导出功能,在发送 单独登录到指定的服务器作为XML数据包。

我知道我应该将extensions.firebug.consoleexport.serverURL设置为服务器URL。我不知道如何捕获ConsoleExport发送的XML数据包。

例如,我知道如何在Mac上设置Apache,但那又如何?如何捕获XML数据包?

环境:

  • 的Mac OS X 10.7.2
  • 火狐8.0.1
  • 萤火虫1.8.4
  • ConsoleExport 0.5b4

我有Windows访问和Linux机器,如果捕获XML数据包的服务器更容易在那里设置。

回答

2

修改脚本获取发布数据确定一个问题:

注意,发布数据的内容类型是application/XML

<?php 
    $filename = 'consoleexport.log'; 

    if (!$handle = fopen($filename, 'a')) 
    { 
    echo 'File "'.$filename.'" could not be opened'; 
    exit; 
    } 

    ob_start(); 
    $content = file_get_contents('php://input'); 
    $content .= "\n"; 
    ob_clean(); 

    if (!fwrite($handle, $content)) 
    { 
    echo 'Can\'t write into file "'.$filename.'"'; 
    exit; 
    } 

    echo 'Done!'; 
    fclose($handle); 
?> 

洪扎

的努力
+0

谢谢,这个脚本的作品。 – 2011-12-23 10:19:06

1

听起来就像它只是通过AJAX请求发送XML数据到该URL。 所以你需要定义一个处理XML数据的脚本。

例如当您使用PHP时,您可以将serverURL首选项设置为http://localhost/handleFBConsoleOutput.php。该脚本可能如下所示:

<?php 
    $filename = '/path/to/log/file/consoleexport.log'; 

    if (!$handle = fopen($filename, 'a')) 
    { 
    echo 'File "'.$filename.'" could not be opened'; 
    exit; 
    } 

    ob_start(); 
    var_dump($_POST); 
    $content = ob_get_contents(); 
    ob_clean(); 

    if (!fwrite($handle, $content)) 
    { 
    echo 'Can\'t write into file "'.$filename.'"'; 
    exit; 
    } 

    echo 'Done!'; 
    fclose($handle); 
?> 

此处显示的代码写入所有POST参数的转储。您可能希望通过将$content变量替换为$_POST['param_name'](其中param_name是保存XML内容的参数的名称)并删除ob_start(); ... ob_clean();块来指定确切的参数作为输出。

作为参考: 同样的问题在Firebug discussion group被问到。

+0

谢谢,但看起来像一两​​条线是错误的。 :) – 2011-12-23 10:20:01

相关问题