Jump to content
xisto Community
Sign in to follow this  
Normano

Firefox Addon Check

Recommended Posts

I saw a site that check if i have a ad-block addon in firefox but cant find something like that on google or similar.
I know it exist php scripts that show what browser I have

<?php$useragent = $_SERVER[‘HTTP_USER_AGENT’];if (preg_match(‘|MSIE ([0-9].[0-9]{1,2})|’,$useragent,$matched)) {	$browser_version=$matched[1];	$browser = ‘IE’;} elseif (preg_match( ‘|Opera ([0-9].[0-9]{1,2})|’,$useragent,$matched)) {	$browser_version=$matched[1];	$browser = ‘Opera’;} elseif(preg_match(‘|Firefox/([0-9\.]+)|’,$useragent,$matched)) {		$browser_version=$matched[1];		$browser = ‘Firefox’;} elseif(preg_match(‘|Safari/([0-9\.]+)|’,$useragent,$matched)) {		$browser_version=$matched[1];		$browser = ‘Safari’;} else {		// browser not recognized!	$browser_version = 0;	$browser= ‘other’;}print “browser: $browser $browser_version”;?>
Please help :)
Edited by Normano (see edit history)

Share this post


Link to post
Share on other sites

There's no real way to detect a popup blocker in PHP but it is pretty easy in JavaScript.

<script type="text/JavaScript" language="JavaScript"> var mine = window.open('','','width=1,height=1,left=0,top=0,scrollbars=no'); if(mine)    var popUpsBlocked = false else    var popUpsBlocked = true mine.close()</script>

Just insert that in the HEAD of your code and wether or not their browser blocks popups will be stored in the popUpsBlocked variable.

Share this post


Link to post
Share on other sites

Lol i tought it was php they used, but now I think its javascript, they used code like this
in a file advertisement.js

document.write('<style type="text/css"> .hideitblock2 {visibility:invisible;display:none;}</style>');
in the index file
<script type="text/javascript" src="advertisement.js"></script><noscript><style type="text/css"> .hideitblock2 {visibility:invisible!important;display:none!important;}</style></noscript><table class="hideitblock2" style="position:absolute;top:0px;left:0px;background-color:#000000;" width="100%" height="100%"><td width="100%" height="100%"><h1 align="center"><font color="ff0000">Please Disable Ad-Block or Add Instantz.net To Your Whitelist To View This Website Properly.</h1></td></table>
the code come from http://forums.xisto.com/no_longer_exists/, thanks for the help anyway :)
Edited by Normano (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.