---
title: "Identifiera Opera?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/57427-identifiera-opera"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Peeer"
published: "2002-10-29T17:53:40.000Z"
updated: "2002-10-29T18:02:10.000Z"
replies: 2
views: 169
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/57427-identifiera-opera"
---

# Identifiera Opera?

## #1 — Peeer, 2002-10-29T17:53Z

Hej!
Använder det [nedstående](http://www.webforum.nu/showthread.php?s=&postid=312924#post312924) script (av Pace) för att avgöra vilken browser besökaren använder. Men det verkar ha lite problem med att känna igen Opera. Jag provade med Opera 6.0, Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.0 \[sv\], men det identifierades som IE 5. Vad göra?

```
Function getBrowser()
	Dim Browser, ua
	
	ua = Request.ServerVariables("HTTP_USER_AGENT")
	
	If Instr(ua, "MSIE") Then
		If Instr(ua, "MSIE 6.") Then
			Browser = "Microsoft Internet Explorer 6.x"
		ElseIf Instr(ua, "MSIE 5.") Then
			Browser = "Microsoft Internet Explorer 5.x"
		ElseIf Instr(ua, "MSIE 4.") Then
			Browser = "Microsoft Internet Explorer 4.x"
		ElseIf Instr(ua, "MSIE 3.") Then
			Browser = "Microsoft Internet Explorer 3.x"
			If Instr(ua, "MSIE 3.02") Then
				Browser = "Microsoft Internet Explorer 3.02"
			End If
		Else
			Browser = "Microsoft Internet Explorer"
		End If
	ElseIf Instr(ua, "Mozilla") and Instr(ua, "compatible") = 0 Then
		If Instr(ua, "Netscape6") Then
			Browser = "Netscape Navigator 6.x"
		ElseIf Instr(ua, "Mozilla/4") Then
			Browser = "Netscape Navigator 4.x"
		ElseIf Instr(ua, "Mozilla/3") Then
			Browser = "Netscape Navigator 3.x"
		Else
			Browser = "Netscape Navigator"
		End If
	ElseIf Instr(ua, "Opera") Then
		Browser = "Opera"
	End If
	
	getBrowser = Browser
End Function
```

Permalänk: https://www.webforum.nu/p/57427

## #2 — @nders, 2002-10-29T17:57Z

Flytta upp opera-kollen överst.

```
Function getBrowser()
	Dim Browser, ua
	
	ua = Request.ServerVariables("HTTP_USER_AGENT")
	
	If Instr(ua, "Opera") Then
		Browser = "Opera"	
	ElseIf Instr(ua, "MSIE") Then
		If Instr(ua, "MSIE 6.") Then
			Browser = "Microsoft Internet Explorer 6.x"
		ElseIf Instr(ua, "MSIE 5.") Then
			Browser = "Microsoft Internet Explorer 5.x"
		ElseIf Instr(ua, "MSIE 4.") Then
			Browser = "Microsoft Internet Explorer 4.x"
		ElseIf Instr(ua, "MSIE 3.") Then
			Browser = "Microsoft Internet Explorer 3.x"
			If Instr(ua, "MSIE 3.02") Then
				Browser = "Microsoft Internet Explorer 3.02"
			End If
		Else
			Browser = "Microsoft Internet Explorer"
		End If
	ElseIf Instr(ua, "Mozilla") and Instr(ua, "compatible") = 0 Then
		If Instr(ua, "Netscape6") Then
			Browser = "Netscape Navigator 6.x"
		ElseIf Instr(ua, "Mozilla/4") Then
			Browser = "Netscape Navigator 4.x"
		ElseIf Instr(ua, "Mozilla/3") Then
			Browser = "Netscape Navigator 3.x"
		Else
			Browser = "Netscape Navigator"
		End If
	End If
	
	getBrowser = Browser
End Function
```

Mvh,

Permalänk: https://www.webforum.nu/p/837445

## #3 — Peeer, 2002-10-29T18:02Z

Det borde ju tillomed jag ha förstått.. :r 
Tackar & bockar!

Permalänk: https://www.webforum.nu/p/837451

---

Tråden på webben: https://www.webforum.nu/amne/asp/57427-identifiera-opera
