Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use document.location.path instead of document.location.href #6

Closed
derekriemer opened this issue Dec 28, 2016 · 3 comments
Closed

Use document.location.path instead of document.location.href #6

derekriemer opened this issue Dec 28, 2016 · 3 comments

Comments

@derekriemer
Copy link
Contributor

The regexp would be cleaner if we did
var res = document.location.pathName.match(//[^\/]+/[^\/]+(?:/([^\/?]+))?(?:/([^\/?]+))?(?:/([^\/?]+))?(?:/([^\/?]+))?/);
pathNamed only gives us the thing after the url.
Also why couldn't we use
var res = document.location.pathName.match(/(?:/[^\/]+){2}(?:/([^\/?]+))?(?:/([^\/?]+))?(?:/([^\/?]+))?(?:/([^\/?]+))?/);
I'm happy to give a PR if you want.

@jcsteh
Copy link
Owner

jcsteh commented Jan 3, 2017 via email

@derekriemer
Copy link
Contributor Author

derekriemer commented Jan 3, 2017 via email

@jcsteh
Copy link
Owner

jcsteh commented May 30, 2022

I assume this was about the GitHub script? The new script no longer uses location. It may need to again in future, but it doesn't now.

@jcsteh jcsteh closed this as completed May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants