Simon-Tesla / RaccoonyWebEx

A WebExtension that adds shiny features to art sites
MIT License
43 stars 4 forks source link

[BUG] Auto download #35

Closed momoe closed 4 years ago

momoe commented 5 years ago

After v66.0.2 update last week. The Auto Download feature has not been working. It doesn't work intermittently and I don't know if new policies in place have changed.

If there is any debug info I can submit, I'm happy to share once given some direction.

Simon-Tesla commented 5 years ago

I'll see if I can get a repro over the weekend, but in the meantime, if you can press F12 to open the developer tools, then copy the console output after reproducing the bug into the bug here, that'd be helpful.

momoe commented 5 years ago

Download the React DevTools for a better development experience: https://fb.me/react-devtools page_inject.js:22693:9 [raccoony] injecting script page_inject.js:476:12 Loading failed for the <script> with source “https://a.adnium.com/static?r=28387452&id=140630&pid=5273&sid=35&tid=2&w=728&h=90”. Samus--1-Suit-Animated:1:1 [raccoony] initializing plugin hentaifoundry page_inject.js:476:12 [raccoony] loading plugin hentaifoundry page_inject.js:476:12 [raccoony] detected settings change, reloading page_inject.js:476:12 [raccoony] initializing page UI page_inject.js:476:12 finished page_inject page_inject.js:1975:5 [raccoony] hasMedia true page_inject.js:476:12 [raccoony] hasPageLinks false page_inject.js:476:12 [raccoony] sending message Object { action: "messageaction_checkdownload", data: {…} } page_inject.js:476:12 [raccoony] retrieved settings: Object { default_settings: {…}, deviantart_settings: {…}, e621_settings: {…}, furaffinity_settings: {…}, hentaifoundry_settings: {…}, inkbunny_settings: {…}, version: 3 } page_inject.js:476:12 Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified Content Security Policy: Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified Source map error: TypeError: NetworkError when attempting to fetch resource. Resource URL: moz-extension://a3bcb126-ed26-4d43-8fb9-d368bf4e7190/page_inject.js Source Map URL: filenames.js.map[Learn More]

momoe commented 5 years ago

image

Simon-Tesla commented 5 years ago

Does the download work when you manually initiate it?

momoe commented 5 years ago

Yes manual downloads work fine, the auto download doesn't function across many of the sites I've tested on.

I have also tested on a clean install of Firefox, and Raccoony

Osprey-Hawk commented 5 years ago

Can confirm. Sometimes works, but manual is unaffected.

momoe commented 5 years ago

Just following up, to see if anything I submitted was useful in resolving the auto download bug?

momoe commented 5 years ago

Okay, so it seems the delay timer for loading tabs might play a factor. When I lower the time to 1 second I seem to get a significantly lot more auto downloads initialized than when I have it set to 4 seconds.

Simon-Tesla commented 5 years ago

Interesting. Are you using the "Open one tab at a time" setting, out of curiosity? (Also, sorry for being slow on this, work has really been taking up a lot of my time lately.)

momoe commented 5 years ago

No I am using my original settings, I haven't tried the "Open one tab at a time" feature yet. Could my Java Runtime update have any impact on it? I'm not sure if it's tied into mozilla, but that's the only other change I've made; even after a clean re-install. (I totally understand about work life. Spring time has definitely spun up things for me as well)

Osprey-Hawk commented 5 years ago

I have it set to 1 sec delay without "one tab at a time" enabled and I have not been getting autosaves to happen concurrently. There has been times where 6 or so tabs would autosave, but then 1 or 4 after would not, and then save properly again. This is on HF, and InkBunny, btw. FA is set to be 2 seconds so as to not trigger a 503 but still has that same pattern.

Simon-Tesla commented 5 years ago

The Java RE shouldn't have anything to do with how Raccoony performs, given that it uses the browser's built-in Javascript engine. Incidentally, I'd highly recommend uninstalling Java, or at least disabling it as a browser plugin unless you have a specific need for it; it hasn't had the best record when it comes to security.

I'd highly recommend trying the "one tab at a time" setting to see if it helps. The poor performance of the old "open tabs all at once" behavior made my browser hang for around a minute if I opened more than about 30 tabs, which is why I added the new option. It's possible that those performance issues affect how the auto-download runs (or doesn't, as the case may be).

In any case, I'm planning to make that mode the default once I can spend some time adding a bit more polish to the feature.

momoe commented 5 years ago

I've removed JRE, and have enabled the experimental "...One tab.." feature, and neither has improved the auto download success rate.

If you're planning on making that the default, I might steer your attention to "Lazy Load" addon for firefox and see if this can be utilized into Raccoony, since it will retard the loading of tabs only once the page is fully loaded, instead of a static timer. I think this will further cut down on resource usage caused by slow sites or network bloat hanging.

https://addons.mozilla.org/en-US/firefox/addon/load-background-tabs-lazily/

Simon-Tesla commented 5 years ago

Hm... the code is pretty impenetrable, though I do like the idea of lazy-loading tabs. I believe the discarded argument for tabs.create() would do it, if I'm reading the API docs right.

Anyway, I'll look into that when I have a moment. Things are starting to settle down a bit at work, so I might be able to spare some time to look into things soon.

momoe commented 5 years ago

I just want to follow up, I've been trying out the experimental feature and it's been working really well with "LazyLoad". I can set the timer for 1-second, and it will open the new tabs sequentially and LazyLoad will keep them queued until the preceding tab is finished. Even if I bulk of many pages to load tabs, they'll populate and still remain queued until ready.

AutoDownload really does needs a bit of attention though, it's not functioning reliably. I hope you have time in the near future to take a look into that.

All the best

momoe commented 5 years ago

It's been awhile, but I want to follow up. Raccoony seems to be working reliably in Waterfox, presumably because they're on the Firefox's LTS thread.

Firefox (latest public) seems to still have issues with the Auto downloading. I've also spun up a fresh Ubuntu Linux install, and it's even affected on that.

It appears that if I refresh the page 3-5 times the auto downloader will eventually initialize, but so far it's about 20% successful.

Simon-Tesla commented 4 years ago

Issue is that there's a race condition between when raccoony receives its settings (which tells it to auto-download) and when it checks to see whether it should auto-download.