stoically / temporary-containers

Firefox Add-on that lets you open automatically managed disposable containers
https://addons.mozilla.org/firefox/addon/temporary-containers/
MIT License
852 stars 60 forks source link

[Need help] Script to clean search engine result URLs #419

Closed crssi closed 4 years ago

crssi commented 4 years ago

@stoically

I need help from you. 😉 On google domains clicking external links are wrapped around https://www.google.com/url?q= on some mouse event. So when using an option to open in a new container only when domain different then link does not open in a new container (separated from google).

I guess I could overcome the problem with a Advanced -> Script where the injected script would strip https://www.google.com/url?q= at the start of destination URL. So for example https://www.google.com/url?q=https://duckduckgo.com would become request for https://duckduckgo.com and this way be opened in a new container also.

Would you be so kind to write such script, which could also be an example script usage for your Wiki?

Thank you in advance and cheers

stoically commented 4 years ago

Hey. This could get tricky real quick. ClearURLs doesn't meet your needs? Works well for me.

crssi commented 4 years ago

No. It does clean as does also Skip Redirect and similars, but the problem is that those are invoked (by Murphy) after TC operation. Result is that the target container is not new in my case.

stoically commented 4 years ago

Copy & pasting ClearURLs google link fixer as-is works (runAt: document_end), however it only works with Automatic Mode in "Don't instantly reopen"-mode, since it seems like TCs scripts are broken without it, huh. Opened https://github.com/stoically/temporary-containers/issues/420 to track that.

crssi commented 4 years ago

Hmm... something doesn't work for me, but I need to test further before writing anything down, since I might have some other setting that's interfering. Will do a trough test over the next few days starting with plain vanilla FF profile + TC starting from default on.

Thank you and cheers ❤️

stoically commented 4 years ago

Might very well be that you're affected by #420 anyhow. Will release a beta with the fix soonish.

stoically commented 4 years ago

Relased v1.9beta1, maybe that works for you.

stoically commented 4 years ago

Also, to verify it works you might want to inspect the network tab, since hovering / holding click looks it doesn't, but it does.

crssi commented 4 years ago

I can confirm that v1.9beta1 resolves the problem.

Thank you soo much :)

crssi commented 4 years ago

Something is not right, but can't reproduce every time. 😢 Will report back when I have more info.

stoically commented 4 years ago

That's unfortunate. If it's not reproducible, then you might want to leave the debug log enabled and send the last few hundred lines once the issue occurs

crssi commented 4 years ago

Will do. Anyway, I do not believe that TC is the problem origin.

stoically commented 4 years ago

Just realized that the script should runAt: document_end (that's what ClearURLs is doing as well). Could help fix the issue.

crssi commented 4 years ago

^^ That nailed it. 👍 Now it works. Thank you.

crssi commented 4 years ago

Still have some problems. I will prepare complete STR, so you can troubleshoot if there is a bug/feature in TC.

But before that I have one question.

How are rules processed in the per domain isolation. I know those are processed in order, but what I don't know, are they processed all even when there is a match in the (for example) first in rules list... does the processing over a rules list stops when first match is hit or it is processed over all for every match to the end of the rules list?

Cheers

stoically commented 4 years ago

I will prepare complete STR, so you can troubleshoot if there is a bug/feature in TC

That'd be helpful since I'm out of ideas :D

does the processing over a rules list stops when first match is hit

Yes, that's what's currently happening.

crssi commented 4 years ago

I have spend all afternoon to reproduce and to be able to make STR out of it... but now it seems everything works. And the script suggested at https://github.com/stoically/temporary-containers/issues/419#issuecomment-641821628 works great... could you just correct from runAt: document_start to runAt: document_end, to avoid confusion, if someone tries to do the same. 😄

Thank you and cheers

stoically commented 4 years ago

Closing since this seems to be resolved.