-
Notifications
You must be signed in to change notification settings - Fork 53
Attempt to fix the problem of the extension working in the background #88
base: main
Are you sure you want to change the base?
Conversation
You might need to update onnxruntime from https://github.com/Wikidepia/hektCaptcha-onnxruntime-web. It seems that hacktimer is not updated regularly, and I found worker-timers (https://github.com/chrisguttandin/worker-timers) which seems to be updated more frequently and can be imported. Can you try it? |
How should I do this? Should I write command I'm bad at Node Js, so such simple things can be difficult for me, sorry, I'm only good at JavaScript and Chrome Extension API |
Hmm, I guess I forgot to push it, will check it later |
I managed to get rid of this error. In the package-lock.json file in "onnxruntime-web" in "resolved" I changed the commit number to the last one that you have on GitHub. Regarding the worker-timers, it really looks better. You can try to just use this project without changes, but it will create a Serivece Worker for each Content Script. Here in the screenshot you can see 6 Service Workers that worker-timers created, and there is only 1 captcha on the page. I also found https://github.com/chrisguttandin/worker-timers-mock, it doesn't seem to use Service Worker, I'll try to test it later. I will still think about solving this problem If you have any other thoughts on this problem, tell me. |
I guess this is the best answer for now, can you run |
Are you sure that the choice with HackTimer will do? |
If I may jump in here... @Serega007RU would you mind sharing with me some specifics of the problem? I would really like to help with this extension. Thanks! |
I explained it in more detail here #53 |
Don't get me wrong, I think your proposed solution with HackTimer might work. What I'm wondering is if the problem is related to setInterval/setTimeout, or the extension/background/service worker becoming inactive. In case of the later, maybe using a keep-alive solution (just pinging background.js with .sendMessage from the active tab, something like that) might do the trick. But it will require targeting ":///*" in host_permissions. In case your current tests with HackTimer doesn't work as expected, let me know and I'll try to add a keep alive alternative for testing. |
please give me a link, I can't find this extension by this name |
Well, I tested it, it works. I mainly checked on reCAPTCHA, but this captcha reacts very badly if the tab is not active, it looks like Google is tracking it. A little disappointed with the result, I still have to keep the tab active. |
Did you test the tab revolver or this fix? |
this extension doesn't fix anything, it just switches tabs one by one at a given time (every 30 seconds by default) |
I think this is ready to merge? Do you have any test / things to add? @Serega007RU |
I think we should wait for a response from the author of worker-timers in chrisguttandin/worker-timers#434. Perhaps we could have missed a better solution to this problem |
Well, it looks like worker-timers should be rewritten for Chrome Extensions so that it works with the background page of the extension. I have no desire to do this. |
Hello! In this Pull Request, I will try to fix the problems of the extension working in the background when the tab on which the extension solves the captcha is not focused.
I will explain for the code. The solution to this problem was based on the code from here https://github.com/turuslan/HackTimer Unfortunately, I can't find a more normal solution to this problem, Chrome does not allow the normal use of setInterval and setTimeout if the tab is not focused. It's a pretty rough decision to use a background expansion process, but it seems to be the only solution.
This PR is still a draft since I can't properly test my code. I do not know why, but after build I get this error in the console.
The extension from the Chrome Web Store works fine. That is, there is something wrong in my assembly or I am somehow assembling it wrong. Help me solve this problem to test my changes.