Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension occasionally stops working #23

Open
Tomatoide opened this issue Mar 21, 2019 · 16 comments
Open

Extension occasionally stops working #23

Tomatoide opened this issue Mar 21, 2019 · 16 comments

Comments

@Tomatoide
Copy link

Tomatoide commented Mar 21, 2019

Windows 10 1803
Firefox 66 64bit

Every several days the extension stops working completely (no images are sent to compression proxy), and doesn't work again until it gets removed and then reinstalled.. it is not working right now.. thanks

@Tomatoide
Copy link
Author

90,882 - Images processed
1.83 GB (76%) - Data saved
Extreme compression
B&W conversion disabled
proxy hosted on heroku

@changhaitravis
Copy link
Contributor

changhaitravis commented Mar 21, 2019

Yeah, I just noticed this, wasn't happening before, probably caused by the patch I submitted.

Does some sort of background.js crash? It could just have trouble re-attaching itself after firefox restarts or the plugin is toggled off and on again. I didn't modify that part of the code too much though...

Also did this ever happen before this last sunday evening?

@Tomatoide
Copy link
Author

Yes actually this issue is quite old, way before the recent update, I even found a similar complaint on the extension's page on chrome webstore:
Capture

@changhaitravis
Copy link
Contributor

If the listener disappeared and are not getting reattached, we may have to rewrite the code so that the on/off switch in the UI adds and removes the listeners and it's not contingent on the background.js/background.bundle.js getting run the first time. At the very least it'll make it so you can toggle off and on again to regain functionality next time this bug is encountered instead of having to reinstall...

Of course this is assuming that the script isn't completely blowing up.

I'll try and code a version that does that instead over the weekend and try it out for a week. If it works well I may file a pull request.

I would expect the background script to run and add the listeners each time you restart firefox or your phone though...

@changhaitravis
Copy link
Contributor

So I have a version where the listeners are added/removed based on whether bandwidth-hero is enabled. https://github.com/changhaitravis/bandwidth-hero/releases/tag/2.1.2

I also turned off the messaging and replaced it with storage.onChanged()

I'm currently testing it, but I'm not a very heavy user. If I can use it for a month (or beat your record of ~90,000 images, whichever comes first) without having to uninstall and reinstall due to it stop working, I'll file a pull request.

@Tomatoide
Copy link
Author

Tomatoide commented May 9, 2019

It happened again..
I noticed that it seems to happen often after a browser update, after I restart the browser to apply the update, the extension stops sending images to compression proxy. I might give your modified version a try.

@changhaitravis
Copy link
Contributor

My modified version, for whatever reason, survived the last upgrade and add-on certificate expiration thing (currently at 58,952 images). I'd rather that ayastreb pull the code, but the chrome version build on my code's currently untested, so that would need to happen first.

My version's built under a different Add On key so you will want to uninstall the official version otherwise they will stack.

@ayastreb
Copy link
Owner

Published changes from @changhaitravis in v2.1.1, pls update and check if this still happens.
thanks!

@changhaitravis
Copy link
Contributor

I'll keep an eye out for the next browser update. At the very least should be able to turn off and back on again to detach and reattach the onrequest listener, but hopefully it'll just keep working through to the next version somehow.

@Tomatoide
Copy link
Author

Been using the extension past several weeks on firefox android, and this issue has become more and more common, like every other day suddenly no images appear, then I need to go to about:addons, disable the extension and enable it again and after that all images start appearing again and websites work as they should.

@changhaitravis
Copy link
Contributor

This hasn't happened to me, and it makes me think it might be a separate issue, and I primarily use it on Firefox for android.

Do the images have a placeholder, and have the broken file icon in it? This'd mean that it attempted to get the image (likely from your proxy) but something went wrong in its attempt, and it would be good to open up the developer console to see what's happening. It's f12 + network tab on desktop, but on ff for android you'll need to do it over USB. https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE

This is going to be up to you, since I can't reproduce it.

Make sure your proxy URL doesn't have any leading or trailing white-space. Also the gawker family of sites' (gizmodo,kotaku,io9) images don't load while using a non-HTTPS proxy, maybe due to their use of imageset. You might also want to try uninstalling and reinstalling, maybe also try using a different proxy that doesn't need to sleep.

@Tomatoide
Copy link
Author

Tomatoide commented Jun 3, 2019

"Do the images have a placeholder, and have the broken file icon in it?"

No, and pages seem to be stuck in a loading status until I disable and re-enable the extension and instantly images start to appear and the page finishes loading..

Would it be an issue with memory? Maybe the extension gets unloaded? The device I'm using tends to get short of free ram quite often

@changhaitravis
Copy link
Contributor

It's unlikely to be a memory issue, I've used this with an android phone with 1.5GB RAM before, although I kept memory usage very streamlined.

If it does have to do with the state of firefox, then, instead of disabling and enabling, then close firefox from the task manager or stop the firefox process and relaunch, or reboot ur phone. If that works then maybe it's memory or something with firefox itself.

@basilky
Copy link

basilky commented Jun 13, 2019

This issue also affects me. I just added *.google.com* to the disabled sites. After that bandwidth hero is not working on any pages, even after removing that entry from disabled sites.

@changhaitravis
Copy link
Contributor

@basilky hi, thanks for reporting this.

First of all "*" asterisks are not supported, as your hosts/disabled sites are passed into new RegExp() directly. I'll try to sanitize those symbols in upcoming code.

Secondly, there's a bug where, if you have any lines that are "" (empty string), that will match everything and block all the sites. So the immediately solution for you would to be to put in "google.com" in the first and only line, and that should actually satisfy your use case.

@Tomatoide
Copy link
Author

This issue is getting worse:
Now when the mysterious bug happens and the extension stops working, images are still appearing (although uncompressed) unlike old behavior where images stop loading which gives you a hint for the problem unlike being totally unaware and consuming your limited bandwidth.
Also we are basically back to square one; disable/enable button from within the extension ui does nothing and disabling/reenabling the extension from about:addons also does nothing, you have to uninstall and reinstall to get it back to work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants