Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » How to detect the Edge Browser
How to detect the Edge Browser
How to detect the Edge Browser
Hi Stephen and thanks for a very helpful module. I only use it on one client site but it's really neat.
Here are my details:
Joomla 3.8.5
metamod v3.27
Recipe: Detecting Browser type
I need to be able to produce a module when the User employs the M/S Edge browser. It seems that this browser is not on your list of browsers. I have used metamod successfully for Firefox so I know I have the recipe working correctly but I am guessing you have not either updated the program to include this new browser -- or you haven't updated the help files.
Anyway, is it possible to add this browser to your listing or let me know how to detect Edge?
Thanks,
Randy
Re: How to detect the Edge Browser
Hi,
I think you can do it this way:
$ua = @$_SERVER['HTTP_USER_AGENT'];
if (strpos($ua, 'Edge/') !== false) {
echo 'Edge Browser';
}
Note that browser sniffing is officially not a great way to provide content for different browsers. But providing the user agent for Edge browsers continues to contain the string "Edge/" then you're good to go.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » How to detect the Edge Browser
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 166
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked