HTML validation using referer URI

General discussion about computers and electronics. You can post new topics here.
Locked
Jacob
Site Admin
Posts: 49
Joined: Sun Mar 21, 2021 3:24 am

HTML validation using referer URI

Post by Jacob »

The W3 validator, at https://validator.w3.org/ which is the official worldwide standard to validate your HTML code has a feature which allows you to put a link on your web page so others visiting your web page can click on this link to validate it.

Problem is that the default link code they give you works with a referrer URI. The link points to the validator, but does NOT contain the URL (web address) of the page to be checked. Instead the validator page at validator.w3.org checks something called the Referrer URI which is the URL of the page that contained the link. Since the page that contained the link was your web page that you want w3 to test, everything is awesome right? No, now many web browsers do not send the full referrer URI, only the hostname. So for example (during the time of this post) when you try to validate the Site Map at www.deltafoxdesign.com/sitemap, w3 instead validates the homepage www.deltafoxdesign.com/

Whether or not the full referrer URI is sent to the webpage that the link links to is dependent on the browser. Under Windows 10 Firefox, Chrome and Edge only send the hostname part (ie www.deltafoxdesign.com), Internet Explorer (a basically obsolete browser) in Windows 10 sends the whole URL.

Not sending the whole URL does create more privacy on the web. However it also makes it harder for analytics. If you are really strict about privacy you may think of analytics as like a swear word. However owners of websites do like to monitor how visitors got to there web site and to the different web pages that pointed them there.

It is likely that this problem can be worked around by including the full URL to your web page in the w3 validator link when you put the link on your web pages.
Jacob Persico
Owner & Webmaster
Delta Fox Design
Jacob
Site Admin
Posts: 49
Joined: Sun Mar 21, 2021 3:24 am

Re: HTML validation using referer URI

Post by Jacob »

Adding referrerpolicy="no-referrer-when-downgrade" to the a tag in the link to w3 might fix this. This is something I will have to test.

See: https://www.w3schools.com/tags/att_a_referrepolicy.asp
Jacob Persico
Owner & Webmaster
Delta Fox Design
Jacob
Site Admin
Posts: 49
Joined: Sun Mar 21, 2021 3:24 am

Re: HTML validation using referer URI

Post by Jacob »

I tested using referrerpolicy="no-referrer-when-downgrade" on the a tag, however it does not work on Firefox. Apparently Firefox does not recognize that code. However it does work in Chrome. So I opted not to use it for this website.

I could set a referrer policy a different way, for example by sending a header, however; this would effect all the links, not just the validation links. Another option is to edit all the validation links so they include the whole path of the webpage, which I am considering doing.
Jacob Persico
Owner & Webmaster
Delta Fox Design
Locked