Fix Bug 778863, provide functionality to expand and truncate urls to make copying easier

@AdrianGaudebert @peterbe r?