Javascript that detects Firebug?

Original answer: Check for the console object (created only with Firebug), like such: if (window.console && window.console.firebug) { //Firebug is enabled } Update (January 2012): The Firebug developers have decided to remove window.console.firebug. You can still detect the presence of Firebug by duck typing like if (window.console && (window.console.firebug || window.console.exception)) { //Firebug is enabled … Read more

Tools to selectively Copy HTML+CSS+JS From A Specific Element of DOM [closed]

SnappySnippet I finally found some time to create this tool. You can install SnappySnippet from Github. It allows easy HTML+CSS extraction from the specified (last inspected) DOM node. Additionally, you can send your code straight to CodePen or JSFiddle. Enjoy! Other features cleans up HTML (removing unnecessary attributes, fixing indentation) optimizes CSS to make it … Read more

Differences between socket.io and websockets

Misconceptions There are few common misconceptions regarding WebSocket and Socket.IO: The first misconception is that using Socket.IO is significantly easier than using WebSocket which doesn’t seem to be the case. See examples below. The second misconception is that WebSocket is not widely supported in the browsers. See below for more info. The third misconception is … Read more

Why does firebug add to ?

To summarize the excellent explanations given in the answers and comments by bobince, Kieron, Alohci and others: Firebug just displays the DOM of the parsed page. Due to complicated HTML parsing rules, the DOM will “differ” (in some sense) from the source HTML. In this case the TBODY element in the DOM is added by … Read more

How to inspect element for Selenium v3.6 as FireBug is not an option any more for FF 56?

If you visit the GitHub Page of FirePath, it clearly mentions that : FirePath is a Firebug extension that adds a development tool to edit, inspect and generate XPath expressions and CSS3 Selectors Now if you visit the Home Page of FireBug, it clearly mentions that : The Firebug extension isn’t being developed or maintained … Read more

Breakpoint on property change

If you don’t mind messing around with the source, you could redefine the property with an accessor. // original object var obj = { someProp: 10 }; // save in another property obj._someProp = obj.someProp; // overwrite with accessor Object.defineProperty(obj, ‘someProp’, { get: function () { return obj._someProp; }, set: function (value) { debugger; // … Read more

When does JS interpret {} as an empty block instead of an empty object?

Let’s look at the language grammar, shall we? Section 12, Statements: Statement : Block VariableStatement EmptyStatement ExpressionStatement …lots of other stuff… That’s a very fancy way of saying that a statement can be a block, a variable statement, an empty statement, an expression statement, or lots of other stuff. Notice that the first option there … Read more

Find out whether Chrome console is open

requestAnimationFrame (Late 2019) Leaving these previous answers here for historical context. Currently Muhammad Umer’s approach works on Chrome 78, with the added advantage of detecting both close and open events. function toString (2019) Credit to Overcl9ck’s comment on this answer. Replacing the regex /./ with an empty function object still works. var devtools = function() … Read more