Scanstyles does nothing in Webkit/Firefox

Discussion about official Mozilla Firefox builds
Post Reply
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Scanstyles does nothing in Webkit/Firefox

Post by joeg »

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4pre) Gecko/20090923 Shiretoko/3.5.4pre (.NET CLR 3.5.30729) ID:20090923043050

Hi from Berlin,

I just read a story on the BBC about the new "high-tech" university in Saudi Arabia. I decided to look at their website (http://www.kaust.edu.sa/), and when I did, the following window popped up:
Image

I did a bit of websearching and was able to find that the same thing happens at the following sites:
http://www.curvycorners.net/
http://www.blackpaint.co.uk/films/

There's been a brief discussion here on the FF Board, but I didn't find it terribly enlightening.
http://forums.mozillazine.org/viewtopic.php?f=40&t=1483085

I'd appreciate any light anyone can shed on the issue. After all, I don't want to break the Internet.
http://www.youtube.com/watch?v=wrQUWUfmR_I

:-"

JoeG
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
a;skdjfajf;ak
Posts: 17002
Joined: July 10th, 2004, 8:44 am

Re: Scanstyles does nothing in Webkit/Firefox

Post by a;skdjfajf;ak »

All sites WFM, and reading the link you posted from the forum contains the answer, though its not clear as how to fix.

1. enter: about:config in the address/url bar
2. look for: general.useragent.extra.firefox
3. right-click and choose: modify
4. in the dialog box - space- after the string shown and add: Firefox.3.5

Now it should work.
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

@Littlemutt

Thanks very much. Yes, that did it, but I'd be interested in understanding what's going on, if it can be explained in a way that someone who's afraid of breaking the Internet by typing Google into Google would understand.

Moreover, do you think this "fix" will also solve a problem I encounter every now and then (though I can't find an example at the moment) when I get a message from a website that says "You are using an unsupported browser ..."?

Thanks again.

JoeG

P.S. I've (sort of) figured out so far that "scanstyles" is a (hmmm) a "javascript command"(?) that (don't laugh) tells the browser to scan the styles in the code. My problem is that I can't imagine what it actually does or what the aim of the scan is.

And why (if I may ask) doesn't "Shiretoko" make the script happy whereas "Firefox" does? Thanks yet again.
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: Scanstyles does nothing in Webkit/Firefox

Post by Bluefang »

The problem is that the site does crappy browser detection, and then it has some bad logic to determine whether certain features are available or not.

Adding "Firefox" to your user-agent allows sites, that have broken browser detection, to recognize that you're actually using Firefox.

The proper thing the site should do is look for "Gecko", which would detect any Firefox based browser.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

@Bluefang

Thanks.

Hmmm, just as a test, I replaced "Firefox.3.5" with "Gecko", and the pop-up came back.

I still don't really understand, though, what the issue is or what "scanstyles" is supposed to achieve.
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: Scanstyles does nothing in Webkit/Firefox

Post by Bluefang »

No, no, the site should be sniffing for "gecko", it's already in your UA. Since it isn't, you need to add back "Firefox/3.5"

The issue is that the site is poorly programmed, and there's nothing you can do about that.

Basically, this is the code

Code: Select all

if (browser == firefox || browser == webkit)
{
   scanstyles = false
}
else
{
   if (browser == ie)
   {
      scanstyles = true
      do some stuff
   }
   else
   {
      popup firefox/webkit not supported
   }
}

The problem is that when the browser is unknown, the popup error will always occur.

The browser detection is done by looking for keywords in the UA. Since it was looking for "Firefox" specifically (and not "Shiretoko"), your browser was "unknown", so you got the error message.

What the error message should really read is "Unknown browser, disabling scanstyles"
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

@ Bluefang,

Again, thanks very much.

I wrote -> "I still don't really understand, though, what the issue is or what 'scanstyles' is supposed to achieve."

Now I understand what the issue is, but I still don't know "what 'scanstyles' is supposed to achieve."

I've put both javascript + scanstyle and javascript + scanstyles into Google* but found nothing that helped explain what the scanstyles command actually does other than, apparently, identify which browser is accessing the site so that an action will or won't be implemented.

Aren't there several other js commands that do this? https://developer.mozilla.org/en/Browser_Detection_and_Cross_Browser_Support

Other than being "poorly programmed", why would a website (and apparently not many do) use the scanstyles command?

Sorry to take up so much of people's time with this, but I find it interesting, especially in the context of the website that originally got me on to this topic http://www.kaust.edu.sa/). I would have thought the site was programmed by people who knew what they're doing.

Thanks again.

JoeG

* But don't worry: I didn't put "Google" into Google, and I never will. After all, I don't want to break the Internet. :mrgreen:
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Re: Scanstyles does nothing in Webkit/Firefox

Post by Bluefang »

I have no idea and it doesn't really matter. scanstyles is probably just the name of something they internally wrote for their site, and apparently it doesn't support Firefox or webkit. Beyond that, it's meaningless.
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

@ I, Robot aka Sonny,

-> I have no idea and it doesn't really matter.

Given your quote from Dr. Lanning, I don't quite understand how you can be so blithe when it comes to scanstyles.

What if they're "random segments of code that have grouped together to form unexpected protocols"? Who knows? Perhaps one day scanstyles will "... engender questions of free will, creativity, and even the nature of what we might call the soul..."

Anyway thanks for your ongoing interest in the subject and taking the time to write.

JoeG
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4pre) Gecko/20100409 Firefox.3.6.4 (.NET CLR 3.5.30729) ID:20100409042742

With the recent back and forth from Namoroka to Lorentz to Namoroka, somehow this issue re-emerged. The site where I got the "scanstyles" message is: http://www.genome.gov/Glossary/

Having remembered the issue, I exhumed this thread and made the change that littlemutt mentioned. The message is now gone, but I noticed something that made me wonder.

In his solution, littlemutt said, "... in the dialog box - space- after the string shown and add: Firefox.3.5".

What caught my attention is the dot (.) between "Firefox" and "3.5". (Of course, I've now changed "3.5" to "3.6.4".)

As you can see in my build ID, it says (following littlemutt's pattern) Firefox.3.6.4, with a dot between "Firefox" and "3.6.4".

But I've noticed that when the daily the updates come from the server, there's actually a slash where littlemutt has the dot, i.e. "Namoroka/3.6.4pre".

Again, constantly fearing that I might break the Internet and - obviously - having nothing better to do in my life, I'm very worried that I'm doing something that doesn't conform with current standards of something or other.
http://www.youtube.com/watch?v=SNyDTdxSmFQ

What will happen if I change the dot to a slash, ... or even leave a blank!???

Thanks very much.

A very worried JoeG
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
User avatar
a;skdjfajf;ak
Posts: 17002
Joined: July 10th, 2004, 8:44 am

Re: Scanstyles does nothing in Webkit/Firefox

Post by a;skdjfajf;ak »

JoeG wrote:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4pre) Gecko/20100409 Firefox.3.6.4 (.NET CLR 3.5.30729) ID:20100409042742

With the recent back and forth from Namoroka to Lorentz to Namoroka, somehow this issue re-emerged. The site where I got the "scanstyles" message is: http://www.genome.gov/Glossary/

Having remembered the issue, I exhumed this thread and made the change that littlemutt mentioned. The message is now gone, but I noticed something that made me wonder.

In his solution, littlemutt said, "... in the dialog box - space- after the string shown and add: Firefox.3.5".

What caught my attention is the dot (.) between "Firefox" and "3.5". (Of course, I've now changed "3.5" to "3.6.4".)

As you can see in my build ID, it says (following littlemutt's pattern) Firefox.3.6.4, with a dot between "Firefox" and "3.6.4".

But I've noticed that when the daily the updates come from the server, there's actually a slash where littlemutt has the dot, i.e. "Namoroka/3.6.4pre".

Again, constantly fearing that I might break the Internet and - obviously - having nothing better to do in my life, I'm very worried that I'm doing something that doesn't conform with current standards of something or other.
http://www.youtube.com/watch?v=SNyDTdxSmFQ

What will happen if I change the dot to a slash, ... or even leave a blank!???

Thanks very much.

A very worried JoeG


Not to worry. I don't know if things changed, or if I just mis-typed it should be: Firefox/3.5 or if you want more current, not that it matters - you could use: Firefox/3.6.3
User avatar
joeg
Posts: 2616
Joined: October 10th, 2003, 12:37 pm
Location: How can you be in two places at once, when you're not anywhere at all?

Re: Scanstyles does nothing in Webkit/Firefox

Post by joeg »

Thanks littlemutt. One less thing to worry about. :-)
Although every day is Judgment Day, I nonetheless feel like a room without a roof.
Post Reply