-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
opening in browser with private mode #115
Comments
I think someone mentioned it somewhere. |
Normally this is possible, but I am not affirmative, @TrianguloY when you have time, look at this, and tell me (if you feel like it) what you think: But this will only work with browsers derived from chrome (i.e. all Chromium browsers) |
I'm not so sure, it seems to be an internal feature that you must enable and only available for specific apps, will try though. |
Yes indeed, I just edited my message in this sense, you were too fast |
Found this by looking through App manager.
Still the same issue, and I couldn't find anything similar for firefox. I don't expect the activity to be able to recive urls though, it seems to me that it just pops out the incognito tab, but I have not looked into it. Worst case scenario is to expect the user to copy the url before opening the incognito tab, or force a copy, and then manually pasting the url in the search bar. A cheap solution, but it still saves on clicks. |
Hmm, something to consider, although I'm not sure if it's worth it. In any case if someone implements it I can add it as an experimental feature. Isn't there a third party app that acts as exactly this? (I mean, a browser that is just a redirection to that sub activity or whatever necessary) |
I don't know the limits of this, or how complex is to implement this, but if it works it would be almost like sending the URL directly to the app. Android supports autofill services, it allows to autofill fields in a view from another apps. Autofill services are directed towards passwords managers and only one can be enabled. But there are accesibility services too, which if done properly, it could mimic the same feature, accesibility services allow for more than one service enabled at the same time. However I think the settings need to be tuned on a per app basis. The idea would be to open the incognito tab from URLChecker and then send the URL to the service (which can be bundled with the app). When the view from the browser loads, then the service would fill the URL field. Bitwarden mobile implements both of these. https://developer.android.com/guide/topics/ui/accessibility/service |
Accessibility services are forbidden on play store unless you use them for accessibility. Adding such a feature may work, but it will need to be enabled/disabled depending on the variant (disabled for Play Store, enabled for Fdroid). It isn't so bad, but injecting the url on an external app may stop working at any time (the view identifier may change) so it's a bit dangerous to implement something that isn't simple if it can stop working tomorrow (but as I said, if someone wants to provide a working prototype, I'm open to including it). I know it may seem harder, but maybe a better idea is to ask in the browsers issue trackers for this feature (ability to open an url in incognito from an intent). To be honest if Chrome implements it all the others will eventually... |
Do you mean this? Unless I'm understanding it wrong that is not the case anymore. Althought I must admit it seems like a hassle...
I myself, don't expect them to implement this at all. They even specify this in the source code |
Oh, I wasn't aware of that. The thing is that the accessibility service is almost always the culprit of malicious apps and malware because it allows them basically to see and interact with all apps (see your bank app for example). But it seems that Play Store is aware of it's usefulness and at least it allows fair uses, even if it requires a lot of consents. I may try it...
:( |
Supposedly Firefox allows the use of an extra to do this, but I haven't been able to make it work. |
It does? I wasn't able to find anything. Any source? |
Here you can see references in the code about this. Here is an issue about allowing this, the status is resolved, and the attachments link to the PR that solves it (there are 2 PRs because they were migrating the repo). I haven´t been able to make it work, even on Firefox nightly, I don't know what I'm missing. |
t=new Intent(Intent.ACTION_VIEW,Uri.parse("http://google.es"))
t.putExtra("private_browsing_mode",true)
cntx.startActivity(t) It works! I'm using the latest play store Firefox version, and I can confirm that the code above works! (even if UrlChecker is opened and then you choose Firefox, thanks past me for keeping the original intent) Thank you for the discovery and the links! I remember seeing that class, but probably didn't invest much time searching. Reopening to implement! |
I wrote the extra all in caps that's why I couldn't make it work 🤦♂️
|
That's not a bad idea, although with the clipboard restrictions that Android has now it may be more difficult than expected. In any case we can add custom features for each browser as needed, and toast/messages to notify or guide the user. I have a working version for Firefox on my computer, let me upload it first and then feel free to adapt as needed. |
(done) |
I finally have some time to try to implement this, so first a recap to keep things clear, also if someone wants to add something. A browser can:
A browser with incognito mode can support opening it with an intent via:
A browser can:
If a browser ignores the URL we can:
For the clipboard:
If the user is in a higher android version we can't restore the clipboard from background, alternatives:
I think there are other alternatives, but too complex, at that point an accesibility service would be better. |
Basically that, yes. A couple extra notes: The accessibility service is almost forbidden on play store (I think you need a special permission and the app must be of a special type, but I don't know for sure). If it can't be published, I don't mind keeping 2 versions, one for fdroid with it and another for play store without. Using the clipboard doesn't seem very user friendly, but I guess it's better than nothing. For restoring it afterwards another solution may be to create a floating button on screen (like the pip video, or those chat bubbles). |
Glad I searched before making a feature request, since it led me here. Sorry, I'm not a dev, and just wanted to ask if I'm understanding correctly. So having the app open a link in incognito is possible on Firefox, but not on Chrome? Amazing app btw! |
To be precise: if it is possible, we don't know how yet. On android you can open apps by sending data to them. In the case of browsers you simply send them a url and they know how to handle it. For private browsing there is no standard "hey open this on private mode pls" message, so apps must implement their own. Firefox does have their own message, that we use, but chrome doesn't (at least not a few months ago). There are alternatives like trying to automate what the user needs to do (open chrome, open private, paste url, press enter) but they have more problems than not :( |
I think I did check those flags when working on this, I don't remember it working outside of custom tabs, but I'm not sure, will have to check that again. I myself haven't given up on this, but when I did the code it "worked" (using the clipboard). The problem was that the code was awful and there were a lot more things to consider when using the clipboard from the background. These past weeks I have been trying to make some time for this as I feel kind of guilty for personally using the "bad version" I made some months back without making a PR. Hopefully I can find some time in the near future as the festivities of my country are so close. |
@PabloOQ work on this |
It would be nice to have a button that enable opening the link in browser with private mode (such as firefox, brave, etc) like the custom tabs.
This is useful if you do not want to keep cookie and history only for some links
Thanks for the app
Luca
The text was updated successfully, but these errors were encountered: