Google Chrome console.log() inconsistency with objects and arrays

After a lot of digging, I found that this has been reported as a bug, fixed in Webkit, but apparently not yet pulled into Google Chrome. As far as I can tell, the issue was originally reported here: https://bugs.webkit.org/show_bug.cgi?id=35801 : Description From mitch kramer 2010-03-05 11:37:45 PST 1) create an object literal with one or … Read more

Using Chrome’s Element Inspector in Print Preview Mode?

Note: This answer covers several versions of Chrome, scroll to see v52, v48, v46, v43 and v42 each with their updated changes. Chrome v52+: Open the Developer Tools (Windows: F12 or Ctrl+Shift+I, Mac: Cmd+Opt+I) Click the Customize and control DevTools hamburger menu button and choose More tools > Rendering settings (or Rendering in newer versions). … Read more

After calling chrome.tabs.query, the results are not available

Your problem can be simplified to: /*1.*/ var fourmTabs = []; /*2.*/ chrome.tabs.query({}, function(tabs) { /*3.*/ fourmTabs[0] = tabs[0]; /*4.*/ }); /*5.*/ console.log(fourmTabs[0]); You expect that the fourmTabs array is updated (by line 3) when line 5 is reached. That is wrong, because the chrome.tabs.query method is asynchronous. In an attempt to make you understand … 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

Why does my XPath query (scraping HTML tables) only work in Firebug, but not the application I’m developing?

The Problem: DOM Requires <tbody/> Tags Firebug, Chrome’s Developer Tool, XPath functions in JavaScript and others work on the DOM, not the basic HTML source code. The DOM for HTML requires that all table rows not contained in a table header of footer (<thead/>, <tfoot/>) are included in table body tags <tbody/>. Thus, browsers add … Read more

jQuery’s jquery-1.10.2.min.map is triggering a 404 (Not Found)

If Chrome DevTools is reporting a 404 for a .map file (maybe jquery-1.10.2.min.map, jquery.min.map or jquery-2.0.3.min.map, but can happen with anything) first thing to know is this is only requested when using the DevTools. Your users will not be hitting this 404. Now you can fix this or disable the sourcemap functionality. Fix: get the … Read more