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.