3 ms·
Perhaps 'view source' should link to the authors github, highlighting the repo that can be built to produce the page. If the repo can't reproduce the contents
by londons_explore 5y ago
Perhaps 'view source' should link to the authors github, highlighting the repo that can be built to produce the page.
If the repo can't reproduce the contents of the page, simply treat that as an error and don't render the page.
- pc86 5y agoYes because all code is available via GitHub.
- londons_explore 5y ago(or other code repo)
- jefftk 5y agoIf you actually want to do this, you could have the browser check for source maps, and refuse to render any pages that did not provide them: https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_... (Of course most pages are not willing to make their raw source available, so you would see a lot of errors.)
- cxr 5y ago... and a "go fuck yourself" to anybody who publishes pages that simply don't require source maps to begin with? I admit that would at least be in line with the current trend of prioritizing/encouraging the kinds of authors and publishers who engage in (the mess of) what is considered "good" modern Web development.
- jefftk 5y agoI mean, I think the whole idea of only showing websites with unminified source available is silly, but I'm willing to think about the idea ;) I think a source map is a better approach than a GitHub link, is was all I was saying! It also probably wouldn't be too hard to make some heuristics to figure out whether scripts are unminified and not require a source map. It wouldn't be 100% accurate, and it wouldn't avoid some form of intentional obfuscation that still uses long names for things, but it would probably work pretty well.
- cxr 5y agoRefer to <https://www.gnu.org/software/librejs/ https://www.gnu.org/software/librejs/> (caveat: very broken and currently under-resourced; see <https://lists.gnu.org/mailman/listinfo/bug-librejs https://lists.gnu.org/mailman/listinfo/bug-librejs>). > a source map is a better approach than a GitHub link def.
- spicybright 5y agoBarely any commercial sites have public repos though. I'd even say barely any sites in general outside of dev blogs + projects. And even then they always link to the repo.
- chriswarbo 5y agoI do this with http://chriswarbo.net http://chriswarbo.net Most HTML pages are generated from a corresponding Markdown file, in which case a "View Source" link is placed in the footer which goes to that Markdown file in git.