How does Lastpass know the current URL in Chrome - android

When browsing around in Chrome for Android, Lastpass pops up with suggestions if it recognizes the URL as one you have associated login details with.
How does it know which URL Chrome is looking at? I know that Lastpass makes use of Accessibility Services, but I wonder how it queries the current URL from Chrome.
PS. Apparently it only works for Chrome (it doesn't pop up in Opera for example) so it might be something Chrome specific.

LastPass on Android asks for Accessibility permission with canRetrieveWindowContent true. This lets it traverse the current view hierarchy, and access the views as AccessibilityNodeInfo objects.
Accessibility API lets you search nodes by the text displayed on the view, and also gives you java class name of each such view. AccessibilityNodeInfo#findAccessibilityNodeInfosByText
The feature doesn't work on Opera probably because the devs never handled the view hierarchy traversing logic for it.
Check out https://developer.android.com/guide/topics/ui/accessibility/services.html

I general using javascript, apart from Andoid functionality, and with some hacking, it is possible to get references to all open windows (and for instance get their URL). See this answer from 2009.

Related

How the Lasspass android app autofill username/password in chrome? [duplicate]

When browsing around in Chrome for Android, Lastpass pops up with suggestions if it recognizes the URL as one you have associated login details with.
How does it know which URL Chrome is looking at? I know that Lastpass makes use of Accessibility Services, but I wonder how it queries the current URL from Chrome.
PS. Apparently it only works for Chrome (it doesn't pop up in Opera for example) so it might be something Chrome specific.
LastPass on Android asks for Accessibility permission with canRetrieveWindowContent true. This lets it traverse the current view hierarchy, and access the views as AccessibilityNodeInfo objects.
Accessibility API lets you search nodes by the text displayed on the view, and also gives you java class name of each such view. AccessibilityNodeInfo#findAccessibilityNodeInfosByText
The feature doesn't work on Opera probably because the devs never handled the view hierarchy traversing logic for it.
Check out https://developer.android.com/guide/topics/ui/accessibility/services.html
I general using javascript, apart from Andoid functionality, and with some hacking, it is possible to get references to all open windows (and for instance get their URL). See this answer from 2009.

How to trigger web extension in Firefox for Android

I have a Firefox add on implemented as a web extension.
When I install the app on firefox for android, there is no button to trigger the action for the app - this is because browser actions are not supported on Firefox for Android
So, next I looked into adding a context menu item, to allow the user to trigger the extension that way. However, unfortunately the context menu API is not supported in Firefox for android either.
So - what options do I have with regards to adding some sort of UI so that the user can trigger my web extension?
It seems like the only answers to this at the current time are:
i) to use pageActions which weren't really designed for this purpose (they are supposed to be for things which are only applicable to certain pages.
ii) as in #Makyen comment above to add something to the dom which is clickable

Android: Block URL

is it somehow possible to create an Android application / service that blocks an URL (or a list or URLs)?
From what I have searched here on StackOverflow and on Google it doesn't seems possible:
https://groups.google.com/forum/?fromgroups#!topic/android-security-discuss/ciepvxyn8UY
However, Norton Safety Minder somehow "blocks" certain websites, although:
It lets the page load entirely before redirecting user (any idea on how they do it?)
It only seems to work for the stock browser (any ideia why? maybe they are listening for changes in the browser bookmark history?)
is it somehow possible to create an Android application / service that blocks an URL (or a list or URLs)?
Not really, for unrooted devices. With root, you might be able to rig up some iptables stuff to route things through some transparent proxy.
It only seems to work for the stock browser (any ideia why? maybe they are listening for changes in the browser bookmark history?)
Given the one Play Store comment ("Going incognito mode bypasses the Web filters. Please fix."), that would be my guess. Script-kiddie techniques like that are never going to be reliable.

How close do links have to be to trigger link preview in Chrome beta?

Some of the users of my website are telling me they find it annoying when they try to touch certain links and instead of activating the link it zooms into the link and associated metadata (which is made up of a few links).
So how many css pixels of separation are needed between the link and the associated data to stop this behaviour?
I also would like to know that, and eventually a js/css trick to disable it on demand.
You can also have a look at this question :
How to prevent google chrome android browser to display the magnifier when users click a button?

How to code Android for the visually impaired?

Does Android support visually impaired users in the same way as HTML alt tags are used to provide input for screen readers on the web?
If so, what is the best practice to code Buttons and ImageViews etc so they can be read by a screen reader?
I'm not quite clear on your question. The internet browser, or any applications that rely heavily on HTML rendering are not accessible This quote is taken from this blog post.
You can turn on the accessibility features by going to Settings --> Accessibility and checking the box "Accessibility". While the web browser and browser-based
applications do not yet "talk" using these enhancements, we're working on them for upcoming releases.
Android does provide screen reader support for a lot of applications, see this wiki page for a list of applications known to work well with Android using a free and open source screen reader.
I can't find any general guidelines for creating accessible apps but this LinkedIn group may be helpful. I don't have a LinkedIn account though so don't know how active the group is.
The best resource I've found on the Android Accessibility API is this code walk through: https://sites.google.com/site/gdevelopercodelabs/android/accessibility
See http://developer.android.com/guide/practices/design/accessibility.html for plenty of details on writing an accessible app.
The nearest equivalent to HTML's ALT is the contentDescription property - set in code or in XML.
If you are creating you own custom control, you'll need to do a bit more work to specify other details too; more details at the link above.
Most important thing: when you're done, test with TalkBack, the free Android screenreader from Google. (It's pre-installed on some Android models, but you can download from Android Market if you don't already have it.) You should be able to navigate to all the interactive elements in your app using the directional pad alone, and TalkBack should read out appropriate values for all elements as it does so. (It should pick up the contentDescription and read it out here.)
One thing to watch for is that from what I remember, the screenreader only reads out things that you can navigate to, so if you have instructional text on the page, it may not read out, so you may need to ensure that the contentDescription for other controls is suitably descriptive. To be sure, test with TalkBack, and see for you self (er, hear for yourself!) if what is read out makes sense.
(As noted in one of the other replies, although Android has an accessibility API, the Android browser doesn't actually support it (yet), so HTML pages - even properly marked up HTML code - isn't accessible on Android using the default browser. There are a couple of 3rd party browsers that add accessibility to HTML, though, such as the free IDEAL Web Reader app, which appears to wrap the Android HTML control and then add voicing on top of it. Hopefully Android will make their default browser fully accessible in some later release...)

Categories

Resources