GithubHelp home page GithubHelp logo

Comments (5)

aminomancer avatar aminomancer commented on May 12, 2024 1

Well the hash mark separates the URL's path from the anchor string that jumps to the heading. It can't be changed without breaking anchor navigation. Like my repo's readme? If you click the table of contents it would reload the entire page instead of jumping to the section you clicked. So yeah not really practical. Besides, if you really want to refresh you can just press Ctrl+R. Pressing Enter in the urlbar doesn't actually refresh the page btw. It re-navigates to the page.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 1

Not sure, I'm not familiar with the source code. Anchor navigation does work on Edge in terms of clicking links. But with the URL bar it's different from Firefox. In Firefox, I can type https://github.com/aminomancer/uc.css.js to load the page, then add #details and hit Enter, and it'll jump right to the section without reloading the page. Then I can change #details to #fonts and hit Enter and again, it'll jump to the section without reloading the page. In Edge, if you click a ref link it'll jump to the section without reloading the page. But any time you hit Enter it reloads the page, even if the URL leads to the same page. Whereas in Firefox, clicking a link and using the urlbar to type in the same link will produce the same results. So clicking links works the same in Edge and Firefox. But Firefox's urlbar has the same shortcut for jumping to sections without reloading the page that its link click handler has. Whereas Edge's urlbar doesn't have that shortcut.

Of course, the shortcut assumes that you want to navigate the page without reloading it. For people who want to reload the page on purpose (like you) this could seem like a bug. But I assume Mozilla haven't prioritized that since one can just hit Ctrl+R instead. Whereas if the feature is removed, there won't be any other way to jump to headings. Here is part of the shortcut I mentioned. Firefox basically handles navigation differently if the destination document is the same as the loaded document. And this is downstream of the urlbar and clicking, it's happening when a content viewer is created or navigation triggered, so it's gonna play out the same whether a link is clicked or input by text. Whereas in Edge, I'm sure the architectural situation must be analogous, but there probably is some higher level logic in the urlbar code that forces navigation.

I can think of ways it could be done in Firefox, generally involving changes to the docshell code. That's C++ though, not something a user can modify without rebuilding Firefox. I'm looking into a way to do this with a script. I think it would be best if it only reloaded the page if the URL hasn't changed. That is, when the current browser URL is the same as the string in the urlbar. If you type anything different then it should behave as it currently does. But if the URL hasn't changed at all then it's safe to assume we're not trying to navigate, we're just trying to refresh the page. So at that point we can hand off control to a new method that forces a reload.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 1

I posted a bug report concerning this issue if you want to follow the developments. I'm working on turning the patch into an autoconfig script, in any case.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 1

Alright try this script and lmk if it works for you.

from uc.css.js.

ericpa06 avatar ericpa06 commented on May 12, 2024

Thank you very much for implementing this script!!!

from uc.css.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.