Skip to content
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 · Fixed by #2713
Closed

GM.xmlHttpRequest doesn't support onprogress event #2712

ccloli opened this issue Nov 20, 2017 · 1 comment · Fixed by #2713
Milestone

Comments

@ccloli
Copy link
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
Fix GM.xhr onprogress event is not working

Fixes #2712
@arantius
Copy link
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants