Show HN: Disabling View Source in Firefox and Edge
no-source.github.io
no-source.github.io
<script>
document.currentScript.remove();
setTimeout(function() {
// no rights reserved (BSD0) by Jeremy Banks <_@jeremy.ca>
const html = document.documentElement.outerHTML;
document.open('text/plain');
document.write('view source disabled');
document.close();
document.documentElement.innerHTML = html;
});
</script>But if I then manually edit that in the location bar to "view-source:https://no-source.github.io/" I can view the source as expected.