Answer the question
In order to leave comments, you need to log in
How to avoid popup blocking?
Good afternoon.
We use the Vk.Api procedure call on the site to publish a post on the user's wall (with his consent, of course). So, this procedure is accompanied by confirmation in a pop-up window. Browsers willingly block this window. Is there any way to avoid such blocking?
UPD Blocking is triggered because the second pop-up window is called from JS, if you hang it on a button, then everything works
Answer the question
In order to leave comments, you need to log in
Answer How to bypass popup blocker in browsers when using Angular.js ng-click?
Perhaps not everyone uses angular, so I’ll say a solution for native javascript:
you need to execute an ajax request in synchronous mode (async: false), then the browser will consider this as one thread, and there will be no suspicion:
on jquery it looks something like this:
$.ajax({
type: 'POST',
async: false,
url: '/path/to',
data: { a: b, c: d },
success: function(response) {
window.open('url', '_blank');
}
});
Browsers do not block, but AdBlock is shitty) I didn’t notice others.
Actually, there is hardly a solution, except for adding to exceptions on the user's side.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question