can I disable console.log truncation?
While it is great for readability, but this is preventing me from extracting URLs if the string is too long.
I'm using a greasemonkey script to extract URLs from pages. The problem is not the code nor greasemonkey, it is when it logs a long URL string into the console log, it gets the truncated version (although clickable and goes to the right page) and if you copy the text or "Export Visible Nessage to", it will copy the truncated text instead of the full text, which those are now invalid URLs.
Is there a way I can disable this in the options? I tried going to the hamburger menu or the “...” on the devtools and couldn't find the option.
All Replies (3)
As a test, I submitted this in the console:
The only way to copy the full URL was right-click > Copy Link Location but I guess that needs to be done individually?
I prefer this to be done on every log rather than individually (would be extremely tedious), because I'm doing this at a large scale. FF should have the option to show the full text on the entire console log and when exporting visible messages.
Gewysig op
I realized that this seems to only apply if the string is a URL, since the browser will recognize it and will "shorten" it and make them clickable to the correct link. By doing this (this replaces the first “https” with “ttps” so the browser will not recognize the link): ("https://example.com/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/example/").replace(/^https/, "ttps")
Firefox will interpret this as “non-formattable” text string and displays the entire thing with no modification.