Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/454.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
Javascript 如何在运行时以编程方式启用/禁用Firebug Lite?_Javascript_Firebug Lite - Fatal编程技术网

Javascript 如何在运行时以编程方式启用/禁用Firebug Lite?

Javascript 如何在运行时以编程方式启用/禁用Firebug Lite?,javascript,firebug-lite,Javascript,Firebug Lite,如何在运行时显示或隐藏整个Firebug面板及其图标 我浏览了Firebug.chrome,但找不到任何合适的东西。 我尝试了下面的代码片段,但没有任何明显的效果,Firebug Lite仍然存在 Firebug.extend(function (FBL) { alert('TEST'); // This is run FBL.Firebug.chrome.deactivate(); // No errors but nothing happens }); 匿名回调函数肯定会被

如何在运行时显示或隐藏整个Firebug面板及其图标

我浏览了Firebug.chrome,但找不到任何合适的东西。 我尝试了下面的代码片段,但没有任何明显的效果,Firebug Lite仍然存在

Firebug.extend(function (FBL) {
    alert('TEST'); // This is run
    FBL.Firebug.chrome.deactivate(); // No errors but nothing happens
});

匿名回调函数肯定会被调用。

Firebug Lite是通过书签中的javascript函数启用的,从那里它只加载托管在getfirebug.com上的javascript

如果您控制正在查看的网站,并希望该网站弹出firebug,则可以将其添加到代码中:

<script type="text/javascript">
    function bookmarklet(F,i,r,e,b,u,g,L,I,T,E){
           if(F.getElementById(b))
               return;
           E=F[i+'NS']&&F.documentElement.namespaceURI;
           E=E?F[i+'NS'](E,'script'):F[i]('script');
           E[r]('id',b);
           E[r]('src',I+g+T);E[r](b,u);
           (F[e]('head')[0]||F[e]('body')[0]).appendChild(E);
           E=new Image;
           E[r]('src',I+L);
       }

    $(document).ready(function() {
           bookmarklet(document,'createElement','setAttribute',
               'getElementsByTagName','FirebugLite','4','firebug-lite.js',
               'releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');             
    });         
</script>

函数bookmarklet(F,i,r,e,b,u,g,L,i,T,e){
if(F.getElementById(b))
返回;
E=F[i+'NS']&&F.documentElement.namespaceURI;
E=E?F[i+'NS'](E,'script'):F[i]('script');
E[r]('id',b);
E[r]('src',I+g+T);E[r](b,u);
(F[e]('head')[0]| | F[e]('body')[0]);
E=新图像;
E[r]('src',I+L);
}
$(文档).ready(函数(){
bookmarklet(文档、'createElement'、'setAttribute',
'getElementsByTagName'、'FirebugLite'、'4'、'firebug-lite.js',
“releases/lite/latest/skin/xp/sprite.png”https://getfirebug.com/","开始",;
});         

或者,你的意思是,当你浏览网页时,你总是希望Firebug/Firebug Lite位于底部吗?

这是一篇相当古老的帖子,但仍然会在谷歌搜索中弹出这样一个问题

我甚至不确定您使用的是哪个版本的Firebug Lite,但以下内容适用于1.4.0(一旦页面加载):


这与加载脚本无关,而是在同一页面上启用/禁用脚本。它适用于基于web技术的应用程序,其中Firebug Lite与软件捆绑在一起。好的。如果你与页面有JS交互,为什么不定义bookmarklet函数然后使用它呢?然后,您只需找出如何以编程方式禁用它--可能通过$(“#fbWindow_btDeactivate”)之类的方式。单击()?按原样使用bookmarklet没有任何意义。可以通过创建脚本标记来控制加载。有趣的一点是正确的禁用和重新启用,这就是为什么我首先要问的。好吧,对不起,你没有很好地解释你的问题。请记住,即使您确实找到了以编程方式启用/禁用它的方法,Firebug也会在页面中查找自己的脚本标记,如果找不到它,它会出错。我想我已经解释得相当清楚了-问题是在运行时启用和禁用。。。无论什么
Firebug.chrome.open();
Firebug.chrome.close();
Firebug.chrome.toggle();