The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-ui/client/lib/cordova/urls.js

17 lines
504 B

Meteor.startup(() => {
if (!Meteor.isCordova) { return; }
// Handle click events for all external URLs
document.addEventListener('deviceready', () => {
// const platform = device.platform.toLowerCase();
$(document).on('click', function(e) {
const $link = $(e.target).closest('a[href]');
if (!($link.length > 0)) { return; }
const url = $link.attr('href');
if (/^https?:\/\/.+/i.test(url) === true) {
window.open(url, '_system');
return e.preventDefault();
}
});
});
});