Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup blocked 1

Status
Not open for further replies.

JeanPhil

Programmer
Dec 23, 2003
27
CA
I was just wandering if there is a way to counter all the popup blocker like in the google bar ? I have a big system that rely a lot on opening windows with Javascript and I need to deactivate my popup blocker so that I can use it. Any idea ? Thanks.
 
That's something that you'll have to do manually, you can't deactivate them from a javascript program. If there was a solution to avoid all the pop-up blockers, then everybody that coded popups would use that solution. That being the case, pop-up blockers would be useless.

-kaht

banghead.gif
 
That's what I tought but I know there is some really clever programmers here so I tried ;)

It still sucks !!!
 
there is a solution make your own webbrowser with custom popupblocker. It is actually a lot less complicated then people think.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Use a decent popupblocker with a whitelist and this shouldn't be a problem. Just whitelist the domain that your big system is and watch the popup goodness ensue for that domain.

If you need a recommendation on a good one might I suggest
 
alls you have to do to disable popups for a website in the google toolbar is click the button at the top and it will whitelist the entire domain.

___________________________________
[morse]--... ...--[/morse], Eric.
 
That's what I do but I wanted to know if there was a coding solution so I don't have to do this for all users in the office. Thanks anyway !!
 
FYI

The google toolbar looks for popups that are not caused by user action, and kills them. It will allow "one popup per user click". So, if you have a function that creates a popup when an onclick event is fired, the google toolbar should let it through (at least it should let 1 through).

What this may mean is that you need to add a button to launch the popup, instead of trying to do it onload (or something like that).

Hope this helps.
 
How about instead of a new window, you show a hidden <IFRAME> that is formatted to look like a window? I doubt they're blocking those.

Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Here's a quick and dirty example of how to do it with <IFRAME>
Code:
<html>
<head>
<script>
var winCounter=0
function newWin(url,w,h,l,t){
  winCounter++
  var msg="<div id='win"+winCounter+"' style='position:absolute;border-style:outset;width:"+w+";height:"+h+";left:+"+l+";top:"+t+";'>" +
          "<div style='background-color:blue;text-align:right'><a href='' onclick='document.getElementById(\"win"+winCounter+"\").outerHTML=\"\";return false' style='color:white;font-weight:bold;'>X</a></div>" +
          "<iframe src='"+url+"' width=100% height=100%></iframe></div>"
  document.body.insertAdjacentHTML("beforeEnd", msg);
  return document.getElementById("win"+winCounter);
}
</script>
</head>
<body onload="newWin('[URL unfurl="true"]http://google.com',500,400,20,20);"></body>[/URL]
You could even add drag-n-drop capabilities by using the code here:
Adam
while(ignorance){perpetuate(violence,fear,hatred);life=life-1};
 
Thanks Adam ... that's pretty cool stuff. I can't use it for my system right now but I'll keep it in mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top