Nuklon / Steam-Economy-Enhancer

Enhances the Steam Inventory and Steam Market.
MIT License
1.59k stars 181 forks source link

[Possible Bug] Error: Pagination: Pagination requires jQuery. #11

Closed Tomasety-III closed 7 years ago

Tomasety-III commented 7 years ago

I recently saw that SEE was updated twice. None of those both last updates fixed the issue I still get on Chrome (v58.81) which is the following:

ERROR: Execution of script 'Steam Economy Enhancer' failed! Pagination: Pagination requires jQuery.

Error: Pagination: Pagination requires jQuery. at throwError (eval at E_c (:3:114), :1188:11) at eval (eval at E_c (:3:114), :206:5) at Window.tms_392623cc_baa1_440b_ae9c_691fb1c1c30b (eval at E_c (:3:114), :1248:3) at :2:297 at eval (eval at E_c (:3:114), :3:1) at eval (eval at E_c (:3:114), :4:3) at Object.eval (eval at E_c (:3:114), :3440:6) at :2:297 at Object.E_c (:3:112) at E (eval at exec_fn (:1:108), :56:175)

Do you know if there is something wrong on my side or is it your script?

Thanks for your script. Really, much appreciated.

omicron321 commented 7 years ago

Yes, me too on Chrome. I fixed it with adding this line : // @require https://code.jquery.com/jquery-3.2.1.min.js Just insert it before the other // @require lines.

Nuklon commented 7 years ago

Strange, it should work as nothing changed regarding jQuery and Steam has this already added to their page.

Adding it again with a simple require statement won't work (at least in Firefox), the inventory won't load anymore.

However, I found a way to get around that, will commit a fix in a sec.

Tomasety-III commented 7 years ago

Thanks @Omicron666 for the reply.

Also, thanks @Nuklon for your reply. I will wait for your fix.

Nuklon commented 7 years ago

It's there in 3.5.6, you can force the update through TM / GM.

Tomasety-III commented 7 years ago

It still doesn't work. Now I've got a different error.

ERROR: Execution of script 'Steam Economy Enhancer' failed! $ is not a function

TypeError: $ is not a function at eval (eval at E_c (:3:114), :3383:5) at Window.tms_392623cc_baa1_440b_ae9c_691fb1c1c30b (eval at E_c (:3:114), :3447:3) at :2:297 at eval (eval at E_c (:3:114), :3:1) at eval (eval at E_c (:3:114), :4:3) at Object.eval (eval at E_c (:3:114), :3449:6) at :2:297 at Object.E_c (:3:112) at E (eval at exec_fn (:1:108), :56:175) at Object.create (eval at exec_fn (:1:108), :64:282)

omicron321 commented 7 years ago

Well, I haven't checked all changes made, but I wouldn't import jquery-ui before jquery !

Nuklon commented 7 years ago

I'll fiddle around in Chrome to get it working, Firefox seems more forgiving :)

omicron321 commented 7 years ago

They don't have same sandboxing.

Also... I am not sure pagination is that necessary... you could just use a scrollable div, as you fetch every page at once, rather on demand.

Also. The eventual performance issues are from jQuery being slow at manipulating/transforming/modifying too many data. Not at displaying them.

omicron321 commented 7 years ago

That seems to work now on Chrome :-)

Nuklon commented 7 years ago

Should be fixed now, it works in Chrome here now.

About pagination, I've added it because: 1) ~1000 items on one page isn't very usable in my opinion. 2) I wanted to add a filter option (you can search by item name, game name, price and listing id).

I might add an option in the future to specify how many items are loaded, it's now hard set to 100 but can easily be modified to another number.

Tomasety-III commented 7 years ago

I'm sorry @Nuklon for keep you bothering again and again, but I think there's a new issue in the latest version of EE (3.5.7).

My market listing couldn't be loaded on steamcommunity.com/market/ .

At first script tried to load it as shown on the next pic https://i.imgur.com/F9kwLcR.png but then it just shown two duplicated numbers as you can see on the next pic https://i.imgur.com/SzltSSU.png

This is what I did see skimming through console log:

Uncaught TypeError: Cannot read property 'elm' of undefined at getAssetInfoFromListingId (eval at E_c (:3:114), :2942:94) at Object.marketListingsItemsQueue.drain (eval at E_c (:3:114), :2926:37) at eval (eval at E_c (:3:114), :1099:8360) at eval (eval at E_c (:3:114), :1099:3858) at Object.eval [as success] (eval at E_c (:3:114), :2889:17) at i (eval at E_c (:3:114), :6:28017) at Object.fireWith [as resolveWith] (eval at E_c (:3:114), :6:28783) at A (eval at E_c (:3:114), :8:14035) at XMLHttpRequest.eval (eval at E_c (:3:114), :8:16323)

Nuklon commented 7 years ago

Does it work if you change

function getAssetInfoFromListingId(listingid) {
            var actionButton = $('.item_market_action_button', getListingFromLists(listingid).elm).attr('href');
            if (typeof actionButton === "undefined")
                return {};

            var itemIds = actionButton.split(',');
            var appid = replaceNonNumbers(itemIds[2]);
            var contextid = replaceNonNumbers(itemIds[3]);
            var assetid = replaceNonNumbers(itemIds[4]);
            return { appid, contextid, assetid };
}

to:

function getAssetInfoFromListingId(listingid) {
            var listing = getListingFromLists(listingid);
            if (typeof listing === "undefined")
               return {};

            var actionButton = $('.item_market_action_button', listing).attr('href');
            if (typeof actionButton === "undefined")
                return {};

            var itemIds = actionButton.split(',');
            var appid = replaceNonNumbers(itemIds[2]);
            var contextid = replaceNonNumbers(itemIds[3]);
            var assetid = replaceNonNumbers(itemIds[4]);
            return { appid, contextid, assetid };
}
Tomasety-III commented 7 years ago

Thanks again. It does work indeed, though priceoverview check doesn't work which makes unusable top row buttons (Select overpriced, Select all, etc)

Nuklon commented 7 years ago

Great, pushed the fix out as well 👍

Tomasety-III commented 7 years ago

Sorry forgot to mention the small detail about priceoverview check.

Nuklon commented 7 years ago

You mean the information about prices in inventory (sell buttons)?

Tomasety-III commented 7 years ago

No, I meant about prices on market listed items. (My sell listings)

This is the error I saw between console log errors list

Uncaught TypeError: Cannot read property 'undefined' of undefined at marketListingsQueueWorker (eval at E_c (:3:114), :2628:58) at eval (eval at E_c (:3:114), :2606:13) at eval (eval at E_c (:3:114), :1099:26245) at process (eval at E_c (:3:114), :1099:9103) at Window.eval (eval at E_c (:3:114), :1099:7644) at :2:297 at e.string.c.(anonymous function) (eval at exec_fn (:1:108), :53:132)

Nuklon commented 7 years ago

Do you mean this feature: http://i.imgur.com/Cfh4BLz.png

This is in Chrome, that's working here.

Tomasety-III commented 7 years ago

Yes, exactly. It doesn't work on my side so I guess it's my fault then.

Tomasety-III commented 7 years ago

I'm sorry @Nuklon for bumping this thread but I just found the cause of my latest issue I reported to you.

So, it looked like if I had a buy order which was listed on the top/first position ( alphabetical ascendant sorted) of "my sell listings" then script stopped working. I'm sorry for the explanation, english is not my mother tongue.

Example of what I try to explain

https://i.imgur.com/UaAcaID.png No green section highlighted. First item's name has sorting priority over second. "2"> ":"

https://i.imgur.com/GLmBU7g.png After I removed the buy order script worked again perfectly till the next buy order script encountered which caused script to stop working once again in that case .

Thanks again and sorry for the troubles.

Nuklon commented 7 years ago

You mean that if you sell an item AND have that same item (type) also as a buy order, it doesn't work?

Nuklon commented 7 years ago

Regardless, please open a new issue for this 👍