jshackles / Enhanced_Steam

Enhances the Steam Experience
www.EnhancedSteam.com
GNU General Public License v3.0
1.31k stars 195 forks source link

Changed quicksell to Fetch API #1519

Closed KarlCastle closed 6 years ago

KarlCastle commented 6 years ago

This should remediate jshackles/Enhanced_Steam#1494 if the $sideMarketActs.append() lines that are commented out in the Firefox repo around 5260 are re-enabled. I don't know what the original bug was, testing with the current jshackles/Enhanced_Steam_Firefox repo showed $.ajax() wasn't sending Referer: or Origin: headers and consequently Steam was replying with a 400 Bad Request response (or without the necessary CORS headers). Changing to Fetch and setting the headers now receives the usual mix of 200 and 502 ("There was an error listing your item, try again later.") responses.

The Fetch API is available in Chrome 42+, Firefox 39+ and Edge 14+ (https://caniuse.com/#feat=fetch)

jshackles commented 6 years ago

Dude - seriously - excellent work. This bug has been driving me nuts for months. I noticed that the ajax request wasn't sending the headers properly but I hadn't really found a fix for that since by all accounts it should have been working fine. Guess it just needed a fresh set of eyes and a fresh perspective (and a totally different command 😃) Cheers for this, I'm sure Firefox users will be pleased.