GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — status is null when readyState < 4 · Issue #3068 · greasemonkey/greasemonkey

status is null when readyState < 4 #3068

New issue
Copy link
New issue
Copy link
Closed
#3069
Closed
status is null when readyState < 4#3068
#3069
Copy link
Milestone
4.10

Description

@qsniyg
qsniyg
opened on Jan 21, 2020
Issue body actions

For onprogress events (where readyState < 4), status is set to null, even though it's available to the extension (e.g. Violentmonkey works fine).

Test script:

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @include      *
// @grant        GM.xmlHttpRequest
// ==/UserScript==

(function() {
    'use strict';

    var xhr;

    var loadfunc = function(resp) {
        if (resp.readyState < 2)
            return;

        console.log(resp);
        xhr.abort();
    };

    var obj = {
        url: "https://www.google.com/"
    };

    if (true) {
        obj.onprogress = loadfunc; // status == null
    } else {
        obj.onload = loadfunc; // status == 200
    }

    xhr = GM.xmlHttpRequest(obj);
})();

This is problematic for my userscript (https://greasyfork.org/en/scripts/36662-image-max-url), as it believes status == 0/null to mean that the website was blocked via either tracking protection or that the domain/ip couldn't be resolved.

Activity

  1. qsniyg
    added 2 commits that reference this issue on Jan 21, 2020

    Work around Tampermonkey and Greasemonkey not properly supporting status

    9083a82

    Always set status, statusText, and responseHeaders (fixes greasemonke…

    decb21f
  2. arantius
    closed this as completedin decb21fon Sep 9, 2020
  3. arantius
    closed this as completedin #3069on Sep 9, 2020
  4. arantius
    added this to the 4.10 milestone on Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      • 4.10

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.