tree: a903544d3317ec9f3b4df9920dd7289cd2b34e5e [path history] [tgz]
  1. android/
  2. spoof_checks/
  3. tools/
  4. BUILD.gn
  5. DEPS
  6. elide_url.cc
  7. elide_url.h
  8. elide_url_unittest.cc
  9. OWNERS
  10. README.md
  11. url_fixer.cc
  12. url_fixer.h
  13. url_fixer_unittest.cc
  14. url_formatter.cc
  15. url_formatter.h
  16. url_formatter_android.cc
  17. url_formatter_unittest.cc
components/url_formatter/README.md

The URL Formatter component contains utilities to convert between URLs and human-entered/human-readable strings. Broadly, consuming human-entered URLs happens via “fixup”, which tries to make “reasonable” adjustments to strings to convert them into URLs (e.g. auto-prepending schemes, but also many more, some of which may be surprising). Producing human-readable URLs happens via “formatting”, which can strip unimportant parts of the URL, unescape/decode sections, etc.

These functions are meant to work in conjunction with the stricter, more limited capabilities of GURL, and were originally designed for use with the omnibox, though they've since been used in other parts of the UI as well.

Because these functions are powerful, it‘s possible to introduce security risks with incautious use. Be sure you understand what you need and what they’re doing before using them; don't just copy existing callers.