New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GM.xmlHttpRequest doesn't support onprogress event #2712

Closed
ccloli opened this Issue Nov 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@ccloli
Contributor

ccloli commented Nov 20, 2017

// ==UserScript==
// @name        GM.xmlHttpRequest
// @version     1.0
// @description GM.xmlHttpRequest
// @match       <all_urls>
// @include     *
// @connect     *
// @grant       GM_xmlhttpRequest
// @grant       GM.xmlHttpRequest
// ==/UserScript==

var GM_xmlhttpRequest = GM_xmlhttpRequest || GM.xmlHttpRequest;

GM_xmlhttpRequest({
  method: 'GET',
  url: 'http://localhost/100MB.bin',
  responseType: 'arraybuffer',
  onprogress: res => console.log(res),
  onload: res => console.log('loaded', res.response.byteLength, res.responseHeaders),
  onerror: () => console.log('error')
});
console.log('request started');

The log when using GreaseMonkey (onprogress event is not working):
image

The log when using Tampermonkey (expected, despite the annoying ArrayBuffer converter):
image

@arantius arantius modified the milestones: 4.x, 4.1 Nov 21, 2017

arantius added a commit that referenced this issue Nov 21, 2017

Merge pull request #2713 from ccloli/gm-xhr-onprogress
Fix GM.xhr onprogress event is not working

Fixes #2712
@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Nov 28, 2017

Collaborator

This is in build 4.1beta5 ( https://addons.mozilla.org/firefox/downloads/file/793791/greasemonkey-4.1beta5-an+fx.xpi?src=devhub ). Testing and confirming would be appreciated!

Collaborator

arantius commented Nov 28, 2017

This is in build 4.1beta5 ( https://addons.mozilla.org/firefox/downloads/file/793791/greasemonkey-4.1beta5-an+fx.xpi?src=devhub ). Testing and confirming would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment