Browse Source

Fixed unwanted tg proto URLs handling

master
Igor Zhukov 7 years ago
parent
commit
32f67b18bb
  1. 2
      app/js/lib/ng_utils.js
  2. 3
      app/js/services.js

2
app/js/lib/ng_utils.js

@ -1925,7 +1925,7 @@ angular.module('izhukov.utils', [])
} }
function wrapUrl (url, unsafe) { function wrapUrl (url, unsafe) {
if (!url.match(/^(https?|tg):\/\//i)) { if (!url.match(/^https?:\/\//i)) {
url = 'http://' + url url = 'http://' + url
} }
var tgMeMatch var tgMeMatch

3
app/js/services.js

@ -4797,6 +4797,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
url.search('https://t.me/') === 0) { url.search('https://t.me/') === 0) {
target = '_self' target = '_self'
} }
else if (!url.match(/^https?:\/\//)) {
url = 'http://' + url
}
var popup = window.open(url, target) var popup = window.open(url, target)
try { try {
popup.opener = null; popup.opener = null;

Loading…
Cancel
Save