JavaScript to determine whether the Firebug open method _javascript Skills

Source: Internet
Author: User

This article illustrates the way JavaScript determines whether Firebug is open. Share to everyone for your reference, specific as follows:

Often with Firefox + firebug debugging JavaScript friends know, one but open firebug, page JS operation will significantly slow.

Can the JavaScript of the page actively determine if the current firebug is open?

The answer is yes.

Firebug has updated a number of versions. An older version of the impression can be judged by detecting console.firebug, but it is now invalid.

The last few versions of Firebug can be judged by the console.table () method, whose return value is a string "_firebugignore"

The complete demo code is as follows:

<input type= "button" value= "Check_firebug" onclick= "Check_firebug ()" >
<script>
function Check_ Firebug () {
  if (window.console && console.firebug | | console.table &&/firebug/i.test ( Console.table ())) {
    alert (' Firebug is running ');
  } else{
    alert (' Not detected firebug ');
  }
</script>

This method also has a disadvantage, after closing Firebug, console.table () still return to "_firebugignore", need to refresh the page to do. But for most things, it's enough.

The Console.table () method is intended to be used to view a variable or object in a tabular form, and the incoming argument is the variable or object to view. return this "_firebugignore" without passing the ginseng, calculate not calculate the egg?

For example (run in Firebug console):

arr=[["AAAA", 1,2,3],["bbbb", 4,5,6];
Console.table (arr);

For more advanced usage of console.table (), you can view this here.

More readers interested in JavaScript-related content can view the site topics: "JavaScript window operations and tips summary", "JavaScript traversal algorithm and tips summary", "JavaScript switching effects and techniques summary", " JavaScript Search Algorithm Tips Summary, "JavaScript animation effects and techniques Summary", "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary" and "JavaScript Mathematical operation Summary"

I hope this article will help you with JavaScript programming.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.