How to detect "on Screenshot" with Javascript - javascript

I am making a web app similar to instagram and i want to detect and call a function whenever a user takes the screenshot, is their any way to implement this with javascript?

Currently, there is no way to handle a screenshot event through javascript. The screenshot functionality of phones simply has no connection to the browser.

Related

JavaScript : detect and create a fake human click

I'm developing a robot click protection. Of course, it is far from perfect. It is just an extra layer of security as the main protection involves server side log analysis.
Have you any ideas how I could use javascript to detect a fake click fired using javascript? And also, how could a user simulate a perfect, realistic and undetectable human click using javascript?

call/receive data from javascript from an android activity without web view

I created a small application using android studio. When i click a button, which is found in the action bar, I need to first call a javascript method and afterwards get the json data from that javascript method, and show the data in the activity.
I am aware that this can be done by using a web view but if possible, i need to create this without using web view.
hope someone can help me because i'm really stuck here
thanks in advance

Prevent tweet URLs from being opened by native Twitter app on Android

I'm working on an app built in Titanium that has a few "Tweet about this" buttons. Since I can't use the Javascript part of a Tweet button as described in Twitter API, I just use a plain URL with parameters.
On Android, this causes problems. When users click this link, they get a choice how to open it: always the native browser, and additionally any app that has registered for this kind of link. So if the user has the Twitter app installed, Twitter will be shown as one of the options.
That would be great, except the Twitter app is awful. Most types of suggest-a-tweet URL cause the app to crash, and the few that do work don't pass the status text.
I'm looking for a way to force the URL to be opened by the native browser. (Or way to prevent the Twitter app from being among the options presented to the user, but that seems harder to do)
Is this possible using only the URL itself, or maybe a little Javascript? Since I'm using Titanium, Java won't help me.
I can't give you what you want but give you an alternative suggestion.
What you are trying is hard (often impossible to do without errors) even with native code as your trying to work against the OS. Intents are used in android as a way to let the user decide which program should handle a certain request. If you don't want the user to take this decision I'd suggest opening the url in a embedded browser.

"Share Image" button for Android App

Lets say I have an Android html5 app with a picture generated with Javascript by passing a canvas to base64 and then appending it to DOM. I want to add some buttons to my app in order to share that image in, at least, Twitter and Facebook.
I've already seen how to trigger the "Intent" dialog with Java too. Is there any way to do that with Javascript?
Thanks.
Do you use PhoneGap?
If so, try this.
You cannot trigger an Intent dialogue from a regular web page.
If your app has an embedded WebView, you can use a javascript bridge to trigger the native share dialog.
The Android documentation has more info:
http://developer.android.com/reference/android/webkit/WebView.html
I gave a talk on creating a javascript bridge. Here are the slides:
http://www.sqisland.com/talks/progressive-webview

How to contantly report data back with external javascript?

How do services such as Clicktale (and other heatmapping sites) report time on page and mouse movements etc back to their servers using one javascript file?
I understand Google Analytics does it via a gif image but that is only called once. How do you constantly send data back? (Can't use ajax because of cross site scripting limitations).
Cheers, Tim
Take a look at NodeJS, it's an event driven javascript I/O library. Some impressive things have been done with it. See this example which tracks mouse movements and distributes the activity.

Categories