document.location.pathname not the same in all browsers
While Chrome and Firefox return the encoded pathname, Safari and Opera do return a decoded pathname.
For example "http://domain.tld/test%20url/" will become "/test%20url/" in Chrome etc. but "/test url/" in Safari.
Safari even decodes document.location.href, while none of the other three do.
Written by Lars Jung
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Browser
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#