ID:1813273
 
Resolved
The JavaScript shim used by browser controls was buggy for some scripts.
BYOND Version:507
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 41.0.2272.89
Applies to:Webclient
Status: Resolved (507.1279)

This issue has been resolved.
In the screenshot, you can see a red error next to my body/onload line because I'm missing a .js file. Seems like .js files are occasionally loading.

Also, the generated file name being given to the .js files doesn't match what I have in the .html file so even if they do load, nothing works.



Same code loads fine in WinClient. Noticing some slow load times in the browser control. nocache settings doesn't help but is required.
Wondering if this by.fixjs is causing script errors and blocking the .js files from loading. That's one of the things that blocks the WebClient thread from downloading other resources (taking a long time to fail) and since it's being injected into my scripts, I suspect that's why my scripts aren't loading.

Does either of the tab demos you sent me show this in action? I'd like to take a look. I did notice there were problems at startup, which I think relate to an existing bug report about browsers at startup--this could be some of that.

The fixjs script is required by the webclient's browser control because of many games using lines like this:

window.location = "byond://?topic";

Without munging those, those games would be unplayable. I suspect that fixjs is not responsible for your issue though.
Trying to troubleshoot the problem but I'm having trouble clearing the localhost cache. Know how?

*edit* - Seriously have to recompile the game and upload it along with the web changes otherwise DreamDaemon magically serves up some cached copy that I can't find on the system. Anyway, different issue.
This is problem code.
<!doctype html>
<html>
<head>
<meta http-equiv='Pragma' content='no-cache'>
<meta http-equiv='Expires' content='0'>
<meta http-equiv='Cache-Control' content='no-cache'>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script>
function PageLoaded() {
window.location.href = "byond://?pageloaded=1";
}
function foo()
{
alert("test")
}
</script>
</head>
<body onload="foo()">
asdf
</body>
</html>


This is problem line. Remove it and WebClient gets no errors and hits the alert as expected. Note, I never call that PageLoaded function.
window.location.href = "byond://?pageloaded=1";


The errors
Uncaught RangeError: Invalid string length1.html:3 by.fixjs1.html:8 (anonymous function)
1.html:20 Uncaught ReferenceError: foo is not defined
1.html:3 Uncaught RangeError: Invalid string length
1.html:20 Uncaught ReferenceError: foo is not defined
Tried renaming the function and no luck. I'm declaring myself defeated for the night.
Lummox JR resolved issue with message:
The JavaScript shim used by browser controls was buggy for some scripts.