Welcome, Guest
Username Password: Remember me

"Smartphone (XHTML)" being served for PC Chrome
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: "Smartphone (XHTML)" being served for PC Chrome

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #454

  • drewgg
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Joomla version: 1.5.20
Mobile Joomla! version: 0.9.7
Chrome version: 5.0.375.127

I've installed Mobile Joomla! on 2 Joomla sites and ran into the same issue. The Chrome brower is loading the XHTML smartphone version instead of the regular site.

It's being triggered in the simple.php plugin lines 60-61.

 
if(preg_match('|'.str_replace(array ('/', '.', '+'), array ('/', '.', '+'), $mime_type).';q=0(.[1-9]+)|i', $_SERVER['HTTP_ACCEPT'], $matches))
$c[$mime_lang] -= (float) $matches[1];
 


The Chrome $_SERVER['HTTP_ACCEPT'] is

application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Because the text/html is showing up directly before the ;q=0.9 the it results in the $c array having this state:
 
Array (
[xhtml] => 2
[html] => 1.1
[wml] => 1
[mhtml] => 1
)
 


instead of

 
Array (
[xhtml] => 2
[html] => 2
[wml] => 1
[mhtml] => 1
)
 


Which results in the smartphone version being served.

As a temporary solution I added another conditional statement that looks at the useragent:

 
if(preg_match('|'.str_replace(array ('/', '.', '+'), array ('/', '.', '+'), $mime_type).';q=0(.[1-9]+)|i', $_SERVER['HTTP_ACCEPT'], $matches))
if (stripos($useragent,'chrome')===FALSE)
$c[$mime_lang] -= (float) $matches[1];
 


Have any advice/ideas on this issue?

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2090

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4866
  • Karma: 105
What is the UserAgentString of your browser (you can check it at mobilejoomla.com/ua.php)?
Actually, "Mobile - Webbots" plugin should override results of "Mobile - Simple" for most of desktop browsers.

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2091

  • drewgg
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Your user agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4

Is the useragent on the Chrome browser that loads the mobile version.

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2093

  • drewgg
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
dryabov wrote:
Actually, "Mobile - Webbots" plugin should override results of "Mobile - Simple" for most of desktop browsers.


Would the `order` of the plugins in Joomla effect which plugins override each other? The order the Mobile plugins were installed as is as follows:

"Mobile - Webbots" : -1
"Mobile - Simple" : 0
"Mobile - TeraWURFL" : 0 (this is disabled since we're not running MySQLi)
"Mobile - Always" : 8
"Mobile - Domains" : 9

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2095

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4866
  • Karma: 105
The order should be Simple->Webbots->TeraWURFL->Always->Domains.

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2096

  • drewgg
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 0
Oh good. After correcting that it works correctly for Chrome.

On a related note though. Two of the phones we have on hand are showing the non-mobile site instead of the smartphone. Here are their useragents:

SAMSUNG-SGH-I617/UCHJ1 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)

HTC_Touch_Pro2_T7373 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 8.12; MSIEMobile 6.0)

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2097

  • markflan
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hello. I'm having the same issue and I didn't follow what you did to change the order of the plugins. Here is how I have them.

Simple 1
Webbots 2
TeraWURFL 3
Always 4
Domains 5

I am still not getting the default template with Chrome.

I'm sure it must be something simple but I just must be especially dense tongiht!

Any help would be appreciated. Thanks!

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2098

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4866
  • Karma: 105
markflan, are all of them published?

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2105

  • miohtama
  • OFFLINE
  • Expert Boarder
  • Posts: 112
  • Karma: 4
drewgg wrote:
SAMSUNG-SGH-I617/UCHJ1 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)

HTC_Touch_Pro2_T7373 Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 8.12; MSIEMobile 6.0)


If you suspect it is user agent problem you can test against TeraWurfl here:

www.tera-wurfl.com/explore/

"Smartphone (XHTML)" being served for PC Chrome 13 years, 8 months ago #2107

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4866
  • Karma: 105
miohtama, it's not a problem of TeraWURFL as drewgg doesn't use MySQLi.

drewgg, without database like TeraWURFL it's impossible to determine all of mobile devices correctly. It's better to have full webpages on some mobile devices that mobile webpages on some desktop browsers.
  • Page:
  • 1
  • 2
Time to create page: 0.26 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.