You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
The clipboard is a powerful thing and it can be used to predict user actions - as it is already used in mobile devices.
Idea
In order for the user's data to be safe, you need to ask permission before reading.
But before asking, we could check the contents for the presence of a pattern - at the same time, we do not receive data, but only information(true/false) about whether the contents of the clipboard correspond to our pattern. This is already available in native mobile apps.
Suggestion
I suggest thinking about implementing this behavior in browsers. This will allow us to process such cases, for example - a user logged in to the Internet banking website with a phone number in the clipboard - we can immediately offer to make a money transfer to this number, saving the user time
Promise<boolean> match(RegExp reg);
Usage examples
This will allow us to process such cases, for example - a user logged in to the website with a phone number in the clipboard - we can immediately offer to make a money transfer to this number, saving the user time
const phoneNumberReg = ^(\([0-9]{3}\)|[0-9]{3}-)[0-9]{3}-[0-9]{4}$;
// ask only if necessary
navigator.clipboard.match(phoneNumberReg).then(
(res) => {
if(res) {
return navigator.clipboard.readText();
}
}
);
Native Apps and Web Apps
Let's close the feature gap!
The text was updated successfully, but these errors were encountered:
Hi!
The clipboard is a powerful thing and it can be used to predict user actions - as it is already used in mobile devices.
Idea
In order for the user's data to be safe, you need to ask permission before reading.
But before asking, we could check the contents for the presence of a pattern - at the same time, we do not receive data, but only information(
true/false
) about whether the contents of the clipboard correspond to our pattern. This is already available in native mobile apps.Suggestion
I suggest thinking about implementing this behavior in browsers. This will allow us to process such cases, for example - a user logged in to the Internet banking website with a phone number in the clipboard - we can immediately offer to make a money transfer to this number, saving the user time
Usage examples
This will allow us to process such cases, for example - a user logged in to the website with a phone number in the clipboard - we can immediately offer to make a money transfer to this number, saving the user time
Native Apps and Web Apps
Let's close the feature gap!
The text was updated successfully, but these errors were encountered: