5

Brief Summary
Rather than opening the standalone 'view source' tab when selecting View Source, opening the Web Inspector directly to the Sources tab would be clearer and provide a better user experience in my opinion.

Details:
The current standalone 'view source' tab has very limited functionality (no line numbering, no syntax highlighting) and has some unexpected behaviours around its connection to the originating tab (see https://orionfeedback.org/d/5561-refreshing-view-source-tab-should-reload-page-source).

Chrome & Firefox open sources in new tabs, however they provide various features & visual enhancements including the previously mentioned line numbering & syntax highlighting as well as configurable word wrapping in some instances.

Rather than investing the work into building a full source code viewer or integrating a non-native-feeling third-party solution, Orion could follow Safari's approach and rely on the existing functionality provided by the Web Inspector, with the added benefits of remaining in the current tab's context and resolving any confusion between whether the displayed source code is up to date or not (thereby making https://orionfeedback.org/d/5561-refreshing-view-source-tab-should-reload-page-source irrelevant).

Image/Video:
The following are screenshots after activating View Source or equivalent commands in each browser, showing how they all provide various enhancements & affordances vs Orion's raw text output.

Orion:

Chrome:

Firefox:

Safari:

Suggested alternative outcome for Orion:

    Brief Summary
    Selecting 'View Source' opens a page's source code, however refreshing the displayed tab just refreshes the display without reloading the underlying source code, giving the illusion of refreshing without actually doing anything.

    Details:
    For comparison with other browsers:

    • Chrome: Shows source in a separate tab like Orion, and refreshing reloads the source
    • Firefox: Shows source in a separate tab like Orion, and refreshing reloads the source
    • Safari: Shows source in the developer tools so reloads with the origin tab

    Two different implementations but in either case the outcome is the same: refreshing while viewing source reloads the displayed source.

      Some quick follow up: if you leave a view source tab open, go back to the original page, refresh that, then return to the source tab, it will show the previous source but refreshing the source code tab will update it with the origin tab's HTML, so it's just the refresh action that needs to be relayed between the two (or more) tabs since the source code is already shared.

        Note that unlike other browsers, Orion does not do another request to show page source but uses the content of the page already shown to display page source. This had the advantage of view source working when the internet is off for example.

        however refreshing the displayed tab just refreshes the display without reloading the underlying source code

        Can you clarify what you mean by this?

          Vlad Thanks for the follow up. What I'm trying to say is that currently refreshing a "view source" tab only visually 'refreshes' (as in it flashes the screen briefly since the tab hosting the source code itself is being reloaded) without actually loading new source code, which feels misleading.

          I agree it's important to be able to view source when offline. What this suggestion thread is about is what happens when you refresh the source code tab – there wouldn't be any change to what happens when you first select View Source and open the tab.

          The more I think about it though the more I think having a separate tab for source code is less ideal than using the Web Inspector, so I've opened this suggestion to consider that change: https://orionfeedback.org/d/5571-open-web-inspector-to-sources-tab-for-view-source-command (which if chosen would render this suggestion obsolete)

          My ideal potential outcomes in order of preference:

          1. Open the Web Inspector to the Sources tab when selecting View Source (see the linked alternate issue), or...
          2. Completely sync the view source tab with the originating page tab, so refreshing either refreshes the other, or...
          3. Disable refreshing in the view source tab so it's at least obvious that tab has no control over the actual page request to load the displayed source code

          Hopefully that's all a bit clearer!

          • Vlad replied to this.

            adamaveray Suggestion to use the inspector is easy to implement. We were avoiding this mainly because the 'cold' start of inspector can sometimes take 2-3 seconds because the entire web inspector in WebKit is a giant javascript file.

            Merged 5 posts from Refreshing 'view source' tab should reload page source.
              No one is typing