После обсуждения → эта тема: автономный скрипт ссылки на веб-приложение - запретить ему добавлять ссылки, имеющие определенный класс?
--> https://gist.github.com/kylebarrow/1042026
if(("standalone" in window.navigator) && window.navigator.standalone){ // If you want to prevent remote links in standalone web apps opening Mobile Safari, change 'remotes' to true
var noddy, remotes = false; document.addEventListener('click', function(event) { noddy = event.target;
// Bubble up until we hit link or top HTML element. Warning: BODY element is not compulsory so better to stop on HTML
while(noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {
noddy = noddy.parentNode;
}
if('href' in noddy && noddy.href.indexOf('http') !== -1 && (noddy.href.indexOf(document.location.host) !== -1 || remotes))
{
event.preventDefault();
document.location.href = noddy.href;
}
},false); }
Кто-нибудь может мне помочь? У меня такая же проблема, но я не могу решить ее с помощью этого кода ->
&& !$(noddy).hasClass('lightbox')
Я не знаю, где именно я могу добавить это в скрипт сверху?
Любая идея решить эту проблему? или есть другое решение?
Бест, Лина