Can Javascript trigger and populate a native mobile context menu? - javascript

The UI library I work on has a pending feature request that involves tapping an in-app button with the intention of triggering a context menu. On desktop devices, this will simply open our standard context menu. However, it was requested that on mobile devices, we try to populate and utilize the OS's context menu behavior.
I've read about specific APIs that can trigger native menus, like using a <select>, or the navigator.share() API for sharing content to other applications. However, in this case, the web app would need to populate the context menu, and would need to perform app-level behavior upon selecting any of the populated items.
Is there a browser API that can do this on iOS and Android devices?

Related

How can I bring up Emoji context menu in Chrome (or other browsers) programatically?

In a sample browser-based chat application, I need a context menu for adding Emojis. I see that most applications like Whatsapp and Gmail have their individually implemented emoji box for this reason. While the browsers mostly already have an embedded emoji box context menu, I need to know is there a way to have control over that box and instead of bringing it up through the browser's context menu, catching it by javascript !?

How to trigger native screenshot function of iOS and Android via JavaScript?

I am currently working on an Ionic Vue App and want to take a screenshot of the entire page. Since I have multiple canvases with different context types on the screen, famous libs like 'html2canvas' do not work for me. The cordova plug-in also was no success for me sadly.
Is there a way to trigger the native screenshot function of a device via JS? The taskbar at the top as well as buttons at the bottom are allowed to be visible on the screenshot.
My app is not designed to be used on PC, so I do not have to worry about this platform.

Android don't detect the loss of focus of a web page when using multi-window

I need to monitor that users viewing my site have the page in the foreground and in focus.
The codes (also partially described in this question ) work correctly in the Desktop environment, however if the user is using Android's multi-window mode then I cannot determine if my site is still in focus or if the user is interacting with another application.
What can I do?
Example of Android's multi-window feature:

How to manipulate cross-browser windows via javascript addon/extension hiding address bar, menu bar, etc?

I am developing a cross-browser MVC web app with a javascript browser extension that uses a background script, is it possible to hide the address bar/navigation, the browser window menus, side bar and other toolbars?
The only thing I really want to keep is the tabs, though I would like to hide the add tab button as well.
This web app will run by itself a browser window, I have already got the extension doing that, so it won't affect other website functionality.
Question: Is this possible, if so, how and what api's should I focus on?
There are two ways to hide a browser's UI:
1) In any environment, you can popup a 'chomeless window' popup, which is discussed here: How do I create a chromeless window?
2) In a mobile environment, primarily Android, you can develop a Progressive Web App which will be able to open the mobile browser without the UI. See: Create a PWA in under 5 min's
Given your use case, it sounds like option 1 is your best bet, but likely it won't satisfy all your requirements.

Javascript/iOS - Open in

Context: iPad, web-based inbrowser application
I want to display the "Open in..." that allows the user to select from a list of editors (Goodreader, for example).
Preferable, I'd like to do this through Javascript.
Is it possible? How?
In don't think you have access to do that inside Mobile Safari, you can only provide the content as a download. Then Mobile Safari will render it inside the browser and provide the ability for the user to perform the Open in.. action.
Alternatively you could always write a native app wrapping a WebView that provides the ability to show a native Open in... dialog.

Categories

Resources