Update browsers with msie and Opera

This commit is contained in:
Gregory Soutade 2023-04-18 20:30:40 +02:00
parent 71d8ee2113
commit 4b58048198
5 changed files with 24 additions and 9 deletions

View File

@ -60,6 +60,8 @@ browser_icons = {
'Safari':'safari',
'Firefox':'firefox',
'Mozilla':'mozilla',
'Internet Explorer':'msie',
'Opera':'opera',
}
class IWLADisplayBrowsers(IPlugin):

View File

@ -22,8 +22,6 @@ from iwla import IWLA
from iplugin import IPlugin
from display import *
import awstats_data
"""
Display hook

View File

@ -23,8 +23,6 @@ import re
from iwla import IWLA
from iplugin import IPlugin
import awstats_data
"""
Post analysis hook
@ -55,15 +53,18 @@ Statistics deletion :
None
"""
browser_order = ['android', 'iphone', 'xbox', 'edge', 'chrome', 'safari', 'firefox', 'curl', 'wget', 'w3m']
browser_order = ['android', 'iphone', 'xbox', 'edge', 'opera', 'chrome', 'safari', 'firefox', 'ie', 'mozilla', 'curl', 'wget', 'w3m']
browser_hashid = {
'android':'Android',
'iphone':'iPhone',
'edge':'Edg',
'chrome':'Chrom',
'chrome':['Chrom', 'Chrome'],
'safari':'Safari',
'firefox':'Firefox',
'ie':'MSIE',
'mozilla':'Mozilla',
'opera':'OPR',
'xbox':'Xbox',
'curl':'curl',
'wget':'Wget',
@ -77,6 +78,9 @@ browser_name = {
'chrome':'Chrome',
'safari':'Safari',
'firefox':'Firefox',
'ie':'Internet Explorer',
'mozilla':'Mozilla',
'opera':'Opera',
'xbox':'Xbox',
'curl':'Curl',
'wget':'Wget',
@ -101,9 +105,20 @@ class IWLAPostAnalysisBrowsers(IPlugin):
name = 'Unknown'
for browser in browser_order:
if browser_hashid[browser] in user_agent:
name = browser_name[browser]
break
reference = browser_hashid[browser]
if type(reference) == list:
for ref in reference:
if ref in user_agent:
name = browser_name[browser]
break
if name != 'Unknown':
break
else:
if browser_hashid[browser] in user_agent:
name = browser_name[browser]
break
if name == 'Unknown' and 'Macintosh' in user_agent:
name = 'Safari'
super_hit['browser'] = name
break
else:

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B