A forum about BlackHat and Beyond

Would prevent the blocked popup message?

A place where you can discuss any topics about tutorials with other members

by Arturo » 2016-01-13 10:12

I have this web form, right? And it has a "Print this record in the form submission" check box option. When this option is selected, a dynamically created PDF file is displayed with all the information just entered the user (the user can then decide whether to send to your local printer or simply save it to the location of your choice for your own records).

You have to do - and what is currently being done - a new tab / window opens to display the PDF, while the original tab is sent back to the main menu. In my code below, I used Javascript to make the magic happen, and it works great .... except I blocked a popup each time select "Print tab" ... which in turn requires listed I click the small browser button and tell it to allow pop-up window. This would not be a problem if I was the only person using the form. However, that is not the case and this little annoyance for me could easily become a huge issue blown out of proportion to other users.

So my question - and the reason I posted on Web Dev front Javascript or PHP - is whether or not it is the best way to achieve my goal. Is there a cleaner way to do this? Something with a smoother transition that prevents blocked pop, perhaps?
Posts: 37
Joined: 2015-12-05 14:55

by Terry » 2016-01-13 22:28

You will always have problems with popup blockers.

What might work is to determine the regular hyperlinks using the target attribute (eg open link in new window / tab) and click on it to execute.
Posts: 38
Joined: 2015-12-08 16:12

by Boyd » 2016-01-14 9:17

Instead of, perhaps create a hidden form which is subjected to a new page, then send it. Although it occurs to me that I am sure the pop-up blocker authors have also then.
Posts: 36
Joined: 2015-12-11 17:21

by Flowers » 2016-01-14 23:11

I'm a little off topic, but I think it opens a new tab and redirect the same time is very easy to use. I know my father would be lost completely: not even realize when new tabs appear, and when I set your browser to switch to new tabs automatically, you do not understand why you can not use the function history.back.

I tabs is really a user feature and not an advocacy role. I'd recommend using an iframe to display the PDF in the main window of the place.

You could say that in this case can not be redirected to the main menu immediately, but does not really add a new step because before having to click back into the parent tab to return to the menu, as it would have to click a link or something, so it's no less convenient, but I think it is more explicit, for a link with a label is displayed instead of playing with the user's browser.
Posts: 32
Joined: 2015-12-14 18:15

Return to General Discussion


Who is online

Users browsing this forum: No registered users and 1 guest
SpinnerChief - WhiteHatBox