ID:1823526
 
I've been struggling to get this one working for the last few hours, but I finally figured out what was going wrong. You can't directly detect the version of IE in DreamSeeker because it's in compatability mode, even when you set it to edge with a meta header. Trying to detect the version in Dream Seeker returns IE7.

I found a partly functioning version of this code on StackOverflow, and then added some object tests for IE to get around this issue.

<!DOCTYPE html>
<HTML>
<HEAD>
<META http-equiv="X-UA-Compatible" content="IE=edge">
</HEAD>
<BODY></BODY>
<SCRIPT type="text/javascript">
function get_browser_info(){
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
return {name:'Internet Explorer',version:(tem[1]||'')};
}
if(M[1]==='Chrome'){
tem=ua.match(/\bOPR\/(\d+)/)
if(tem!=null) {return {name:'Opera', version:tem[1]};}
}
M=M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
if((tem=ua.match(/version\/(\d+)/i))!=null) {M.splice(1,1,tem[1]);}
var ret = {
name: M[0],
version: M[1]
};
if(ret.name==="MSIE"&&ret.version==="7")
{
ret.name = "Internet Explorer";
if(typeof navigator.maxTouchPoints !="undefined") ret.version = "11";
else if(document.all && window.matchMedia) ret.version = "10";
else if(XDomainRequest && window.msPerformance) ret.version = "9";
else if(XDomainRequest) ret.version = "8";
else if(document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") ret.version = "7";
else if(document.compatMode && document.all) ret.version = "6"; //uhh?
else if(window.createPopup) ret.version = "5.5";
else if(document.all) ret.version = "4";
}
return ret;
}

window.onload = function() {
var browser = get_browser_info()
window.location = "byond://winset?command=setBrowser " + encodeURIComponent(browser.name) + " " + encodeURIComponent(browser.version);
}
</SCRIPT>
</HTML>


Then, all you need to do is just set up the verb on the client:

client
var
browser
browser_version
verb
setBrowser(Browser as text,Version as num)
set hidden = 1
browser = Browser
browser_version = Version

New()
src << browse('version test.html',"window=hiddenbrowser;")
..()


Make certain you put a hidden browser in your interface somewhere named "hiddenbrowser".
else if(document.compatMode && document.all) ret.version = "6"; //uhh?


Had me going lol
Whether or not I use the webclient or DS, I seem to get a "libbyond" user agent of some sort.
Interesting. Can I get specific specs about your system and the output this is generating?

Specifically, I want to know your OS, installed version of IE, and what browser you are attempting to access via the webclient. I'd also like to know whether you are hosting your world in DD or DS, and what the value of browser and browser version refer to in your tests.
Slightly late update here but: the libbyond user agent is sent when the server sends requests (e.g. world.Export). Client requests in any popup will result in the correct user agent (which, by the way, will always be IE so you can probably trim that opera/chrome catching).
(which, by the way, will always be IE so you can probably trim that opera/chrome catching).

Actually, I can't because of the webclient. That's of course assuming this even works in the webclient. I haven't done enough research to see.

As for Ishuri's issue, I spoke with him some months back, and it turns out he'd fully misunderstood what this was for. We hammered that out via PM.