Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Firefox Addon Check
Normano
post Jul 4 2008, 08:13 PM
Post #1


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 36
Joined: 28-August 07
Member No.: 24,433



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
CODE
<?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 biggrin.gif

This post has been edited by Normano: Jul 4 2008, 08:15 PM
Go to the top of the page
 
+Quote Post
bcarasco
post Jul 6 2008, 07:28 AM
Post #2


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 7
Joined: 3-July 08
From: Portland, OR
Member No.: 31,268



There's no real way to detect a popup blocker in PHP but it is pretty easy in JavaScript.
CODE
<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.
Go to the top of the page
 
+Quote Post
Normano
post Jul 6 2008, 12:24 PM
Post #3


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 36
Joined: 28-August 07
Member No.: 24,433



Lol i tought it was php they used, but now I think its javascript, they used code like this
in a file advertisement.js
CODE
document.write('<style type="text/css"> .hideitblock2 {visibility:invisible;display:none;}</style>');

in the index file
CODE
<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://www.instantz.net/, thanks for the help anyway biggrin.gif

This post has been edited by Normano: Jul 6 2008, 01:03 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Firefox Tab Position(3)
  2. Mozilla Firefox And Runescape(10)
  3. Would You Like To Have A Spell Check For Your IPB?(2)
  4. How Do I Check What Graphics Card I Have?(25)
  5. Disable /change The Find In Page Sound In Firefox(1)
  6. Firefox Update(7)
  7. GreenBrowser - The Tiny No-Install Browser(9)
  8. Dell Laptop Batteries - Explode Into Flames(14)
  9. Opera(52)
  10. Windows Internet Explorer 7 Vs. Mozilla Firefox 2(28)
  11. Firefox 2(5)
  12. Internet Explorer 7 Problem(8)
  13. Disable Crash Recovery Restore Session Option On Firefox 2(3)
  14. Firefox 2 Has A Spell Check!(40)
  15. Firefox Plugins For Web Developers(14)
  1. Settimeout() & Focus() Not Working With Firefox(1)
  2. Parked/addon Domains Help(4)
  3. Opera Vs. Firefox Vs. Internet Explorer(10)
  4. Addon Domain Help(1)
  5. E-mail - Firefox(6)
  6. Recognizing Third-party Content In Firefox(2)
  7. Check Server Headers(3)
  8. Firefox 3(19)
  9. Safari, Firefox And Dns Client Service Behaviour(1)
  10. Css With Firefox(5)
  11. Css Background Not Showing Upin Ie(6)
  12. Make Firefox Look Like Google Chrome(2)
  13. Firefox Dream Packages - Condense(0)


 



- Lo-Fi Version Time is now: 2nd December 2008 - 09:36 PM