Bypass pop up blocker using .Net

I have a page that I want to show using .Net code even when the popup blocker is enabled on Safari.

Is there any way to do this?

popup-Blocker.gif
ArikkanAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

it_saigeDeveloperCommented:
You cannot *directly* control these client settings from your page (if you could then pop-up blockers would be useless).

Either have the client add your site to their exceptions list (or trusted sites), or don't use a pop-up.

-saige-
0
ArikkanAuthor Commented:
Then how do certain banking sites do this.
I have my popup blocker enabled in almost every browser and they are able to open popups !!!!
0
it_saigeDeveloperCommented:
Because they use SSL certificates from trusted third-parties.  It's all about trust.

Also, banks (and other entities) will provide support pages for clients that have problems viewing their sites.

-saige-
0
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

ArikkanAuthor Commented:
So how exactly did they bypass the popup blocker.
I am not even logged in to their website.

See this site:
http://www.hdfcbank.com/
0
it_saigeDeveloperCommented:
As I said, it's all about trust.  The general rule is that popup blockers will engage if window.open or similar is invoked from a client-side script that is not invoked by direct user action. In other words, you can call window.open in response to a button click without getting hit by the popup blocker, but if you put the same code in a timer event it will be blocked.

Another way to show trust is by using a third-party certificate from a trusted authority; e.g. - GoDaddy.  The more you can do to make the browser trust your site, the less likely that the browser will prevent the user to interact with your site.

-saige-
0
ArikkanAuthor Commented:
I am working on a solution where I have an element <Asp:Treeview....>

popup-Blocker2.gif
Now it does " ScriptManager.RegisterStartupScript()" at the back end when the Child node is selected for opening a new window. Even though this is a Client click (Direct User Action), the Popup window is still blocked. What am I missing here?

I have a sample solution created for you as well.

View all files for Question ID: 28630908
https://filedb.experts-exchange.com/incoming/ee-stuff/8409-BypassPopupBlocker.zip

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/8409-BypassPopupBlocker.zip
0
ArikkanAuthor Commented:
I created a javascript function at front end:

    <script type="text/javascript" language="javascript">
        function openpopup(url)
        {
            window.open(url, '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,titlebar=no');
        }    
    </script>


and used this code at backend:
---------------------------------------------------------------------------------------------------------------------------------------------------
-- Try 1
---------------------------------------------------------------------------------------------------------------------------------------------------
   Protected Sub tvwAccountDetails_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tvwAccountDetails.SelectedNodeChanged
 
       Dim url As String = "http://www.google.com"
        Dim winFeatures As String = "toolbar=no,status=no,menubar=no,location=center,scrollbars=yes,resizable=no,height=650,width=825"
        ScriptManager.RegisterStartupScript(Me, GetType(String), "WINDOW_OPEN", String.Format("<script type='text/javascript'>var popup=window.open('{0}', 'yourWin', '{1}'); </script>", url, winFeatures), True)
    End Sub
---------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------
-- Try 2
---------------------------------------------------------------------------------------------------------------------------------------------------
  Protected Sub tvwAccountDetails_SelectedNodeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tvwAccountDetails.SelectedNodeChanged
        Dim sb As StringBuilder = New StringBuilder()
        sb.Append("<script language='javascript' type='text/javascript'> ")
        sb.Append("openpopup('" + "http://www.google.com" + "')")
        sb.Append("</script>")

        ScriptManager.RegisterStartupScript(Me, GetType(String), "WINDOW_OPEN", sb.ToString(), True)
    End Sub
---------------------------------------------------------------------------------------------------------------------------------------------------

None of these worked :-(
0
giltjrCommented:
I visited http://www.hdfcbank.com/ and did not see a true "pop-up".  I did see a CSS overlay.

Here is an example https://blog.udemy.com/css-overlay/
0
ArikkanAuthor Commented:
Our current production site is SSL enabled and we want to show popups (Reports) without getting hit by popup blocker.

Can you give us a sample solution for this ?
0
giltjrCommented:
That I am aware of you can't bypass a popup.  The user must allow pop-us from your site.  If you could bypass pop-up blocking, that would make it useless.

Again, the site you referenced is not doing a pop-up.  They are doing a css overlay.

Now you can try to do a pop-up and if it fails, put a message up saying that the user must allow pop-ups from this site.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ArikkanAuthor Commented:
ok. Perhaps I can just do a message saying "Popup Blocker is enabled. Please turn it off to see the popup."

Is there any way to make the Message look prettier? The alert window looks kinda nasty.  :-(
0
giltjrCommented:
Yes there is, but I don't know how.  I see if I can find out from one of our developers.

Somehow they detect this and re-write a portion of our login page at the top of our page that basically states:

There is a Pop-up blocker enabled on your computer which will prevent  XXXXXXXXXX from functioning properly. Please reconfigure your Pop-up Blocker to allow pop-ups from YYYYYY.XXX and then refresh this page before signing in to XXXXXXXX.
0
ArikkanAuthor Commented:
I found one software under MIT license:   http://tristanedwards.me/sweetalert

This pretty much does the job.
But I am not sure about the MIT License:  https://github.com/t4t5/sweetalert/blob/master/LICENSE

Do I have to include something on my website or can I just use the software without making any references to the software.
I am confused by the License (even though it is written in simple language).


See this: (Not sure what I need to do here) -
"The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software."


Does this go on the source? Or does it have to display?
Please guide.
0
it_saigeDeveloperCommented:
You only need to include the license in the source code.

-saige-
0
giltjrCommented:
it_saige is correct you have to have it in the code, since the code appears to be css/javascript, you need to keep it in the css/javascript files.

Now are you going to use that code as the "pop-up" alert saying they have a pop-up blocker?  Or are you going to use that code to "pop-up" your report?  That code uses the css overlay I've been talking about.
0
ArikkanAuthor Commented:
I am just going to use it as an alert to user as a message that pop up blocker is enabled. Please disable it if you want to see the report.
0
ArikkanAuthor Commented:
Cute Alert Message with SweetAlert
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.