wurzel_gummidge
wurzel_gummidge

Reputation: 277

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

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.

Upvotes: 18

Views: 2545

Answers (3)

Jannie Theunissen
Jannie Theunissen

Reputation: 30114

Seems to be fixed in version 61: https://bugzilla.mozilla.org/show_bug.cgi?id=1310630

Upvotes: 0

Halcyon
Halcyon

Reputation: 1429

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.

Upvotes: 1

Rishi Dev
Rishi Dev

Reputation: 347

I am facing the same problem. It seems that a new bug has recently been introduced to Firefox.

Until the bug is fixed, I have created a hidden <div> and put my log messages in that and view using the Inspector.

Upvotes: 3

Related Questions