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
Related
So that I don't ask the wrong question, my end goal is to build a PWA that is accessible from Android 5.x and up now and iOS later in the year. The main problem with this is Classic Bluetooth is not yet stable/standardized enough for the web.
My next plan was to build a "native" app (in .NET MAUI so that I can reuse parts in iOS) using a WebView for displaying the PWA and calling back to the native app for Bluetooth. The problem here is the WebView version on the devices I have to support doesn't support PWAs, service workers, etc. (upgrading the hundred or so hardware devices is not possible, upgrading the OS is not possible, and it's pre-Android-8 so upgrading WebView is not possible without a new ROM).
Finally I've tried installing Chrome via device management and using "Chrome Custom Tabs" from MAUI. The simplest implementation works:
// Browser is <IBrowser>Microsoft.Maui.ApplicationModel.Browser.Default
await Browser.OpenAsync(
"https://www.whatismybrowser.com/detect/what-is-my-user-agent/",
BrowserLaunchMode.SystemPreferred);
and the tab is displayed "in" my app, however the location bar is shown within the tab:
Which brings me to the question:
How do I use a Chrome Custom Tab from MAUI but hide the location bar? Is this even possible?
There's little to no documentation on this for MAUI. I've tried looking through the MAUI source, but all I can see are some options:
await Browser.OpenAsync("https://www.whatismybrowser.com/detect/what-is-my-user-agent/", new BrowserLaunchOptions
{
LaunchMode = BrowserLaunchMode.SystemPreferred, // open inside the MAUI app, i.e. Custom Tab
TitleMode = BrowserTitleMode.Hide, // doesn't seem to have any effect
Flags = BrowserLaunchFlags.LaunchAdjacent // the only Android flag
});
The LaunchAdjacent flag just opens "up" instead of sideways. The other flags are for iOS, detailed here. The TitleMode doesn't seem to do anything.
Reading about Chrome Custom Tabs here, it appears it's not possible, unless I own the destination URL and setup a Trusted Web Activity. Hosting a web app combined with a native app for Bluetooth may be the only way to go if I can't use a WebView.
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.
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.
I have a website that I've just created that has a jquery-ui slider bar link removed
The slider bar doesn't seems to work properly on my phone which is an android - it could affect other mobile browsers too.
Is there a way of fixing this?
Thanks
I've just had a look on my phone and it also doesn't work. However, I have noticed in the past that other JavaScript items (on other sites) also don't work, so I don't think it's a specific problem with your site.
In terms of a workaround, you could check the viewer's user agent and display a different selection method if they're on a phone.
Sorry that I don't have a example code for you to see. My question is that I have 8 image buttons for my menu and I need to know how to make the image buttons show and not show.
Meaning When you go to the menu on Android it shows 7 buttons and hides the 1 button that's for iOS and when your on the iOS it shows all 8 image buttons. I have search on Google for two days now still lost.
I have one solution for menu buttons: Try this AwesomeMenu link.
You will have to make your own modification according to your requirement.
If you're writing a web app and you need to know if the app is being accessed on an Android device or an iOS device, you should look at the user agent string.
Here's a list of iOS devices and their user agent strings: http://www.enterpriseios.com/wiki/UserAgent (First hit on Google, can't speak for the accuracy).
Here's one for Android devices: http://www.gtrifonov.com/2011/04/15/google-android-user-agent-strings-2/ (again, no idea how accurate; do your own research to be sure).
You just have to look at navigator.userAgent in your JavaScript and figure out what device the user is using. That's a start, anyway. (You'll also want to look at the iOS web app documentation to see Apple's specific meta tags and stuff to make your web app work nicely on iOS, and I'm sure Android has something similar).