Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable URL Shortening/ Formatting in Chrome's Console

Tags:

I'm converting pages from an old format to new via Snippets. All was right in the world, up until I noticed Chrome's console "shortening" URL's so they would display better.

var url = "http://www.somewebsite.com/this/is/a/really/really/really/really/long/ass/url/that/will/be/cutoff/later/on/just/wait/wait/for/it/wait/for/it/there/here/are/some/query/strings?awwww=snap&this=is&really=happening"  console.log(url);  // Spits out // "http://www.somewebsite.com/this/is/a/really/really/really/really/long/ass/u…r/it/there/here/are/some/query/strings?awwww=snap&this=is&really=happening" 

These aren't the actual URL's, but you get the idea. Is there a way of removing formatting from Google Chrome's console area? This snag pretty much ruined all my plans, hoping to not have to use a headless browser just to get raw text output. :-\

like image 860
AlbertEngelB Avatar asked Oct 04 '13 14:10

AlbertEngelB


People also ask

How do I stop URL shortening?

To disable URL shortener for particular post, simply click on the URL shortener icon on the bottom of the Publishing Window. When the icon is orange, it indicates that it is enabled.

Does Chrome have a URL shortener?

Url Shortener for Google Chrome™ Just click our extension icon on toolbar to shorten the URL of current page with TinyURL.com url shortener service.

What is URL shortening system?

URL shortening is the translation of a long Uniform Resource Locator (URL) into an abbreviated alternative that redirects to the longer URL. The original URL shortening service was TinyURL, which was launched in 2002 by Kevin Gilbertson to make links on his unicyclist site easier to share.

How does URL shortening service work?

Basically, when the URL shortener gives you your shortened URL, it "remembers" the full address. When other users go to the shortened URL, they will be automatically redirected to the full address. The webpage will still exist at the longer URL—the shortened URL is simply a shortcut to make the link easier to manage.


2 Answers

One workaround I found wasn't to log the actual values I was wanting. Instead I set it to a window variable and use copy(window.varToCopy)

copy() is a native Chrome function you can use in the console to copy the data to your clipboard. Luckily it seems that it doesn't format anything you pass into it, so I can then get the actual URL rather than the broken one.

This is only a workaround, hopefully someone knows how to remove console formatting!

like image 132
AlbertEngelB Avatar answered Sep 29 '22 01:09

AlbertEngelB


My workaround is to use console.dir(url);. It isn't designed for this purpose, but it definitely does the trick:

enter image description here

You can't really open the hierarchical listing, but you don't need to anyway.

like image 33
dan-lee Avatar answered Sep 28 '22 23:09

dan-lee