Closed Alex-302 closed 7 months ago
Probably related to this issue https://github.com/AdguardTeam/AdguardFilters/issues/171477#issue-2099927946
there are few issue with the userscript:
loadCfg
should be called as await loadCfg()
— https://github.com/Owyn/HandyImage/blob/2d64feeffd50ae54b9c3c7dfb74d80c46589b7d9/HandyImage.user.js#L3679 —
otherwise the config is not loaded before the first makeimage()
call. that's why it's first call logs waiting for settings to load to makeimage()
because cfg_js
is undefined yet, so setTimeout callback should be executed. window.stop();
the image is not displayed after that.
- async
loadCfg
should be called asawait loadCfg()
that would defeat the whole purpose of the async function and make script stop and (a)wait for the result of the function making it synchronous which is not the goal there
2
window.stop();
it's executed before the image is added to the page so it shouldn't (doesn't for me and my tests) interfere with the image loading
but thank you for looking closer at the script and providing feedback 👍🏻
anyway, this has nothing to do with the issue of GM_functions being of object
type in Adguard which was the reason it was breaking the userscript in that version ( https://github.com/Owyn/HandyImage/commit/67da999d3f7ce4f90e88a559902ce75230e2ef85#commitcomment-138183516 )
most scripts writers compare GM_functions with a falsy
check with !
before using em which'd fail here since object
is not falsy
at all, why would you do that?
More info about the problem: https://github.com/Owyn/HandyImage/commit/67da999d3f7ce4f90e88a559902ce75230e2ef85
Homepage: https://github.com/Owyn/HandyImage/
AdGuard for Windows 7.16