Anyone who often uses Firefox + Firebug to debug javascript knows that once firebug is enabled, page js running will be significantly slower. Can the page javascript determine whether the current Firebug is enabled? The answer is yes. Firebug has updated many versions .... SyntaxHighli
Anyone who often uses Firefox + Firebug to debug javascript knows that once firebug is enabled, page js running will be significantly slower.
Can the page javascript determine whether the current Firebug is enabled?
The answer is yes.
Firebug has updated many versions. In the impression, an old version can be determined by detecting console. firebug, but it is no longer valid.
In recent versions of firebug, you can use the console. table () method to determine that the returned value is a string "_ firebugIgnore"
The complete demo code is as follows:
[Html]
1.
2. script
3. function check_firebug (){
4. if (window. console & (console. firebug | console. table &/firebug/I. test (console. table ()))){
5. alert ('firebug is running ');
6.} else {
7. alert ('no Firebug detected ');
8.
}
9 .}
10. script
This method also has a disadvantage. After the firebug is disabled, the console. table () still returns "_ firebugIgnore", and the page needs to be refreshed. But in most cases, it is enough.
The console. table () method is used to view variables or objects in a table. input parameters are the variables or objects to be viewed. This "_ firebugIgnore" is returned without passing the parameter. Isn't it an egg?
Example (run in firebug console ):
[Javascript]
1. arr = [["aaaa", 3], ["bbbb", 6];
2. console. table (arr );
For more advanced usage of console. table (), see http://www.softwareishard.com/blog/firebug/tabular-logs-in-firebug /.
From unintentional Columns