GitHub bug: "Go to file" leads to encoded URL
See original GitHub issuePlease ensure:
- The bug is caused by Refined GitHub. It doesn’t happen if I disable the extension.
- The bug happens after clearing extension cache. The “Clear cache” button below can also be found at the bottom of the options page.
Example URLs
https://github.com/refined-github/refined-github/find/main
Extension version
22.3.3
Browser(s) used
Chrome
Description
Not actually RGH bug, but affects RGH.
The native “Go to file” feature now leads to URL encoded file paths, prevent some features like rgh-feature-descriptions
to work.
// https://github.githubassets.com/assets/app/assets/modules/github/repositories/tree-finder.ts
virtualList.addEventListener('virtual-list-render-item', (event: Event) => {
if (!(event instanceof CustomEvent)) return
const frag = new TemplateInstance(template, {
item: event.detail.item,
id: `entry-${Math.random().toString().substr(2, 5)}`,
urlEncodedItem: encodeURIComponent(event.detail.item)
})
const marker = frag.querySelector<MarkedTextElement>('marked-text')
if (marker) marker.positions = positions
event.detail.fragment.append(frag)
})
Maybe we can add a feature to “normalize” these paths, could even bring https://github.com/refined-github/refined-github/issues/5326#issuecomment-1018560216 in.
Implementation I can think of: create a hidden PJAX link that links to the normalized path, then click it to trigger PJAX navigation (or probably just do a hard refresh?).
Include in this issue:
- Screenshots/video/gif demonstrating the bug, if it’s visual
- Console errors, if any
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
url-encoded query causing unexpected behaviour #1392
Hi, I was trying to use the search-issues API. So, I was running below query directly from chrome: ...
Read more >File URL reparse bug with percent encoded windows drive letter
There is a reparse bug, when parsing URL with percent encoded windows drive letter ( C| ) in the host. URLs to test:...
Read more >wiki: URL encoding bug · Issue #4090 · go-gitea/gitea - GitHub
Since #4058, the links are no longer encoded. But the URLs(files name) of the existing pages or new pages are still encoded.
Read more >Invalid URL: file path occasionally converted to URL · Issue #35
Describe the bug. Occasionally the absolute file path passed to decode-config is converted to a URL. /tmp/tasmota01.local.dmp => http:///tmp/ ...
Read more >Config file path contains url encoded slash on windows when ...
For some reason probot seems to be encoding the slash between .github and .config . I've checked the code and it seems that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This would be really great to have. I often copy the paths from the GitHub URL and needing to HTML decode them first is a pain.
Seems like GitHub resolved this by replacing
encodeURIComponent()
with this: