GM_xmlhttpRequest really needs a synchronous mode. #1269

Closed
wants to merge 7 commits into
from

4 participants

@meh

Shouldn't be a problem to merge to master.

Or reimplement it in some other way, this was just a fast hack to get something I needed working.

Thanks.

@meh

Eh, obvious security bugs, didn't read the setupRequestEvent properly.

There shouldn't be security issues now.

@erikvold

why is a synchronous mode needed? it's a terrible thing to do..

@meh

Because asynchronous requests aren't always the best way, and I don't see why not giving the developer the chance to use synchronous requests.

@erikvold

Because asynchronous requests aren't always the best way

when is it not?

@meh

In my case I had to try multiple lyrics website one after another if the previous failed, and setting up it to work with asynchronous requests would be an useless overengineering when there's synchronous mode.

@erikvold

In my case I had to try multiple lyrics website one after another if the previous failed, and setting up it to work with asynchronous requests would be an useless overengineering when there's synchronous mode.

It's not useless.. synchronous xhr locks the ui, asynchronous requests do not lock the ui..

@meh

It doesn't lock the UI for me.

And once again, leave the choice to the developer.

@na-ji

That right, the possibility to have a synchronous mode for the function GM_xmlhttprequest will really help the developers. In some case, it can be very usefull.

That why as meh said, leave the choice to the developer is a great solution.

Thanks.

@meh meh Merge remote-tracking branch 'upstream/master'
Conflicts:
	content/xmlhttprequester.js
ab11a1b
@arantius arantius added a commit to arantius/greasemonkey that referenced this pull request Aug 5, 2011
@arantius arantius Merge commit '51e17b7c703c75c074811a57e230690ef2fc077d'
Conflicts:
	content/xmlhttprequester.js

Fixes: #1269
0478edb
@arantius arantius closed this Aug 5, 2011
@arantius
Collaborator

In at least some circumstances, this is currently failing with
Error: Permission denied for <http://arantius.com> to get property Object.status
Source File: file:///.../gm_scripts/sync_gm_xhr_test/sync_gm_xhr_test.user.js
Line: 14

Though I'm sure I saw it work at least once, also.
Currently testing in: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110628 Ubuntu/10.04 (lucid) Firefox/3.6.18

Test case: https://gist.github.com/1134362

@arantius arantius reopened this Aug 9, 2011
@arantius
Collaborator

Working on Mozilla/5.0 (X11; Linux i686 on x86_64; rv:7.0a2) Gecko/20110809 Firefox/7.0a2.

@arantius
Collaborator

Also working: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1.

So, failing in 3 only, working in 4+.

@arantius arantius added a commit that closed this pull request Aug 10, 2011
@arantius arantius Don't use getters for synchronous request return values.
The request was synchronous, so the values are available now anyway.  Works with Firefox 3.6 as well as 4+.

Fixes #1269
c12141c
@arantius arantius closed this in c12141c Aug 10, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment