View page source

Board for discussions around the Basilisk web browser.

Moderator: Basilisk-Dev

dodona
Apollo supporter
Apollo supporter
Posts: 34
Joined: 2017-12-18, 08:50

View page source

Unread post by dodona » 2018-02-08, 21:29

did anybody beside me experiences, that 'View page source' fails, .ie just opening an empty browser tab?
Try out http://spacewar.oversigma.com/ or this forum page.

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1
Contact:

Re: View page source

Unread post by Isengrim » 2018-02-08, 22:24

The source shows just fine for me on 2018.02.02 (Windows 7 x64).

Code: Select all

<html>
<head>
<title>Spacewar! - Original 1962 code on PDP-1 emulator</title>
<meta name="keywords" content="Spacewar, game, original, PDP-1, emulator, gerasimov, silverman, Graetz, Russell, Wiitanen">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<style type="text/css">@import "spacewar.css";</style>
<script type="text/javascript" src="spacewar.js"></script>
<script type="text/javascript" src="spacewar.bin.js"></script>
<script type="text/javascript">
  if (!document.createElement('canvas').getContext) {
    window.location = "nocanvas.html";
  }
</script>
</head>

<body onload="setup();">
<h1><font face="Arial"><font size="5">Spacewar!</font><br>
<font size="3">Original 1962 game code running on a PDP-1 emulator in JavaScript</font></font></h1>
<h1><a href = "readme.html"><font face="Arial" size="3">Readme</font></a></h1><p>
<div class="frame" id="frame">
<div class="spacewar">
<canvas class="spacewar" id="swcanvas"></canvas>
</div>
</div>
</body>
</html>
I also get an error in the console:

Code: Select all

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
Edit: The source code for the forum also displays fine for me.
Last edited by Isengrim on 2018-02-08, 22:25, edited 1 time in total.
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

kjpetrie

Re: View page source

Unread post by kjpetrie » 2018-03-20, 14:55

These two pages both work for me. However, there does seem to be something odd about PM's View Page source function in that it appears, instead of displaying the source of the page being viewed, to attempt to load the page again, producing timeout errors if the page has expired or downloading the page from the server without sending the cookies, resulting in a log-in message instead of the content being displayed.

This is playing havoc for me at present because I'm trying to debug a server-side script in PM and when trying to view raw page code (in order to preserve non-html formatting) am instead getting messages asking me whether I want to repeat the submission of data, which, of course will disrupt the process I'm trying to debug.

The message in the Titlebar of the Source window says it all.
Screenshot_20180320_143923.png
View source should just display the current page as plain text without parsing it or worrying about expiry. Unfortunately, it seems to be trying to undertaker some sort of re-fetching, which means it could be displaying different data from the page being viewed, which is clearly not the desired function.
Last edited by kjpetrie on 2018-03-20, 15:06, edited 1 time in total.

User avatar
adesh
Board Warrior
Board Warrior
Posts: 1277
Joined: 2017-06-06, 07:38

Re: View page source

Unread post by adesh » 2018-03-23, 14:32

If you want to view the page as it is currently being displayed, use the "Inspect Element" function. That would give you real-time view of the web page.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35477
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: View page source

Unread post by Moonchild » 2018-03-24, 09:57

View page source DOES (or certainly SHOULD) display the currently-loaded page and does not re-fetch it from the web.
If it does, then something is odd in your configuration (e.g. disabled caching or similar?). Also, re-fetching may possibly occur if it's been a long time since you pulled up the original page and cache expiry happened in the meantime.
Last edited by Moonchild on 2018-03-24, 10:55, edited 1 time in total.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked