Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the HTTP-BrowserDetect CPAN distribution.

Report information
The Basics
Id: 52355
Status: resolved
Priority: 0/
Queue: HTTP-BrowserDetect

People
Owner: Nobody in particular
Requestors: mpelzer [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: patch to detect RealPlayer
Find attached a patch that allows the detection if the web-site is being opened inside the RealPlayer's browser. The RealPlayer uses the MSIE engine under windows and Safari/Gecko under Mac OS X.
Subject: realplayer.patch
*** HTTP-BrowserDetect-1.06/lib/HTTP/BrowserDetect.pm 2009-11-24 18:09:43.000000000 +0000 --- source/svn/HTTP-BrowserDetect/lib/HTTP/BrowserDetect.pm 2009-12-02 13:49:49.088146375 +0000 *************** *** 52,58 **** aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs ! mozilla gecko ); # Robots --- 52,58 ---- aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs ! mozilla gecko r1 ); # Robots *************** *** 610,615 **** --- 610,625 ---- } } + # RealPlayer + $tests->{REALPLAYER} = ( index( $ua, "r1" ) != -1 || index( $ua, "realplayer" ) != -1 ); + + $self->{realplayer_version} = undef; + if ( $tests->{REALPLAYER} ) { + if ($ua =~ /realplayer\/([\d\.]+)/) { + $self->{realplayer_version} = $1; + } + } + $self->{major} = $major; $self->{minor} = $minor; $self->{beta} = $beta; *************** *** 656,661 **** --- 666,685 ---- return $os_string; } + sub realplayer { + my ( $self, $check ) = _self_or_default(@_); + + return 1 if $self->{tests}->{REALPLAYER}; + return 0; + } + + sub realplayer_version { + my ( $self, $check ) = _self_or_default(@_); + + return $self->{realplayer_version} if exists $self->{realplayer_version} && $self->{realplayer_version}; + return 0; + } + sub gecko_version { my ( $self, $check ) = _self_or_default(@_); my $version;
On Wed Dec 02 09:06:51 2009, MPELZER wrote: Show quoted text
> Find attached a patch that allows the detection if the web-site is > being opened inside the > RealPlayer's browser. The RealPlayer uses the MSIE engine under > windows and Safari/Gecko > under Mac OS X.
Hi, Thanks for this! Could you also provide me with some UserAgent strings (Windows + OS X) so that I can add the appropriate test cases? Thanks, Olaf
Subject: Re: [rt.cpan.org #52355] patch to detect RealPlayer
Date: Thu, 3 Dec 2009 10:00:37 +0100
To: Olaf Alders via RT <bug-HTTP-BrowserDetect [...] rt.cpan.org>
From: Marc Sebastian Pelzer <mpelzer [...] gmail.com>
Hi Olaf, here we go: RealPlayer version10, Mac OS X: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.9 (KHTML, like Gecko) RealPlayer/10.1.0.503 RealPlayer version 11, Mac OS X: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.9 (KHTML, like Gecko) RealPlayer/11.0.1.949 RealPlayer SP, Windows 7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; (R1 1.6)) It's important to know that the RealPlayer version can only be detected in the UA-String for the Mac version of the player. So, the realplayer_version() method is not sooo super useful and should only be combined with $browser->mac(). However, the realplayer() method can be used to detect if one is running "inside" the RealPlayer and it is very reliable. Cheers, Marc <URL: https://rt.cpan.org/Ticket/Display.html?id=52355 > On Wed Dec 02 09:06:51 2009, MPELZER wrote: Find attached a patch that allows the detection if the web-site is being opened inside the RealPlayer's browser. The RealPlayer uses the MSIE engine under windows and Safari/Gecko under Mac OS X. Hi, Thanks for this! Could you also provide me with some UserAgent strings (Windows + OS X) so that I can add the appropriate test cases? Thanks, Olaf
Hi Marc, Thanks very much for your patch. I've added it to the code and it will be available in the next release, which will hopefully be out soon. All the best, Olaf