M
M
Multigame2016-04-04 12:23:58
Google Chrome
Multigame, 2016-04-04 12:23:58

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

5 answer(s)
M
Multigame, 2016-04-04
@Multigame

Answer How to bypass popup blocker in browsers when using Angular.js ng-click?

M
My joy, 2018-04-23
@t-alexashka

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');
  }
});

S
Sergey Goryachev, 2016-04-04
@webirus

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.

S
sim3x, 2016-04-04
@sim3x

Don't use popup

D
Dimonchik, 2016-04-04
@dimonchik2013

as you find - advertisers will buy for 100500 money

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question