How can truncated console.log output in Firefox Version 57 be extended?

Viewed 2030

The recent Version 57 release of the Firefox browser truncates output when console.log(variable) is used in Javascript to write the content of a variable to the F12 developer tools console.

If the value in the variable is long (such as when printing out HTML or a large array), the value is truncated and an ellipsis is shown at the point the value is truncated.

I think earlier versions allowed the user to click on the shown output at the point of truncation to extend it.

However Version 57 does not appear to allow this.

Is there a way in which I can extend the output or display the variable differently?

Sorry if I have missed the obvious here.

3 Answers

I had the same problem; that is a pretty bad mistake on Mozilla's part--

If you are desperate, you can split the string into chunks in an array using regex expression match, then view the array, which will give you access to the rest of the string, like so [make sure the string length isn't a multiple of the n value, 200 here]:

var data = "reallylongstring..."; data.match(/.{1,200}/g);

Firefox should automatically expand the indices out when you click on the array in inspector, so you don't have to click each individual index to see the extended string. This does have the slight perk that it is easy to navigate around the string.

Related