drisate Posted April 29, 2010 Share Posted April 29, 2010 Hey guys i am creating a Greasemonkey script that adds an ajax chat to a website. Greasemonkey is an addon for firefox that lets you modify the html code of websites before they are showed to the user. I am in the process of creating a wizz feature that will allow you to send a message to a member and where ever he is on the web his gona receive it. The way it works right now is there's a hidden iframe in every page load and when the player has a message it popups a small window It's working great but the popup is always instantly blocked because firefox has a popup bloker integrated and because it can popup on random websites they don't allow it and there for never gets the message ... Everything else i tryed was blocked by the fact that it opens in the iframe that is invisible I even tryed doing it the old fashon way with an alert() but same thing you don't see it because it's in the hidden frame I am out of ideas ... Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted April 30, 2010 Share Posted April 30, 2010 A hidden iFrame will not allow you to accomplish what you want, however, if it is a visible iframe at the top of the page, you can write the html to display a link to open the box, but that is the best I can think of. Popup blockers are very good at preventing unsolicited popups because there ultimately is only one way to do it--referencing the Document Object Model. It would be less disruptive to provide a link at the top of the page, and you can even make it a blinking graphic if that helps. Most users (especially admins) are more vigilante that you'd expect. Quote Link to comment Share on other sites More sharing options...
Adam Posted April 30, 2010 Share Posted April 30, 2010 It's quite likely the browser is seeing this an XSS attack. You may be able to get away with using the "parent" property to reference a function within the parent document though, opening the window there. Though you'll still see the usual pop-up toolbar asking whether to allow it or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.