Software Engineering :: Web :: Browser :: Extension :: Development :: Gist Edit Keyboard Shortcut
⪼ Made with 💜 by Polyglot.
...
- Business :: Ideas :: GistWise
- Software Engineering :: Database :: Redis :: Example :: Gist Auto-Complete Description
- Software Engineering :: Web :: Browser :: Extension :: Development :: GistSearch
...
window.location.pathname
'/wilmoore/77bdb6a99912b2b4a585c5f347e6980b'
window.location.pathname.endsWith('/edit')
false
window.location.pathname.endsWith('/edit')
false
window.location.pathname.split
ƒ split() { [native code] }
window.location.pathname.split('/')
(3) ['', 'wilmoore', '77bdb6a99912b2b4a585c5f347e6980b']
window.location.pathname.split('/').filter(String)
(2) ['wilmoore', '77bdb6a99912b2b4a585c5f347e6980b']
window.location.pathname.split('/').filter(String).concat('edit')
(3) ['wilmoore', '77bdb6a99912b2b4a585c5f347e6980b', 'edit']
window.location.pathname.split('/').filter(String).concat('edit').join('/')
'wilmoore/77bdb6a99912b2b4a585c5f347e6980b/edit'
new URL(window.location)
URL {origin: 'https://gist.github.com', protocol: 'https:', username: '', password: '', host: 'gist.github.com', …}hash: ""host: "gist.github.com"hostname: "gist.github.com"href: "https://gist.github.com/wilmoore/77bdb6a99912b2b4a585c5f347e6980b"origin: "https://gist.github.com"password: ""pathname: "/wilmoore/77bdb6a99912b2b4a585c5f347e6980b"port: ""protocol: "https:"search: ""searchParams: URLSearchParams {size: 0}username: ""[[Prototype]]: URL
window.location.pathname.split('/').filter(String).concat('edit').join('/')
'wilmoore/77bdb6a99912b2b4a585c5f347e6980b/edit'
(new URL(window.location)).pathname
'/wilmoore/77bdb6a99912b2b4a585c5f347e6980b'
77bdb6a…:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
(new URL(window.location)).pathname = 'edit'
'edit'
let url = new URL(window.location)
undefined
url.pathname = 'edit'
'edit'
url
URL {origin: 'https://gist.github.com', protocol: 'https:', username: '', password: '', host: 'gist.github.com', …}
url.pathname = window.location.pathname.split('/').filter(String).concat('edit').join('/')
'wilmoore/77bdb6a99912b2b4a585c5f347e6980b/edit'
url
URL {origin: 'https://gist.github.com', protocol: 'https:', username: '', password: '', host: 'gist.github.com', …}hash: ""host: "gist.github.com"hostname: "gist.github.com"href: "https://gist.github.com/wilmoore/77bdb6a99912b2b4a585c5f347e6980b/edit"origin: "https://gist.github.com"password: ""pathname: "/wilmoore/77bdb6a99912b2b4a585c5f347e6980b/edit"port: ""protocol: "https:"search: ""searchParams: URLSearchParams {size: 0}username: ""[[Prototype]]: URL
- ...