ID:1781490
 
Resolved
Browser and cache file downloads were sometimes messed up by spurious messages meant for Dream Seeker clients only, usually at startup.
BYOND Version:507
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 40.0.2214.111
Applies to:Webclient
Status: Resolved (507.1280)

This issue has been resolved.
Descriptive Problem Summary:
This is a pretty odd issue and I don't know where to begin.

Numbered Steps to Reproduce Problem:
- Need 4-5+ browser controls that load at startup
- Need the following code in the web resource that loads but it doesn't need to be called by anything which is the kicker.
window.location.href="byond://?clockloaded=1";


This is the entire clock.htm source and ClockLoaded() never gets called by anything. Removing that one line from above stops the repro.

<html>
<head>
<script type="text/javascript">
function ClockLoaded()
{
window.location.href="byond://?clockloaded=1";
}
</script>
</head>
</html>


Here's the reduced repro. Load the page in a WebClient and if it doesn't repro, hit refresh or re-navigate. You will get inconsistent results such as;
1. Chrome trying to download one or more randomly named .htm pages such as 234986.htm, 0.htm, or Clock.htm
2. Chrome will display the "Aw Snap" error message and tell you something went wrong.
3. The page will load but not all browser controls will load.

Repro Project

Here's a look at how the browser content and controls are being initialized. Keep in mind, this was reduced from many different web pages being loaded in various controls but it repro's with just one provided it has the above code.

Code Snippet (if applicable) to Reproduce Problem:
    Login()
{
..()
Mob_SendResources()
}
proc
{
Mob_SendResources()
{
src << browse_rsc('web\\Clock.htm', "Clock.htm"); // Used on default
sleep(1)
src << browse({"<meta http-equiv="Refresh" content="0; url=Clock.htm">"},"window=ClockBrowser"); // Used on default
sleep(1)
src << browse({"<meta http-equiv="Refresh" content="0; url=Clock.htm">"},"window=ActiveUserBrowser"); // Used on default
sleep(1)
src << browse({"<meta http-equiv="Refresh" content="0; url=Clock.htm">"},"window=PrivateMessageDropDownBrowser"); // Used on default
sleep(1)
src << browse({"<meta http-equiv="Refresh" content="0; url=Clock.htm">"},"window=GiveDropDownBrowser"); // Used on default
sleep(1)
src << browse({"<meta http-equiv="Refresh" content="0; url=Clock.htm">"},"window=CodeBrowser"); // Used on default
}
}


Expected Results:
Browser controls load without inconsistency and failures.

Workarounds:
None at this time.
The browser control rewrites the script, because setting window.location to a byond:// URL doesn't actually work in this environment. It seems however as if something isn't working properly in this case.

Are you using 507.1274? You didn't mention the exact build number, and it's relevant because there was an issue with script rewrites that was fixed a few builds back.
Was running 1272. Just upgraded to 1274 and hit the same problem.

Lummox JR resolved issue with message:
Browser and cache file downloads were sometimes messed up by spurious messages meant for Dream Seeker clients only, usually at startup.