joshdick / tabclip

Copy browser tabs to (and create browser tabs from) your clipboard.
MIT License
11 stars 2 forks source link

Feature request: timed opening #24

Open cheater opened 4 years ago

cheater commented 4 years ago

Hi! I love tabclip, it's my top favourite addon after uBlock Origin. Thanks a lot for making it!

There's one thing that I would love it to do that it doesn't right now. I sometimes open a lot of tabs at the same time (for example, moving a window of tabs from one Firefox profile to another one). Tabclip opens all tabs at the same time. So if it's e.g. google search results, google will eventually ban me and require me to solve a captcha. If it's steam store pages, then I'll get temporarily banned as well. I would appreciate a setting that lets me set the wait time between opening subsequent pages.

In the current UI, the "paste part" looks like this:

[] In Background [Paste]

You could change it to:

[] In Background [] Wait between tabs: [__] seconds [Paste]

where [__] means a text field. It should default to zero. If it is empty or contains zero there should be no wait at all. It should accept decimal points.

I would really appreciate it if you could add this feature!

Currently there is another addon called "Multiple URL Opener" that does this, but it's ad/spyware - it hijacks the url of the new tab page and sets it to some odd search engine. I've only found it after searching for it today - I've been using tabclip for ages and I'd love to keep using only that.

Thank you!

joshdick commented 4 years ago

That shouldn’t be too difficult to implement, I’ll try to make time for it this week.

Thanks for the suggestion!

cheater commented 4 years ago

Wow, thanks a lot!

Thinking I should add some more suggestions... :-)

cheater commented 4 years ago

Hey Josh, I was wondering if you've had a chance to look at it? Thanks :)

On Sun, Jul 12, 2020 at 9:46 AM Josh Dick notifications@github.com wrote:

That shouldn’t be too difficult to implement, I’ll try to make time for it this week.

Thanks for the suggestion!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joshdick/tabclip/issues/24#issuecomment-657187556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABPWPRYLXTN4GYLE5T3QIDR3FS6HANCNFSM4OXVXWBA .

joshdick commented 4 years ago

I took a look last week and forgot to write an update here, sorry!

I was able to get basic open-with-delay working more or less as I anticipated, but there's a problem with the implementation: it stops opening tabs in the background if the popup is dismissed.

I'm not completely sure it's fixable at all, but if it is, a larger reworking of the way tabs are opened throughout the extension will be required.

I haven't had a chance to do this larger reworking yet. No promises on the timeline, I'll get to it when I can.

cheater commented 4 years ago

Thanks! Sorry to hear you hit a snag. I'm sure you'll figure something out, though!

cheater commented 4 years ago

I took a look last week and forgot to write an update here, sorry!

I was able to get basic open-with-delay working more or less as I anticipated, but there's a problem with the implementation: it stops opening tabs in the background if the popup is dismissed.

I'm not completely sure it's fixable at all, but if it is, a larger reworking of the way tabs are opened throughout the extension will be required.

I haven't had a chance to do this larger reworking yet. No promises on the timeline, I'll get to it when I can.

One thing I've seen other plugins do is they will open a tab for the time they are executing something longer. I think that could work well in this situation. It's what that other plugin does too (Multiple URL Opener).

cheater commented 3 years ago

What if you opened new tabs as something like:

moz-extension://abcdefg-d0a5-485c-961f-617de924402d/wait.html?timestamp=1298765981&url=...

wait.html would wait until the timestamp has been reached, and then navigate to the url. This wouldn't rely on the pop-up UI.

cheater commented 3 years ago

Note that this could still create an issue if your PC freezes for like a minute (due to eg IO issues or OOM) and then resumes - it could resume after a bunch of tabs have been scheduled to open. But it's better than nothing, I think.

Maybe a for() loop with a timer that measures time differences could be resilient to this, something like:

for (wait = get_wait_time_from_url(); wait > 0; wait--) {
  sleep(1)
}
navigate_to_url()

this would make sure that at least the adequate amount of seconds had been waited, and that if one tab is set to wait 60 seconds and another is set to wait 61 seconds, then they will open at least 1 second apart, even if there was a, say, 180-second pause due to OOM somewhere in the middle.

This would require this sort of URL format, different than the one in the previous comment:

moz-extension://abcdefg-d0a5-485c-961f-617de924402d/wait.html?wait=60&url=...

Note that this isn't a rare scenario, for example I often have heavy compilations running in the background, and my browser will freeze for a second or five. I'm sure people with slower PCs experience that not so infrequently too. The solution is simple too.