News for hackers. Stuff that matters.
Re:Browsers barely care what HTTP status code your web pages... by notRobot on Friday August 11, 2023 @09:32AM (#37088517)
For anyone interested, here's a bookmarklet to view the current page's HTTP status code (makes a new request):

    javascript:(function()%7Bjavascript%3A(function()%20%7B%0A%20%20var%20xhr%20%3D%20new%20XMLHttpRequest()%3B%0A%20%20xhr.onreadystatechange%20%3D%20function()%20%7B%0A%20%20%20%20if%20(xhr.readyState%20%3D%3D%3D%204)%20%7B%0A%20%20%20%20%20%20alert('HTTP%20Status%20Code%3A%20'%20%2B%20xhr.status)%3B%0A%20%20%20%20%7D%0A%20%20%7D%3B%0A%20%20xhr.open('GET'%2C%20window.location.href%2C%20true)%3B%0A%20%20xhr.send()%3B%0A%7D)()%3B%7D)()%3B
Re:Browsers barely care what HTTP status code your web pages... by dtgriscom on Friday August 11, 2023 @11:07AM (#37089543)
For suspicious types (including me):

    javascript:(function(){javascript:(function() {
      var xhr = new XMLHttpRequest();
      xhr.onreadystatechange = function() {
        if (xhr.readyState === 4) {
          alert('HTTP Status Code: ' + xhr.status);
        }
      };
      xhr.open('GET', window.location.href, true);
      xhr.send();
    })();})();
Re:Browsers barely care what HTTP status code your web pages... by sopooneo on Friday August 11, 2023 @05:18PM (#37094160)
Re:Browsers barely care what HTTP status code your web pages... by recursive on Friday August 11, 2023 @02:09PM (#37091874)
This assumes a GET.
Re:Browsers barely care what HTTP status code your web pages... by mike503 on Saturday August 12, 2023 @02:04AM (#37097461)
Also firing a second request would break restful behavior and could wind up really messing stuff up worse. Maybe it places an order twice? Who knows. Not a good idea.
Re:Browsers barely care what HTTP status code your web pages... by notRobot on Saturday August 12, 2023 @01:41PM (#37102491)
If reloading a page (which is what this is identical to) breaks your website, that's not on the user.
Re:Browsers barely care what HTTP status code your web pages... by notRobot on Saturday August 12, 2023 @05:30PM (#37104407)