Thank you once again for this awesome script. Steamgifts is loading the Selfie Thread so much faster now, along with dozens of other threads containing attached images.
Comment has been collapsed.
There are some scripts that can do it. Is it possible to make it like them? For example, SG Game Tags supports it in giveaways lists.
Comment has been collapsed.
I don't have much experience with pure javascript, I just made some basic scripts in jQuery long time ago but they were really basic - just few rows... Maybe it could be easier to make it in a framework like that. What do you think? Scripts in frameworks are much more elegant, anyway. :)
Also Extended Steamgifts uses that feature, you can check it too.
Comment has been collapsed.
It's ok when you are used to it. I would like to ask you another question if you don't mind. It's about apps like Tampermonkey.
Is there an easy way how to override some parts of scripts (for example override a variable or add some code) without editing the original file? I mean override it in an external file, for example. Because if I changed it in the original script, updates of the scripts would rewrite it.
Comment has been collapsed.
I believe if you asked about it on stackoverflow.com, someone would sure tell you how to make it. It would save you much time.
Comment has been collapsed.
The Extended Steamgifts use i to, have you checked it yet? I just checked all scripts I use and unfortunately, only the SG Game Tags and Extended Steamgifts support it.
I am not sure but for the Extended Steamgifts script it was easier to implement it because it was applied to its own endless scrolling. And you need to know how to apply it to DOM that was generated with another script, right?
Comment has been collapsed.
Can disable cache ;) but anyway here is what i have for type 2
VM4060:3 ERROR: Execution of script 'SG OnDemand Image Loader' failed! Cannot read property 'parentElement' of undefined
endless_type @ VM4060:3
(anonymous) @ VM4060:4
(anonymous) @ VM4060:166
(anonymous) @ VM4047:2
E_c @ VM4047:3
E @ VM4050:56
create @ VM4050:64
z @ VM4050:13
VM4060:3 TypeError: Cannot read property 'parentElement' of undefined
at stop_loading (eval at E_c (:3:114), <anonymous>:48:19)
at Window.tms_f4d07d67_0f90_4dde_97c7_42fd35dcbfab (eval at E_c (:3:114), <anonymous>:39:2)
at <anonymous>:2:297
at endless_type (eval at E_c (:3:114), <anonymous>:3:1)
at eval (eval at E_c (:3:114), <anonymous>:4:3)
at Object.eval (eval at E_c (:3:114), <anonymous>:166:6)
at <anonymous>:2:297
at Object.E_c (<anonymous>:3:112)
at E (eval at exec_fn (:1:108), <anonymous>:56:175)
at Object.create (eval at exec_fn (:1:108), <anonymous>:64:282)
Comment has been collapsed.
VM1491:105 Uncaught TypeError: Cannot read property 'className' of undefined
at eval (eval at E_c (:3:114), <anonymous>:105:33)
at Array.forEach (native)
at MutationObserver.eval (eval at E_c (:3:114), <anonymous>:78:13)
(anonymous) @ VM1491:105
(anonymous) @ VM1491:78
else if (endless_type === 2 || endless_type === 3) {
// Revilheart's script (2) or SGT Frog (3)
if (mutation.addedNodes.length > 0) {
for(j = 0; j < mutation.addedNodes.length; j++) {
if (mutation.addedNodes[i].className === "comment") { *ERROR*
elements = mutation.addedNodes[i].getElementsByClassName("comment__toggle-attached");
for(i = 0; i < elements.length; i++) {
stop_loading(elements[i]);
}
}
}
}
}
Comment has been collapsed.
Seems all good on type 2 so far, no errors and images on subsequent pages not loaded.
Comment has been collapsed.
cache disabled and network throttled to 50kb/s and images were several pages in, and type 0 fails after first page as well.
Comment has been collapsed.
100% sure because i even added type logging.
// ========== MUTATION FUNCTIONS ==========
function detect_mutations_threads_giveaways(endless_type) {
var target = document.getElementsByClassName("sidebar")[0].nextElementSibling;
var config = {
"subtree": true,
"childList": true,
};
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
var elements;
var i;
var j;
if (endless_type === 0) {
// Extended SteamGifts
console.log("endless type is ", endless_type);
if (mutation.addedNodes.length === 2 && mutation.addedNodes[0].className === "page__heading" && mutation.addedNodes[1].className === "comments") {
console.log("Yep, discussions/giveaways, Extended mutation detected, we found the following attached images elements:");
elements = mutation.addedNodes[1].getElementsByClassName("comment__toggle-attached");
console.log(elements);
console.log("=============================");
for(i = 0; i < elements.length; i++) {
stop_loading(elements[i]);
}
}
} else if (endless_type === 1) {
// SteamGifts++
console.log("endless type is ", endless_type);
if (mutation.addedNodes.length === 1 && mutation.addedNodes[0].className === "comment") {
console.log("Yep, discussions/giveaways, SteamGifts++ mutation detected, we found the following attached images elements:");
elements = mutation.addedNodes[0].getElementsByClassName("comment__toggle-attached");
console.log(elements);
console.log("=============================");
for(i = 0; i < elements.length; i++) {
stop_loading(elements[i]);
}
}
} else if (endless_type === 2 || endless_type === 3) {
// Revilheart's script (2) or SGT Frog (3)
console.log("endless type is ", endless_type);
if (mutation.addedNodes.length > 0) {
for(j = 0; j < mutation.addedNodes.length; j++) {
if (mutation.addedNodes[j].className === "comment") {
elements = mutation.addedNodes[j].getElementsByClassName("comment__toggle-attached");
for(i = 0; i < elements.length; i++) {
stop_loading(elements[i]);
}
}
}
}
}
});
});
observer.observe(target, config);
}
page in view changed to 2
31VM6232:98 endless type is 1
VM6229:36 page in view changed to 3
62VM6232:98 endless type is 1
VM6229:36 page in view changed to 4
VM6232:98 endless type is 1
VM6229:36 page in view changed to 5
30VM6232:98 endless type is 1
youre-not-alone-reboot-28-active-private-ga-warhammer-end-times-hyper-light-drifter/search?page=5:1 Mixed Content: The page at 'https://www.steamgifts.com/discussion/bH3Tq/youre-not-alone-reboot-28-active-private-ga-warhammer-end-times-hyper-light-drifter/search?page=5' was loaded over HTTPS, but requested an insecure image 'http://i.imgur.com/8zrJNcX.gif'. This content should also be served over HTTPS.
youre-not-alone-reboot-28-active-private-ga-warhammer-end-times-hyper-light-drifter/search?page=5:1 Mixed Content: The page at 'https://www.steamgifts.com/discussion/bH3Tq/youre-not-alone-reboot-28-active-private-ga-warhammer-end-times-hyper-light-drifter/search?page=5' was loaded over HTTPS, but requested an insecure image 'http://imagesmtv-a.akamaihd.net/uri/mgid:file:http:shared:mtv.com/news/wp-c…na-broad-city-dance-1422317984.gif?quality=.8&height=197&width=350'. This content should also be served over HTTPS.
Comment has been collapsed.
SG++ All Read Button causes the mutators to fail otherwise SG++ works fine, on to test extended steamgifts.
Extended Steamgifts still loading images but does log. I can't get consistent results with extended steamgifts sometimes it loads every image on the page sometimes it does not load any.
VM2874:86 Yep, discussions/giveaways, Extended mutation detected, we found the following attached images elements:
VM2874:88 [div.comment__toggle-attached, div.comment__toggle-attached, div.comment__toggle-attached, div.comment__toggle-attached]
VM2874:89 =============================
VM2874:86 Yep, discussions/giveaways, Extended mutation detected, we found the following attached images elements:
VM2874:88 []length: 0__proto__: HTMLCollection
VM2874:89 =============================
Comment has been collapsed.
MetalTxus' additional giveaway search tool and Alpe's Steamgifts steam rating support endless scroll at giveaways list.
And for the script that enables endless scroll are just that complete overhaul script. SG++, Ext SG, and SGT Frog.
I don't use Easy SG anymore since it stopped working when steamgifts migrated to https.
Comment has been collapsed.
Looks good, but I don't personally suffer from this issue as my internet connection is quite fast. Still, it would be good for everyone (including those with fast connection) to use this script to reduce the load on the server, the only catch is that the user experience would be somewhat worse compared to what it is currently, as images would show loading instead of show up immediately.
Have you considering preloading images of posts that are visible on the screen? This would mean the behavior would be practically identical to how it is today (for those with fast connection), as the image would most likely be already loaded when clicked, but the browser won't just download all linked images for no reason.
Comment has been collapsed.
i'm fairly certain some change somewhere broke this.. now i still get the "insecure image" warnings in the console for every image per discussion instantly and not just upon the loads of the images. (as well as they all seem loaded already)
(tested as the only script running at the time with selfie thread)
Comment has been collapsed.
hmm okay.. sorry then.. i swear i wasn't getting those warnings before at all though for some reason (idk why though), but now i get them everywhere i go even if there aren't images on the page itself because the comment formatting script has all my prior posted image links saved inside it.
i can see the difference now between this script being on and off though so it is still working, my bad.
Comment has been collapsed.
Comment has been collapsed.
30 Comments - Last post 11 minutes ago by Sh4dowKill
250 Comments - Last post 18 minutes ago by Zero224
795 Comments - Last post 1 hour ago by FranckCastle
364 Comments - Last post 2 hours ago by Zepy
44 Comments - Last post 3 hours ago by IronKnightAquila
107 Comments - Last post 4 hours ago by LosingMyEdge
94 Comments - Last post 5 hours ago by BarbaricGenie
8 Comments - Last post 11 minutes ago by FateOfOne
28 Comments - Last post 24 minutes ago by orono
531 Comments - Last post 28 minutes ago by Momo1991
598 Comments - Last post 34 minutes ago by Maskitopeludito
50 Comments - Last post 38 minutes ago by Naviis
3,438 Comments - Last post 40 minutes ago by actuallySIG
634 Comments - Last post 40 minutes ago by Gellax
Comment has been collapsed.